]> git.tdb.fi Git - libs/crypto.git/blobdiff - source/sha2.h
Slightly shorten the names of the constant structs
[libs/crypto.git] / source / sha2.h
index ed5c4fe36d0a210dd8c24e740565eaa888c17941..88dee9a03563d2103695db25d9039a789e94bc4e 100644 (file)
@@ -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<SHA2_256Constants> SHA256;
-typedef SHA2<SHA2_512Constants> SHA512;
+typedef SHA2<SHA256Constants> SHA256;
+typedef SHA2<SHA512Constants> SHA512;
 
 } // namespace Crypto
 } // namespace Msp