From 96d6eb6f29c55e16a37cf11899547886f735b065 Mon Sep 17 00:00:00 2001 From: lloyd Date: Mon, 30 Mar 2009 18:27:18 +0000 Subject: 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). --- src/hash/md4/md4.cpp | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) (limited to 'src/hash/md4/md4.cpp') diff --git a/src/hash/md4/md4.cpp b/src/hash/md4/md4.cpp index 83302f215..c0b52faa4 100644 --- a/src/hash/md4/md4.cpp +++ b/src/hash/md4/md4.cpp @@ -1,7 +1,9 @@ -/************************************************* -* MD4 Source File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ +/* +* MD4 +* (C) 1999-2007 Jack Lloyd +* +* Distributed under the terms of the Botan license +*/ #include #include @@ -11,27 +13,27 @@ namespace Botan { namespace { -/************************************************* -* MD4 FF Function * -*************************************************/ +/* +* MD4 FF Function +*/ inline void FF(u32bit& A, u32bit B, u32bit C, u32bit D, u32bit M, byte S) { A += (D ^ (B & (C ^ D))) + M; A = rotate_left(A, S); } -/************************************************* -* MD4 GG Function * -*************************************************/ +/* +* MD4 GG Function +*/ inline void GG(u32bit& A, u32bit B, u32bit C, u32bit D, u32bit M, byte S) { A += ((B & C) | (D & (B | C))) + M + 0x5A827999; A = rotate_left(A, S); } -/************************************************* -* MD4 HH Function * -*************************************************/ +/* +* MD4 HH Function +*/ inline void HH(u32bit& A, u32bit B, u32bit C, u32bit D, u32bit M, byte S) { A += (B ^ C ^ D) + M + 0x6ED9EBA1; @@ -40,9 +42,9 @@ inline void HH(u32bit& A, u32bit B, u32bit C, u32bit D, u32bit M, byte S) } -/************************************************* -* MD4 Compression Function * -*************************************************/ +/* +* MD4 Compression Function +*/ void MD4::compress_n(const byte input[], u32bit blocks) { u32bit A = digest[0], B = digest[1], C = digest[2], D = digest[3]; @@ -81,18 +83,18 @@ void MD4::compress_n(const byte input[], u32bit blocks) } } -/************************************************* -* Copy out the digest * -*************************************************/ +/* +* Copy out the digest +*/ void MD4::copy_out(byte output[]) { for(u32bit j = 0; j != OUTPUT_LENGTH; j += 4) store_le(digest[j/4], output + j); } -/************************************************* -* Clear memory of sensitive data * -*************************************************/ +/* +* Clear memory of sensitive data +*/ void MD4::clear() throw() { MDx_HashFunction::clear(); -- cgit v1.2.3