OpenCore
1.0.4
OpenCore Bootloader
|
Go to the source code of this file.
Data Structures | |
struct | AES_CONTEXT_ |
struct | CHACHA_CONTEXT_ |
struct | MD5_CONTEXT_ |
struct | SHA1_CONTEXT_ |
struct | SHA256_CONTEXT_ |
struct | SHA512_CONTEXT_ |
struct | OC_RSA_PUBLIC_KEY_HDR |
struct | OC_RSA_PUBLIC_KEY |
Macros | |
#define | CONFIG_AES_KEY_SIZE 16 |
#define | OC_CRYPTO_SUPPORTS_SHA256 1 |
#define | OC_CRYPTO_SUPPORTS_SHA384 1 |
#define | OC_CRYPTO_SUPPORTS_SHA512 1 |
#define | OC_CRYPTO_SUPPORTS_SHA1 1 |
#define | OC_CRYPTO_SUPPORTS_MD5 1 |
#define | MD5_DIGEST_SIZE 16 |
#define | SHA1_DIGEST_SIZE 20 |
#define | SHA256_DIGEST_SIZE 32 |
#define | SHA384_DIGEST_SIZE 48 |
#define | SHA512_DIGEST_SIZE 64 |
#define | OC_MAX_SHA_DIGEST_SIZE SHA512_DIGEST_SIZE |
#define | SHA256_BLOCK_SIZE 64 |
#define | SHA512_BLOCK_SIZE 128 |
#define | SHA384_BLOCK_SIZE SHA512_BLOCK_SIZE |
#define | AES_BLOCK_SIZE 16 |
#define | AES_KEY_EXP_SIZE 176 |
#define | CHACHA_KEY_SIZE 32 |
#define | CHACHA_IV_SIZE 12 |
#define | OC_PASSWORD_MAX_LEN 32 |
#define | OC_PASSWORD_MAX_RETRIES 3 |
#define | RSA_MOD_MAX_SIZE BASE_16KB |
#define | RSA_SCRATCH_BUFFER_SIZE(ModulusSize) |
Typedefs | |
typedef enum OC_SIG_HASH_TYPE_ | OC_SIG_HASH_TYPE |
typedef struct AES_CONTEXT_ | AES_CONTEXT |
typedef struct CHACHA_CONTEXT_ | CHACHA_CONTEXT |
typedef struct MD5_CONTEXT_ | MD5_CONTEXT |
typedef struct SHA1_CONTEXT_ | SHA1_CONTEXT |
typedef struct SHA256_CONTEXT_ | SHA256_CONTEXT |
typedef struct SHA512_CONTEXT_ | SHA512_CONTEXT |
typedef SHA512_CONTEXT | SHA384_CONTEXT |
Enumerations | |
enum | OC_SIG_HASH_TYPE_ { OcSigHashTypeSha256 , OcSigHashTypeSha384 , OcSigHashTypeSha512 , OcSigHashTypeMax } |
Functions | |
STATIC_ASSERT (sizeof(OC_RSA_PUBLIC_KEY_HDR)==16, "The PK header struct is malformed.") | |
STATIC_ASSERT (sizeof(OC_RSA_PUBLIC_KEY_HDR)==sizeof(OC_RSA_PUBLIC_KEY_HDR), "The PK struct is malformed.") | |
VOID | AesInitCtxIv (OUT AES_CONTEXT *Context, IN CONST UINT8 *Key, IN CONST UINT8 *Iv) |
VOID | AesSetCtxIv (OUT AES_CONTEXT *Context, IN CONST UINT8 *Iv) |
VOID | AesCbcEncryptBuffer (IN OUT AES_CONTEXT *Context, IN OUT UINT8 *Data, IN UINT32 Len) |
VOID | AesCbcDecryptBuffer (IN OUT AES_CONTEXT *Context, IN OUT UINT8 *Data, IN UINT32 Len) |
VOID | AesCtrXcryptBuffer (IN OUT AES_CONTEXT *Context, IN OUT UINT8 *Data, IN UINT32 Len) |
VOID | ChaChaInitCtx (OUT CHACHA_CONTEXT *Context, IN CONST UINT8 *Key, IN CONST UINT8 *Iv, IN UINT32 Counter) |
VOID | ChaChaCryptBuffer (IN OUT CHACHA_CONTEXT *Context, IN CONST UINT8 *Source, OUT UINT8 *Destination, IN UINT32 Length) |
VOID | Md5Init (MD5_CONTEXT *Context) |
VOID | Md5Update (MD5_CONTEXT *Context, CONST UINT8 *Data, UINTN Len) |
VOID | Md5Final (MD5_CONTEXT *Context, UINT8 *Hash) |
VOID | Md5 (UINT8 *Hash, UINT8 *Data, UINTN Len) |
VOID | Sha1Init (SHA1_CONTEXT *Context) |
VOID | Sha1Update (SHA1_CONTEXT *Context, CONST UINT8 *Data, UINTN Len) |
VOID | Sha1Final (SHA1_CONTEXT *Context, UINT8 *Hash) |
VOID | Sha1 (UINT8 *Hash, UINT8 *Data, UINTN Len) |
VOID | Sha256Init (SHA256_CONTEXT *Context) |
VOID | Sha256Update (SHA256_CONTEXT *Context, CONST UINT8 *Data, UINTN Len) |
VOID | Sha256Final (SHA256_CONTEXT *Context, UINT8 *HashDigest) |
VOID | Sha256 (UINT8 *Hash, CONST UINT8 *Data, UINTN Len) |
VOID | Sha512Init (SHA512_CONTEXT *Context) |
VOID | Sha512Update (SHA512_CONTEXT *Context, CONST UINT8 *Data, UINTN Len) |
VOID | Sha512Final (SHA512_CONTEXT *Context, UINT8 *HashDigest) |
VOID | Sha512 (UINT8 *Hash, CONST UINT8 *Data, UINTN Len) |
VOID | Sha384Init (SHA384_CONTEXT *Context) |
VOID | Sha384Update (SHA384_CONTEXT *Context, CONST UINT8 *Data, UINTN Len) |
VOID | Sha384Final (SHA384_CONTEXT *Context, UINT8 *HashDigest) |
VOID | Sha384 (UINT8 *Hash, CONST UINT8 *Data, UINTN Len) |
BOOLEAN EFIAPI | TryEnableAccel (VOID) |
INTN | SigVerifyShaHashBySize (IN CONST VOID *Data, IN UINTN DataSize, IN CONST UINT8 *Hash, IN UINTN HashSize) |
STATIC_ASSERT (RSA_MOD_MAX_SIZE<=MAX_UINTN/3U, "The definition of RSA_SCRATCH_BUFFER_SIZE may cause an overflow") | |
BOOLEAN | RsaVerifySigHashFromKey (IN CONST OC_RSA_PUBLIC_KEY *Key, IN CONST UINT8 *Signature, IN UINTN SignatureSize, IN CONST UINT8 *Hash, IN UINTN HashSize, IN OC_SIG_HASH_TYPE Algorithm, IN VOID *Scratch) |
BOOLEAN | RsaVerifySigHashFromKeyDynalloc (IN CONST OC_RSA_PUBLIC_KEY *Key, IN CONST UINT8 *Signature, IN UINTN SignatureSize, IN CONST UINT8 *Hash, IN UINTN HashSize, IN OC_SIG_HASH_TYPE Algorithm) |
BOOLEAN | RsaVerifySigDataFromKey (IN CONST OC_RSA_PUBLIC_KEY *Key, IN CONST UINT8 *Signature, IN UINTN SignatureSize, IN CONST UINT8 *Data, IN UINTN DataSize, IN OC_SIG_HASH_TYPE Algorithm, IN VOID *Scratch) |
BOOLEAN | RsaVerifySigDataFromKeyDynalloc (IN CONST OC_RSA_PUBLIC_KEY *Key, IN CONST UINT8 *Signature, IN UINTN SignatureSize, IN CONST UINT8 *Data, IN UINTN DataSize, IN OC_SIG_HASH_TYPE Algorithm) |
BOOLEAN | RsaVerifySigDataFromData (IN CONST UINT8 *Modulus, IN UINTN ModulusSize, IN UINT32 Exponent, IN CONST UINT8 *Signature, IN UINTN SignatureSize, IN CONST UINT8 *Data, IN UINTN DataSize, IN OC_SIG_HASH_TYPE Algorithm) |
INTN | SecureCompareMem (IN CONST VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length) |
VOID * | SecureZeroMem (OUT VOID *Buffer, IN UINTN Length) |
VOID | OcHashPasswordSha512 (IN CONST UINT8 *Password, IN UINT32 PasswordSize, IN CONST UINT8 *Salt, IN UINT32 SaltSize, OUT UINT8 *Hash) |
BOOLEAN | OcVerifyPasswordSha512 (IN CONST UINT8 *Password, IN UINT32 PasswordSize, IN CONST UINT8 *Salt, IN UINT32 SaltSize, IN CONST UINT8 *RefHash) |
OcCryptoLib
Copyright (c) 2018, savvas
All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Definition in file OcCryptoLib.h.
#define AES_BLOCK_SIZE 16 |
Definition at line 61 of file OcCryptoLib.h.
#define AES_KEY_EXP_SIZE 176 |
Definition at line 71 of file OcCryptoLib.h.
#define CHACHA_IV_SIZE 12 |
Definition at line 84 of file OcCryptoLib.h.
#define CHACHA_KEY_SIZE 32 |
Definition at line 79 of file OcCryptoLib.h.
#define CONFIG_AES_KEY_SIZE 16 |
Definition at line 26 of file OcCryptoLib.h.
#define MD5_DIGEST_SIZE 16 |
Definition at line 43 of file OcCryptoLib.h.
#define OC_CRYPTO_SUPPORTS_MD5 1 |
Definition at line 37 of file OcCryptoLib.h.
#define OC_CRYPTO_SUPPORTS_SHA1 1 |
Definition at line 36 of file OcCryptoLib.h.
#define OC_CRYPTO_SUPPORTS_SHA256 1 |
Definition at line 33 of file OcCryptoLib.h.
#define OC_CRYPTO_SUPPORTS_SHA384 1 |
Definition at line 34 of file OcCryptoLib.h.
#define OC_CRYPTO_SUPPORTS_SHA512 1 |
Definition at line 35 of file OcCryptoLib.h.
#define OC_MAX_SHA_DIGEST_SIZE SHA512_DIGEST_SIZE |
Definition at line 49 of file OcCryptoLib.h.
#define OC_PASSWORD_MAX_LEN 32 |
Definition at line 89 of file OcCryptoLib.h.
#define OC_PASSWORD_MAX_RETRIES 3 |
Definition at line 94 of file OcCryptoLib.h.
#define RSA_MOD_MAX_SIZE BASE_16KB |
Definition at line 425 of file OcCryptoLib.h.
#define RSA_SCRATCH_BUFFER_SIZE | ( | ModulusSize | ) |
[in] | ModulusSize | Modulus size in bytes. Must be at most RSA_MOD_MAX_SIZE. |
Definition at line 431 of file OcCryptoLib.h.
#define SHA1_DIGEST_SIZE 20 |
Definition at line 44 of file OcCryptoLib.h.
#define SHA256_BLOCK_SIZE 64 |
Definition at line 54 of file OcCryptoLib.h.
#define SHA256_DIGEST_SIZE 32 |
Definition at line 45 of file OcCryptoLib.h.
#define SHA384_BLOCK_SIZE SHA512_BLOCK_SIZE |
Definition at line 56 of file OcCryptoLib.h.
#define SHA384_DIGEST_SIZE 48 |
Definition at line 46 of file OcCryptoLib.h.
#define SHA512_BLOCK_SIZE 128 |
Definition at line 55 of file OcCryptoLib.h.
#define SHA512_DIGEST_SIZE 64 |
Definition at line 47 of file OcCryptoLib.h.
typedef struct AES_CONTEXT_ AES_CONTEXT |
typedef struct CHACHA_CONTEXT_ CHACHA_CONTEXT |
typedef struct MD5_CONTEXT_ MD5_CONTEXT |
typedef enum OC_SIG_HASH_TYPE_ OC_SIG_HASH_TYPE |
typedef struct SHA1_CONTEXT_ SHA1_CONTEXT |
typedef struct SHA256_CONTEXT_ SHA256_CONTEXT |
typedef SHA512_CONTEXT SHA384_CONTEXT |
Definition at line 146 of file OcCryptoLib.h.
typedef struct SHA512_CONTEXT_ SHA512_CONTEXT |
enum OC_SIG_HASH_TYPE_ |
Enumerator | |
---|---|
OcSigHashTypeSha256 | |
OcSigHashTypeSha384 | |
OcSigHashTypeSha512 | |
OcSigHashTypeMax |
Definition at line 101 of file OcCryptoLib.h.
VOID AesCbcDecryptBuffer | ( | IN OUT AES_CONTEXT * | Context, |
IN OUT UINT8 * | Data, | ||
IN UINT32 | Len ) |
VOID AesCbcEncryptBuffer | ( | IN OUT AES_CONTEXT * | Context, |
IN OUT UINT8 * | Data, | ||
IN UINT32 | Len ) |
VOID AesCtrXcryptBuffer | ( | IN OUT AES_CONTEXT * | Context, |
IN OUT UINT8 * | Data, | ||
IN UINT32 | Len ) |
VOID AesInitCtxIv | ( | OUT AES_CONTEXT * | Context, |
IN CONST UINT8 * | Key, | ||
IN CONST UINT8 * | Iv ) |
VOID AesSetCtxIv | ( | OUT AES_CONTEXT * | Context, |
IN CONST UINT8 * | Iv ) |
VOID ChaChaCryptBuffer | ( | IN OUT CHACHA_CONTEXT * | Context, |
IN CONST UINT8 * | Source, | ||
OUT UINT8 * | Destination, | ||
IN UINT32 | Length ) |
VOID ChaChaInitCtx | ( | OUT CHACHA_CONTEXT * | Context, |
IN CONST UINT8 * | Key, | ||
IN CONST UINT8 * | Iv, | ||
IN UINT32 | Counter ) |
VOID Md5 | ( | UINT8 * | Hash, |
UINT8 * | Data, | ||
UINTN | Len ) |
VOID Md5Final | ( | MD5_CONTEXT * | Context, |
UINT8 * | Hash ) |
VOID Md5Init | ( | MD5_CONTEXT * | Context | ) |
VOID Md5Update | ( | MD5_CONTEXT * | Context, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
VOID OcHashPasswordSha512 | ( | IN CONST UINT8 * | Password, |
IN UINT32 | PasswordSize, | ||
IN CONST UINT8 * | Salt, | ||
IN UINT32 | SaltSize, | ||
OUT UINT8 * | Hash ) |
Hash Password and Salt into a PasswordHash. The used hash function is SHA-512, thus the caller must ensure RefHash is at least 64 bytes in size.
[in] | Password | The entered password to hash. |
[in] | PasswordSize | The size, in bytes, of Password. |
[in] | Salt | The cryptographic salt appended to Password on hash. |
[in] | SaltSize | The size, in bytes, of Salt. |
[in] | Hash | The SHA-512 hash of Password and Salt. |
Definition at line 17 of file PasswordHash.c.
BOOLEAN OcVerifyPasswordSha512 | ( | IN CONST UINT8 * | Password, |
IN UINT32 | PasswordSize, | ||
IN CONST UINT8 * | Salt, | ||
IN UINT32 | SaltSize, | ||
IN CONST UINT8 * | RefHash ) |
Verify Password and Salt against RefHash. The used hash function is SHA-512, thus the caller must ensure RefHash is at least 64 bytes in size.
[in] | Password | The entered password to verify. |
[in] | PasswordSize | The size, in bytes, of Password. |
[in] | Salt | The cryptographic salt appended to Password on hash. |
[in] | SaltSize | The size, in bytes, of Salt. |
[in] | RefHash | The SHA-512 hash of the reference password and Salt. |
Definition at line 69 of file PasswordHash.c.
BOOLEAN RsaVerifySigDataFromData | ( | IN CONST UINT8 * | Modulus, |
IN UINTN | ModulusSize, | ||
IN UINT32 | Exponent, | ||
IN CONST UINT8 * | Signature, | ||
IN UINTN | SignatureSize, | ||
IN CONST UINT8 * | Data, | ||
IN UINTN | DataSize, | ||
IN OC_SIG_HASH_TYPE | Algorithm ) |
Verify RSA PKCS1.5 signed data against its signature. The modulus' size must be a multiple of the configured BIGNUM word size. This will be true for any conventional RSA, which use two's potencies.
[in] | Modulus | The RSA modulus byte array. |
[in] | ModulusSize | The size, in bytes, of Modulus. |
[in] | Exponent | The RSA exponent. |
[in] | Signature | The RSA signature to be verified. |
[in] | SignatureSize | Size, in bytes, of Signature. |
[in] | Data | The signed data to verify. |
[in] | DataSize | Size, in bytes, of Data. |
[in] | Algorithm | The RSA algorithm used. |
Definition at line 488 of file RsaDigitalSign.c.
BOOLEAN RsaVerifySigDataFromKey | ( | IN CONST OC_RSA_PUBLIC_KEY * | Key, |
IN CONST UINT8 * | Signature, | ||
IN UINTN | SignatureSize, | ||
IN CONST UINT8 * | Data, | ||
IN UINTN | DataSize, | ||
IN OC_SIG_HASH_TYPE | Algorithm, | ||
IN VOID * | Scratch ) |
Verify RSA PKCS1.5 signed data against its signature. The modulus' size must be a multiple of the configured BIGNUM word size. This will be true for any conventional RSA, which use two's potencies. The exponent is always 65537 as per the format specification.
[in] | Key | The RSA Public Key. |
[in] | Signature | The RSA signature to be verified. |
[in] | SignatureSize | Size, in bytes, of Signature. |
[in] | Data | The signed data to verify. |
[in] | DataSize | Size, in bytes, of Data. |
[in] | Algorithm | The RSA algorithm used. |
[in] | Scratch | Scratch buffer 3xModulo. |
Definition at line 673 of file RsaDigitalSign.c.
BOOLEAN RsaVerifySigDataFromKeyDynalloc | ( | IN CONST OC_RSA_PUBLIC_KEY * | Key, |
IN CONST UINT8 * | Signature, | ||
IN UINTN | SignatureSize, | ||
IN CONST UINT8 * | Data, | ||
IN UINTN | DataSize, | ||
IN OC_SIG_HASH_TYPE | Algorithm ) |
Verify RSA PKCS1.5 signed data against its signature. The modulus' size must be a multiple of the configured BIGNUM word size. This will be true for any conventional RSA, which use two's potencies. The exponent is always 65537 as per the format specification.
[in] | Key | The RSA Public Key. |
[in] | Signature | The RSA signature to be verified. |
[in] | SignatureSize | Size, in bytes, of Signature. |
[in] | Data | The signed data to verify. |
[in] | DataSize | Size, in bytes, of Data. |
[in] | Algorithm | The RSA algorithm used. |
Definition at line 715 of file RsaDigitalSign.c.
BOOLEAN RsaVerifySigHashFromKey | ( | IN CONST OC_RSA_PUBLIC_KEY * | Key, |
IN CONST UINT8 * | Signature, | ||
IN UINTN | SignatureSize, | ||
IN CONST UINT8 * | Hash, | ||
IN UINTN | HashSize, | ||
IN OC_SIG_HASH_TYPE | Algorithm, | ||
IN VOID * | Scratch ) |
Verify a RSA PKCS1.5 signature against an expected hash. The exponent is always 65537 as per the format specification.
[in] | Key | The RSA Public Key. |
[in] | Signature | The RSA signature to be verified. |
[in] | SignatureSize | Size, in bytes, of Signature. |
[in] | Hash | The Hash digest of the signed data. |
[in] | HashSize | Size, in bytes, of Hash. |
[in] | Algorithm | The RSA algorithm used. |
[in] | Scratch | Scratch buffer 3xModulo. |
Definition at line 589 of file RsaDigitalSign.c.
BOOLEAN RsaVerifySigHashFromKeyDynalloc | ( | IN CONST OC_RSA_PUBLIC_KEY * | Key, |
IN CONST UINT8 * | Signature, | ||
IN UINTN | SignatureSize, | ||
IN CONST UINT8 * | Hash, | ||
IN UINTN | HashSize, | ||
IN OC_SIG_HASH_TYPE | Algorithm ) |
Verify a RSA PKCS1.5 signature against an expected hash. The exponent is always 65537 as per the format specification.
[in] | Key | The RSA Public Key. |
[in] | Signature | The RSA signature to be verified. |
[in] | SignatureSize | Size, in bytes, of Signature. |
[in] | Hash | The Hash digest of the signed data. |
[in] | HashSize | Size, in bytes, of Hash. |
[in] | Algorithm | The RSA algorithm used. |
Definition at line 631 of file RsaDigitalSign.c.
INTN SecureCompareMem | ( | IN CONST VOID * | DestinationBuffer, |
IN CONST VOID * | SourceBuffer, | ||
IN UINTN | Length ) |
Performs a cryptographically secure comparison of the contents of two buffers.
This function compares Length bytes of SourceBuffer to Length bytes of DestinationBuffer in a cryptographically secure fashion. This especially implies that different lengths of the longest shared prefix do not change execution time in a way relevant to security.
If Length > 0 and DestinationBuffer is NULL, then ASSERT(). If Length > 0 and SourceBuffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - DestinationBuffer + 1), then ASSERT(). If Length is greater than (MAX_ADDRESS - SourceBuffer + 1), then ASSERT().
DestinationBuffer | The pointer to the destination buffer to compare. |
SourceBuffer | The pointer to the source buffer to compare. |
Length | The number of bytes to compare. |
-1 | The two buffers are not identical within Length bytes. |
Definition at line 17 of file SecureMem.c.
VOID * SecureZeroMem | ( | OUT VOID * | Buffer, |
IN UINTN | Length ) |
Performs a cryptographically secure memory zeroing.
If Length > 0 and Buffer is NULL, then ASSERT(). If Length is greater than (MAX_ADDRESS - Buffer + 1), then ASSERT().
[out] | Buffer | The pointer to the destination buffer to zero. |
[in] | Length | The number of bytes to zero. |
Definition at line 73 of file SecureMem.c.
VOID Sha1 | ( | UINT8 * | Hash, |
UINT8 * | Data, | ||
UINTN | Len ) |
VOID Sha1Final | ( | SHA1_CONTEXT * | Context, |
UINT8 * | Hash ) |
VOID Sha1Init | ( | SHA1_CONTEXT * | Context | ) |
VOID Sha1Update | ( | SHA1_CONTEXT * | Context, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
VOID Sha256 | ( | UINT8 * | Hash, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
VOID Sha256Final | ( | SHA256_CONTEXT * | Context, |
UINT8 * | HashDigest ) |
VOID Sha256Init | ( | SHA256_CONTEXT * | Context | ) |
VOID Sha256Update | ( | SHA256_CONTEXT * | Context, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
VOID Sha384 | ( | UINT8 * | Hash, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
VOID Sha384Final | ( | SHA384_CONTEXT * | Context, |
UINT8 * | HashDigest ) |
VOID Sha384Init | ( | SHA384_CONTEXT * | Context | ) |
VOID Sha384Update | ( | SHA384_CONTEXT * | Context, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
VOID Sha512 | ( | UINT8 * | Hash, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
VOID Sha512Final | ( | SHA512_CONTEXT * | Context, |
UINT8 * | HashDigest ) |
VOID Sha512Init | ( | SHA512_CONTEXT * | Context | ) |
VOID Sha512Update | ( | SHA512_CONTEXT * | Context, |
CONST UINT8 * | Data, | ||
UINTN | Len ) |
INTN SigVerifyShaHashBySize | ( | IN CONST VOID * | Data, |
IN UINTN | DataSize, | ||
IN CONST UINT8 * | Hash, | ||
IN UINTN | HashSize ) |
Verifies Data against Hash with the appropiate SHA2 algorithm for HashSize.
[in] | Data | The data to verify the hash of. |
[in] | DataSize | The, in bytes, of Data. |
[in] | Hash | The reference hash to verify against. |
[in] | HashSize | The size, in bytes, of Hash. |
Non-zero | If HashSize is not a valid SHA2 digest size, -1. Otherwise, the first mismatched byte in Data's hash subtracted from the first mismatched byte in Hash. |
Definition at line 87 of file RsaDigitalSign.c.
STATIC_ASSERT | ( | RSA_MOD_MAX_SIZE<=MAX_UINTN/ | 3U, |
"The definition of RSA_SCRATCH_BUFFER_SIZE may cause an overflow" | ) |
STATIC_ASSERT | ( | sizeof(OC_RSA_PUBLIC_KEY_HDR) | = =16, |
"The PK header struct is malformed." | ) |
STATIC_ASSERT | ( | sizeof(OC_RSA_PUBLIC_KEY_HDR) | = =sizeof(OC_RSA_PUBLIC_KEY_HDR), |
"The PK struct is malformed." | ) |
BOOLEAN EFIAPI TryEnableAccel | ( | VOID | ) |
Definition at line 34 of file Sha512AccelDummy.c.