Fork of François Berder Crypto, fixed AES CBC and small rework

Dependents:   AES_example shaun_larada Smartage

Fork of Crypto by Francois Berder

Revision:
5:06cd9c8afa0b
Parent:
4:0da19393bd57
Child:
6:19aa835f2bbb
diff -r 0da19393bd57 -r 06cd9c8afa0b SHA2_32.cpp
--- a/SHA2_32.cpp	Thu Sep 12 10:18:57 2013 +0000
+++ b/SHA2_32.cpp	Thu Sep 12 15:08:51 2013 +0000
@@ -66,7 +66,7 @@
     }
 }
 
-void SHA2_32::add(uint8_t *in, uint32_t length)
+void SHA2_32::update(uint8_t *in, uint32_t length)
 {
     if(length < 64-bufferLength)
     {
@@ -91,7 +91,7 @@
     totalBufferLength += length;
 }
 
-void SHA2_32::computeDigest(uint8_t *digest)
+void SHA2_32::finalize(uint8_t *digest)
 {
     uint16_t padding;
     if(totalBufferLength % 64 < 56)
@@ -107,7 +107,7 @@
     {
         memset(&buffer[bufferLength], 0, 64-bufferLength);
         computeBlock(&h0, &h1, &h2, &h3, &h4, &h5, &h6, &h7, buffer);
-        memset(buffer, 0, 48);
+        memset(buffer, 0, 56);
     }
     
     uint64_t lengthBit = totalBufferLength << 3;
@@ -295,7 +295,7 @@
     {
         memset(&buffer[length], 0, 64-length);
         computeBlock(&h0, &h1, &h2, &h3, &h4, &h5, &h6, &h7, buffer);
-        memset(buffer, 0, 48);
+        memset(buffer, 0, 56);
     }
     
     uint32_t lengthBitLow = lengthBit;