aboutsummaryrefslogtreecommitdiffstats
path: root/src/mac/hmac
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-03-30 18:27:18 +0000
committerlloyd <[email protected]>2009-03-30 18:27:18 +0000
commit96d6eb6f29c55e16a37cf11899547886f735b065 (patch)
tree9f13901e9b44c98d58b2589c9b09c6a7443eb7cd /src/mac/hmac
parent3cc3dd72c5f87b76852a55c1f2d1821dba967d8c (diff)
Thomas Moschny passed along a request from the Fedora packagers which came
up during the Fedora submission review, that each source file include some text about the license. One handy Perl script later and each file now has the line Distributed under the terms of the Botan license after the copyright notices. While I was in there modifying every file anyway, I also stripped out the remainder of the block comments (lots of astericks before and after the text); this is stylistic thing I picked up when I was first learning C++ but in retrospect it is not a good style as the structure makes it harder to modify comments (with the result that comments become fewer, shorter and are less likely to be updated, which are not good things).
Diffstat (limited to 'src/mac/hmac')
-rw-r--r--src/mac/hmac/hmac.cpp54
-rw-r--r--src/mac/hmac/hmac.h16
2 files changed, 37 insertions, 33 deletions
diff --git a/src/mac/hmac/hmac.cpp b/src/mac/hmac/hmac.cpp
index 15552b8ea..717e2640c 100644
--- a/src/mac/hmac/hmac.cpp
+++ b/src/mac/hmac/hmac.cpp
@@ -1,25 +1,27 @@
-/*************************************************
-* HMAC Source File *
-* (C) 1999-2007 Jack Lloyd *
-* 2007 Yves Jerschow *
-*************************************************/
+/*
+* HMAC
+* (C) 1999-2007 Jack Lloyd
+* 2007 Yves Jerschow
+*
+* Distributed under the terms of the Botan license
+*/
#include <botan/hmac.h>
#include <botan/xor_buf.h>
namespace Botan {
-/*************************************************
-* Update a HMAC Calculation *
-*************************************************/
+/*
+* Update a HMAC Calculation
+*/
void HMAC::add_data(const byte input[], u32bit length)
{
hash->update(input, length);
}
-/*************************************************
-* Finalize a HMAC Calculation *
-*************************************************/
+/*
+* Finalize a HMAC Calculation
+*/
void HMAC::final_result(byte mac[])
{
hash->final(mac);
@@ -29,9 +31,9 @@ void HMAC::final_result(byte mac[])
hash->update(i_key);
}
-/*************************************************
-* HMAC Key Schedule *
-*************************************************/
+/*
+* HMAC Key Schedule
+*/
void HMAC::key_schedule(const byte key[], u32bit length)
{
hash->clear();
@@ -53,9 +55,9 @@ void HMAC::key_schedule(const byte key[], u32bit length)
hash->update(i_key);
}
-/*************************************************
-* Clear memory of sensitive data *
-*************************************************/
+/*
+* Clear memory of sensitive data
+*/
void HMAC::clear() throw()
{
hash->clear();
@@ -63,25 +65,25 @@ void HMAC::clear() throw()
o_key.clear();
}
-/*************************************************
-* Return the name of this type *
-*************************************************/
+/*
+* Return the name of this type
+*/
std::string HMAC::name() const
{
return "HMAC(" + hash->name() + ")";
}
-/*************************************************
-* Return a clone of this object *
-*************************************************/
+/*
+* Return a clone of this object
+*/
MessageAuthenticationCode* HMAC::clone() const
{
return new HMAC(hash->clone());
}
-/*************************************************
-* HMAC Constructor *
-*************************************************/
+/*
+* HMAC Constructor
+*/
HMAC::HMAC(HashFunction* hash_in) :
MessageAuthenticationCode(hash_in->OUTPUT_LENGTH,
1, 2*hash_in->HASH_BLOCK_SIZE),
diff --git a/src/mac/hmac/hmac.h b/src/mac/hmac/hmac.h
index c3081edfd..932af71fc 100644
--- a/src/mac/hmac/hmac.h
+++ b/src/mac/hmac/hmac.h
@@ -1,7 +1,9 @@
-/*************************************************
-* HMAC Header File *
-* (C) 1999-2007 Jack Lloyd *
-*************************************************/
+/*
+* HMAC
+* (C) 1999-2007 Jack Lloyd
+*
+* Distributed under the terms of the Botan license
+*/
#ifndef BOTAN_HMAC_H__
#define BOTAN_HMAC_H__
@@ -11,9 +13,9 @@
namespace Botan {
-/*************************************************
-* HMAC *
-*************************************************/
+/*
+* HMAC
+*/
class BOTAN_DLL HMAC : public MessageAuthenticationCode
{
public: