diff options
author | Michael G.A. Holland <michael.holland@intel.com> | 2024-08-21 12:18:38 -0500 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-08-29 00:30:38 +0000 |
commit | 9cd66aca1a54b10dd3f6adcfef8d784281385a2c (patch) | |
tree | 5947d827aa0e54a19d70fd7f7a39f828ec06c384 /CryptoPkg | |
parent | 41a51d173557350ec8bcf64075a3e97730bf70dd (diff) | |
download | edk2-9cd66aca1a54b10dd3f6adcfef8d784281385a2c.tar.gz edk2-9cd66aca1a54b10dd3f6adcfef8d784281385a2c.tar.bz2 edk2-9cd66aca1a54b10dd3f6adcfef8d784281385a2c.zip |
CryptoPkg: Support BrainpoolP512r1 algorithm
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4830
Allow BrainpoolP512r1 to be leveraged when the corresponding curve ID
is passed to crypto libraries in EDK2
Signed-off-by: Michael G.A. Holland <michael.holland@intel.com>
Diffstat (limited to 'CryptoPkg')
-rw-r--r-- | CryptoPkg/Include/Library/BaseCryptLib.h | 7 | ||||
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c | 9 |
2 files changed, 13 insertions, 3 deletions
diff --git a/CryptoPkg/Include/Library/BaseCryptLib.h b/CryptoPkg/Include/Library/BaseCryptLib.h index 95e4142f52..84ed87e05a 100644 --- a/CryptoPkg/Include/Library/BaseCryptLib.h +++ b/CryptoPkg/Include/Library/BaseCryptLib.h @@ -23,9 +23,10 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define CRYPTO_NID_SHA512 0x0003
// Key Exchange
-#define CRYPTO_NID_SECP256R1 0x0204
-#define CRYPTO_NID_SECP384R1 0x0205
-#define CRYPTO_NID_SECP521R1 0x0206
+#define CRYPTO_NID_SECP256R1 0x0204
+#define CRYPTO_NID_SECP384R1 0x0205
+#define CRYPTO_NID_SECP521R1 0x0206
+#define CRYPTO_NID_BRAINPOOLP512R1 0x03A5
///
/// MD5 digest size in bytes
diff --git a/CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c b/CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c index d8cc9ba0e8..f85232bf6e 100644 --- a/CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c +++ b/CryptoPkg/Library/BaseCryptLib/Pk/CryptEc.c @@ -42,6 +42,9 @@ CryptoNidToOpensslNid ( case CRYPTO_NID_SECP521R1:
Nid = NID_secp521r1;
break;
+ case CRYPTO_NID_BRAINPOOLP512R1:
+ Nid = NID_brainpoolP512r1;
+ break;
default:
return -1;
}
@@ -833,6 +836,9 @@ EcDsaSign ( case NID_secp521r1:
HalfSize = 66;
break;
+ case NID_brainpoolP512r1:
+ HalfSize = 64;
+ break;
default:
return FALSE;
}
@@ -961,6 +967,9 @@ EcDsaVerify ( case NID_secp521r1:
HalfSize = 66;
break;
+ case NID_brainpoolP512r1:
+ HalfSize = 64;
+ break;
default:
return FALSE;
}
|