X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=CryptoPkg%2FLibrary%2FBaseCryptLib%2FHash%2FCryptSm3.c;h=bbbc1e56f2469199b8898f1c8a9385b77d840661;hp=235331c2a0382008c7f49081c02c5be8b821137b;hb=7c342378317039e632d9a1a5d4cf7c21aec8cb7a;hpb=8c30327debb28c0b6cfa2106b736774e0b20daac diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c index 235331c2a0..bbbc1e56f2 100644 --- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSm3.c @@ -24,7 +24,7 @@ Sm3GetContextSize ( // // Retrieves Openssl SM3 Context Size // - return (UINTN) (sizeof (SM3_CTX)); + return (UINTN)(sizeof (SM3_CTX)); } /** @@ -55,7 +55,7 @@ Sm3Init ( // // Openssl SM3 Context Initialization // - sm3_init ((SM3_CTX *) Sm3Context); + sm3_init ((SM3_CTX *)Sm3Context); return TRUE; } @@ -84,7 +84,7 @@ Sm3Duplicate ( // // Check input parameters. // - if (Sm3Context == NULL || NewSm3Context == NULL) { + if ((Sm3Context == NULL) || (NewSm3Context == NULL)) { return FALSE; } @@ -129,14 +129,14 @@ Sm3Update ( // // Check invalid parameters, in case that only DataLength was checked in Openssl // - if (Data == NULL && DataSize != 0) { + if ((Data == NULL) && (DataSize != 0)) { return FALSE; } // // Openssl SM3 Hash Update // - sm3_update ((SM3_CTX *) Sm3Context, Data, DataSize); + sm3_update ((SM3_CTX *)Sm3Context, Data, DataSize); return TRUE; } @@ -171,14 +171,14 @@ Sm3Final ( // // Check input parameters. // - if (Sm3Context == NULL || HashValue == NULL) { + if ((Sm3Context == NULL) || (HashValue == NULL)) { return FALSE; } // // Openssl SM3 Hash Finalization // - sm3_final (HashValue, (SM3_CTX *) Sm3Context); + sm3_final (HashValue, (SM3_CTX *)Sm3Context); return TRUE; } @@ -209,7 +209,7 @@ Sm3HashAll ( OUT UINT8 *HashValue ) { - SM3_CTX Ctx; + SM3_CTX Ctx; // // Check input parameters. @@ -217,18 +217,19 @@ Sm3HashAll ( if (HashValue == NULL) { return FALSE; } - if (Data == NULL && DataSize != 0) { + + if ((Data == NULL) && (DataSize != 0)) { return FALSE; } // // SM3 Hash Computation. // - sm3_init(&Ctx); + sm3_init (&Ctx); - sm3_update(&Ctx, Data, DataSize); + sm3_update (&Ctx, Data, DataSize); - sm3_final(HashValue, &Ctx); + sm3_final (HashValue, &Ctx); return TRUE; }