X-Git-Url: http://git.tdb.fi/?p=libs%2Fcrypto.git;a=blobdiff_plain;f=source%2Fsha2.h;h=88dee9a03563d2103695db25d9039a789e94bc4e;hp=ed5c4fe36d0a210dd8c24e740565eaa888c17941;hb=5909e8328a91e4ae952c0ab760cddddbc3825b27;hpb=6511a62c3cec0a64bbdd7ac8e3588d39c164af09 diff --git a/source/sha2.h b/source/sha2.h index ed5c4fe..88dee9a 100644 --- a/source/sha2.h +++ b/source/sha2.h @@ -34,7 +34,7 @@ private: }; -struct SHA2_256Constants +struct SHA256Constants { typedef UInt32 WordType; @@ -43,6 +43,7 @@ struct SHA2_256Constants WORD_SIZE = sizeof(WordType), BLOCK_SIZE = 64, // 512 bits DIGEST_SIZE = 32, // 256 bits + MIN_PADDING = 8, N_ROUNDS = 64 }; @@ -51,7 +52,7 @@ struct SHA2_256Constants static const unsigned sigma_constants[12]; }; -struct SHA2_512Constants +struct SHA512Constants { typedef UInt64 WordType; @@ -60,6 +61,7 @@ struct SHA2_512Constants WORD_SIZE = sizeof(WordType), BLOCK_SIZE = 128, // 1024 bits DIGEST_SIZE = 64, // 512 bits + MIN_PADDING = 16, N_ROUNDS = 80 }; @@ -68,8 +70,8 @@ struct SHA2_512Constants static const unsigned sigma_constants[12]; }; -typedef SHA2 SHA256; -typedef SHA2 SHA512; +typedef SHA2 SHA256; +typedef SHA2 SHA512; } // namespace Crypto } // namespace Msp