sync with trunk r46493
[reactos.git] / dll / win32 / rsaenh / implglue.c
index b73eba9..7ecfc28 100644 (file)
@@ -67,6 +67,18 @@ BOOL init_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext)
         case CALG_SHA:
             A_SHAInit(&pHashContext->sha);
             break;
+
+        case CALG_SHA_256:
+            SHA256_Init(&pHashContext->sha256);
+            break;
+
+        case CALG_SHA_384:
+            SHA384_Init(&pHashContext->sha384);
+            break;
+
+        case CALG_SHA_512:
+            SHA512_Init(&pHashContext->sha512);
+            break;
     }
 
     return TRUE;
@@ -93,6 +105,18 @@ BOOL update_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, CONST BYTE *pb
             A_SHAUpdate(&pHashContext->sha, pbData, dwDataLen);
             break;
         
+        case CALG_SHA_256:
+            SHA256_Update(&pHashContext->sha256, pbData, dwDataLen);
+            break;
+
+        case CALG_SHA_384:
+            SHA384_Update(&pHashContext->sha384, pbData, dwDataLen);
+            break;
+
+        case CALG_SHA_512:
+            SHA512_Update(&pHashContext->sha512, pbData, dwDataLen);
+            break;
+
         default:
             SetLastError(NTE_BAD_ALGID);
             return FALSE;
@@ -123,6 +147,18 @@ BOOL finalize_hash_impl(ALG_ID aiAlgid, HASH_CONTEXT *pHashContext, BYTE *pbHash
             A_SHAFinal(&pHashContext->sha, (PULONG)pbHashValue);
             break;
         
+        case CALG_SHA_256:
+            SHA256_Final(pbHashValue, &pHashContext->sha256);
+            break;
+
+        case CALG_SHA_384:
+            SHA384_Final(pbHashValue, &pHashContext->sha384);
+            break;
+
+        case CALG_SHA_512:
+            SHA512_Final(pbHashValue, &pHashContext->sha512);
+            break;
+
         default:
             SetLastError(NTE_BAD_ALGID);
             return FALSE;