diff --git a/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c b/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c index c12c7c5a627a8857e0c3080c672c3a89c5c1b4ec..f27cdca217248d3244caa26bbd2c8530de8e78d5 100644 --- a/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c +++ b/plugin/openssl_plugin/key/asy_key_generator/src/ecc_asy_key_generator_openssl.c @@ -15,8 +15,9 @@ #include "ecc_asy_key_generator_openssl.h" -#include -#include +#include "securec.h" +#include "openssl/pem.h" +#include "openssl/x509.h" #include "algorithm_parameter.h" #include "log.h" @@ -69,7 +70,7 @@ static HcfResult NewEcKeyPairByOpenssl(int32_t curveId, EC_POINT **returnPubKey, } BIGNUM *newPriKey = BN_dup(priKey); if (newPriKey == NULL) { - LOGE("copy pubKey fail."); + LOGE("copy priKey fail."); EC_KEY_free(ecKey); EC_POINT_free(newPubKey); return HCF_ERR_CRYPTO_OPERATION; @@ -225,28 +226,28 @@ static HcfResult GetEccPubKeyEncoded(HcfKey *self, HcfBlob *returnBlob) LOGE("Empty public key!"); return HCF_INVALID_PARAMS; } - EC_GROUP *group = EC_GROUP_new_by_curve_name(impl->curveId); - if (group == NULL) { + EC_KEY *ecKey = EC_KEY_new_by_curve_name(impl->curveId); + if (ecKey == NULL) { + LOGE("EC_KEY_new_by_curve_name fail."); HcfPrintOpensslError(); return HCF_ERR_CRYPTO_OPERATION; } - uint32_t maxLen = EC_POINT_point2oct(group, impl->pk, POINT_CONVERSION_UNCOMPRESSED, NULL, 0, NULL); - uint8_t *outData = (uint8_t *)HcfMalloc(maxLen, 0); - if (outData == NULL) { - LOGE("Failed to allocate outData memory!"); - EC_GROUP_free(group); - return HCF_ERR_MALLOC; + if (EC_KEY_set_public_key(ecKey, impl->pk) <= 0) { + LOGE("EC_KEY_set_public_key fail."); + HcfPrintOpensslError(); + EC_KEY_free(ecKey); + return HCF_ERR_CRYPTO_OPERATION; } - uint32_t actualLen = EC_POINT_point2oct(group, impl->pk, POINT_CONVERSION_UNCOMPRESSED, outData, maxLen, NULL); - EC_GROUP_free(group); - if (actualLen == 0) { + unsigned char *returnData = NULL; + int returnDataLen = i2d_EC_PUBKEY(ecKey, &returnData); + EC_KEY_free(ecKey); + if (returnDataLen <= 0) { + LOGE("i2d_EC_PUBKEY fail"); HcfPrintOpensslError(); - HcfFree(outData); return HCF_ERR_CRYPTO_OPERATION; } - - returnBlob->data = outData; - returnBlob->len = actualLen; + returnBlob->data = returnData; + returnBlob->len = returnDataLen; LOGI("end ..."); return HCF_SUCCESS; } @@ -267,21 +268,31 @@ static HcfResult GetEccPriKeyEncoded(HcfKey *self, HcfBlob *returnBlob) LOGE("Empty private key!"); return HCF_INVALID_PARAMS; } - uint32_t maxLen = BN_num_bytes(impl->sk); - uint8_t *outData = (uint8_t *)HcfMalloc(maxLen, 0); - if (outData == NULL) { - LOGE("Failed to allocate outData memory!"); - return HCF_ERR_MALLOC; + + EC_KEY *ecKey = EC_KEY_new_by_curve_name(impl->curveId); + if (ecKey == NULL) { + LOGE("EC_KEY_new_by_curve_name fail."); + HcfPrintOpensslError(); + return HCF_ERR_CRYPTO_OPERATION; } - uint32_t actualLen = BN_bn2binpad(impl->sk, outData, maxLen); - if (actualLen == 0) { + if (EC_KEY_set_private_key(ecKey, (impl->sk)) != HCF_OPENSSL_SUCCESS) { + LOGE("EC_KEY_set_private_key fail."); HcfPrintOpensslError(); - HcfFree(outData); + EC_KEY_free(ecKey); return HCF_ERR_CRYPTO_OPERATION; } - - returnBlob->data = outData; - returnBlob->len = actualLen; + EC_KEY_set_asn1_flag(ecKey, OPENSSL_EC_NAMED_CURVE); + EC_KEY_set_enc_flags(ecKey, EC_PKEY_NO_PUBKEY); + unsigned char *returnData = NULL; + int returnDataLen = i2d_ECPrivateKey(ecKey, &returnData); + EC_KEY_free(ecKey); + if (returnDataLen <= 0) { + LOGE("i2d_ECPrivateKey fail."); + HcfPrintOpensslError(); + return HCF_ERR_CRYPTO_OPERATION; + } + returnBlob->data = returnData; + returnBlob->len = returnDataLen; LOGI("end ..."); return HCF_SUCCESS; } @@ -356,27 +367,30 @@ static HcfResult CreateEccKeyPair(HcfOpensslEccPubKey *pubKey, HcfOpensslEccPriK static HcfResult ConvertEcPubKeyByOpenssl(int32_t curveId, HcfBlob *pubKeyBlob, HcfOpensslEccPubKey **returnPubKey) { - EC_GROUP *group = EC_GROUP_new_by_curve_name(curveId); - if (group == NULL) { + const unsigned char *tmpData = (const unsigned char *)(pubKeyBlob->data); + EC_KEY *ecKey = d2i_EC_PUBKEY(NULL, &tmpData, pubKeyBlob->len); + if (ecKey == NULL) { + LOGE("d2i_EC_PUBKEY fail."); HcfPrintOpensslError(); return HCF_ERR_CRYPTO_OPERATION; } - EC_POINT *point = EC_POINT_new(group); - if (point == NULL) { + const EC_POINT *pubKey = EC_KEY_get0_public_key(ecKey); + const EC_GROUP *group = EC_KEY_get0_group(ecKey); + if (pubKey == NULL || group == NULL) { + LOGE("ec key is invalid."); HcfPrintOpensslError(); - EC_GROUP_free(group); + EC_KEY_free(ecKey); return HCF_ERR_CRYPTO_OPERATION; } - if (EC_POINT_oct2point(group, point, pubKeyBlob->data, pubKeyBlob->len, NULL) != HCF_OPENSSL_SUCCESS) { - HcfPrintOpensslError(); - EC_POINT_free(point); - EC_GROUP_free(group); + EC_POINT *newPubKey = EC_POINT_dup(pubKey, group); + EC_KEY_free(ecKey); + if (newPubKey == NULL) { + LOGE("copy pubKey fail."); return HCF_ERR_CRYPTO_OPERATION; } - EC_GROUP_free(group); - int32_t res = CreateEccPubKey(curveId, point, returnPubKey); + int32_t res = CreateEccPubKey(curveId, newPubKey, returnPubKey); if (res != HCF_SUCCESS) { - EC_POINT_free(point); + EC_POINT_free(newPubKey); return res; } return HCF_SUCCESS; @@ -384,14 +398,29 @@ static HcfResult ConvertEcPubKeyByOpenssl(int32_t curveId, HcfBlob *pubKeyBlob, static HcfResult ConvertEcPriKeyByOpenssl(int32_t curveId, HcfBlob *priKeyBlob, HcfOpensslEccPriKey **returnPriKey) { - BIGNUM *bn = BN_bin2bn(priKeyBlob->data, priKeyBlob->len, NULL); - if (bn == NULL) { + const unsigned char *tmpData = (const unsigned char *)(priKeyBlob->data); + EC_KEY *ecKey = d2i_ECPrivateKey(NULL, &tmpData, priKeyBlob->len); + if (ecKey == NULL) { + LOGE("d2i_ECPrivateKey fail"); HcfPrintOpensslError(); return HCF_ERR_CRYPTO_OPERATION; } - int32_t res = CreateEccPriKey(curveId, bn, returnPriKey); + const BIGNUM *priKey = EC_KEY_get0_private_key(ecKey); + if (priKey == NULL) { + LOGE("ec key is invalid."); + HcfPrintOpensslError(); + EC_KEY_free(ecKey); + return HCF_ERR_CRYPTO_OPERATION; + } + BIGNUM *newPriKey = BN_dup(priKey); + EC_KEY_free(ecKey); + if (newPriKey == NULL) { + LOGE("copy priKey fail."); + return HCF_ERR_CRYPTO_OPERATION; + } + int32_t res = CreateEccPriKey(curveId, newPriKey, returnPriKey); if (res != HCF_SUCCESS) { - BN_clear_free(bn); + BN_clear_free(newPriKey); return res; } return HCF_SUCCESS; diff --git a/test/fuzztest/key/asykeygenerator_fuzzer/asykeygenerator_fuzzer.cpp b/test/fuzztest/key/asykeygenerator_fuzzer/asykeygenerator_fuzzer.cpp index 4ef3098da45ca5551ce7dd93ffd27da8745f6643..105c1af72cc3f3ea0257418a5fb15bcd5c5ccb47 100755 --- a/test/fuzztest/key/asykeygenerator_fuzzer/asykeygenerator_fuzzer.cpp +++ b/test/fuzztest/key/asykeygenerator_fuzzer/asykeygenerator_fuzzer.cpp @@ -25,14 +25,16 @@ namespace OHOS { static bool g_testFlag = true; - static const int ECC224_PUB_KEY_LEN = 57; - static const int ECC224_PRI_KEY_LEN = 28; - static uint8_t g_mockEcc224PubKeyBlobData[ECC224_PUB_KEY_LEN] = { 4, 189, 186, 122, 21, 9, 8, 231, 90, 111, 68, - 222, 207, 200, 53, 114, 236, 246, 204, 9, 171, 197, 57, 173, 138, 38, 180, 217, 55, 234, 181, 87, 143, 199, - 250, 222, 101, 120, 193, 184, 132, 9, 139, 177, 112, 246, 97, 25, 57, 43, 252, 212, 33, 181, 114, 89, 151 }; + static const int ECC224_PUB_KEY_LEN = 80; + static const int ECC224_PRI_KEY_LEN = 44; + static uint8_t MOCK_ECC224_PUBKEY_BLOB_DATA[ECC224_PUB_KEY_LEN] = { 48, 78, 48, 16, 6, 7, 42, 134, 72, 206, + 61, 2, 1, 6, 5, 43, 129, 4, 0, 33, 3, 58, 0, 4, 252, 171, 11, 115, 79, 252, 109, 120, 46, 97, 131, 145, 207, + 141, 146, 235, 133, 37, 218, 180, 8, 149, 47, 244, 137, 238, 207, 95, 153, 65, 250, 32, 77, 184, 249, 181, + 172, 192, 2, 99, 194, 170, 25, 44, 255, 87, 246, 42, 133, 83, 66, 197, 97, 95, 12, 84 }; - static uint8_t g_mockEcc224PriKeyBlobData[ECC224_PRI_KEY_LEN] = { 7, 13, 160, 20, 7, 190, 2, 157, 233, - 245, 164, 249, 218, 30, 241, 3, 198, 136, 155, 15, 168, 198, 237, 117, 95, 45, 142, 183 }; + static uint8_t MOCK_ECC224_PRIKEY_BLOB_DATA[ECC224_PRI_KEY_LEN] = { 48, 42, 2, 1, 1, 4, 28, 250, 86, 6, + 147, 222, 43, 252, 139, 90, 139, 5, 33, 184, 230, 26, 68, 94, 57, 145, 229, 146, 49, 221, 119, 206, 32, 198, + 19, 160, 7, 6, 5, 43, 129, 4, 0, 33 }; static void TestEccKey(void) { @@ -50,12 +52,12 @@ namespace OHOS { } HcfKeyPair *convertKeyPair = nullptr; static HcfBlob mockEcc224PubKeyBlob = { - .data = g_mockEcc224PubKeyBlobData, + .data = MOCK_ECC224_PUBKEY_BLOB_DATA, .len = ECC224_PUB_KEY_LEN }; static HcfBlob mockEcc224PriKeyBlob = { - .data = g_mockEcc224PriKeyBlobData, + .data = MOCK_ECC224_PRIKEY_BLOB_DATA, .len = ECC224_PRI_KEY_LEN }; (void)generator->convertKey(generator, nullptr, &mockEcc224PubKeyBlob, &mockEcc224PriKeyBlob, &convertKeyPair); diff --git a/test/unittest/src/crypto_ecc_asy_key_generator_test.cpp b/test/unittest/src/crypto_ecc_asy_key_generator_test.cpp index 5e8c0951f349d61be9d4886b95ce1b2bb1100e0e..699d5f7362a7ba7c96bb2d7c5cde5c8b0354c590 100644 --- a/test/unittest/src/crypto_ecc_asy_key_generator_test.cpp +++ b/test/unittest/src/crypto_ecc_asy_key_generator_test.cpp @@ -36,49 +36,58 @@ void CryptoEccAsyKeyGeneratorTest::TearDownTestCase() {} void CryptoEccAsyKeyGeneratorTest::SetUp() {} void CryptoEccAsyKeyGeneratorTest::TearDown() {} -const int ECC224_PUB_KEY_LEN = 57; -const int ECC224_PRI_KEY_LEN = 28; -const int ECC256_PUB_KEY_LEN = 65; -const int ECC256_PRI_KEY_LEN = 32; -const int ECC384_PUB_KEY_LEN = 97; -const int ECC384_PRI_KEY_LEN = 48; -const int ECC512_PUB_KEY_LEN = 133; -const int ECC512_PRI_KEY_LEN = 65; - -static uint8_t mockEcc224PubKeyBlobData[ECC224_PUB_KEY_LEN] = { 4, 189, 186, 122, 21, 9, 8, 231, 90, 111, 68, 222, - 207, 200, 53, 114, 236, 246, 204, 9, 171, 197, 57, 173, 138, 38, 180, 217, 55, 234, 181, 87, 143, 199, 250, 222, - 101, 120, 193, 184, 132, 9, 139, 177, 112, 246, 97, 25, 57, 43, 252, 212, 33, 181, 114, 89, 151 }; - -static uint8_t mockEcc224PriKeyBlobData[ECC224_PRI_KEY_LEN] = { 7, 13, 160, 20, 7, 190, 2, 157, 233, 245, 164, 249, - 218, 30, 241, 3, 198, 136, 155, 15, 168, 198, 237, 117, 95, 45, 142, 183 }; - -static uint8_t mockEcc256PubKeyBlobData[ECC256_PUB_KEY_LEN] = { 4, 15, 195, 182, 51, 78, 219, 41, 100, 231, 64, 119, - 34, 191, 238, 62, 169, 229, 240, 57, 216, 20, 229, 93, 193, 136, 238, 194, 150, 78, 205, 62, 218, 201, 77, 194, - 46, 121, 234, 126, 85, 134, 229, 244, 227, 184, 42, 22, 171, 179, 236, 16, 12, 93, 138, 175, 255, 99, 212, 107, - 83, 128, 49, 194, 215 }; - -static uint8_t mockEcc256PriKeyBlobData[ECC256_PRI_KEY_LEN] = { 218, 130, 176, 177, 252, 163, 236, 3, 204, 22, 211, - 213, 239, 252, 14, 231, 185, 139, 221, 45, 196, 13, 237, 179, 129, 165, 72, 224, 230, 210, 207, 232 }; -static uint8_t mockEcc384PubKeyBlobData[ECC384_PUB_KEY_LEN] = { 4, 246, 111, 226, 33, 39, 150, 111, 50, 96, 228, - 225, 189, 33, 213, 169, 139, 181, 46, 51, 160, 254, 184, 75, 115, 153, 153, 105, 177, 50, 211, 101, 71, 53, - 5, 138, 56, 125, 137, 4, 206, 152, 206, 221, 212, 162, 242, 135, 202, 205, 119, 79, 45, 191, 111, 84, 172, - 34, 159, 112, 149, 197, 102, 56, 235, 212, 171, 234, 162, 11, 188, 146, 137, 203, 180, 46, 241, 44, 235, - 25, 111, 12, 115, 140, 220, 41, 192, 166, 124, 205, 173, 142, 107, 4, 105, 54, 148 }; - -static uint8_t mockEcc384PriKeyBlobData[ECC384_PRI_KEY_LEN] = { 121, 40, 96, 196, 198, 46, 100, 70, 102, 98, 63, 143, - 8, 224, 229, 57, 236, 161, 224, 204, 85, 49, 99, 205, 104, 90, 98, 9, 79, 171, 189, 5, 194, 117, 225, 203, 127, - 17, 214, 77, 6, 99, 162, 9, 191, 192, 76, 174 }; -static uint8_t mockEcc512PubKeyBlobData[ECC512_PUB_KEY_LEN] = { 4, 1, 79, 67, 218, 31, 215, 194, 89, 74, 246, 88, - 151, 232, 47, 159, 60, 56, 23, 159, 12, 123, 12, 239, 81, 75, 92, 15, 118, 101, 27, 69, 147, 76, 151, 91, 59, - 212, 77, 176, 198, 132, 151, 225, 113, 116, 164, 254, 206, 148, 203, 95, 3, 137, 148, 180, 184, 173, 206, 16, - 12, 170, 57, 228, 25, 233, 159, 0, 107, 24, 217, 155, 26, 85, 40, 148, 116, 97, 134, 150, 73, 127, 247, 184, - 132, 188, 2, 165, 236, 146, 150, 103, 213, 206, 185, 124, 13, 166, 213, 238, 39, 18, 10, 164, 226, 139, 86, - 159, 25, 88, 154, 155, 75, 248, 46, 200, 14, 33, 45, 68, 4, 238, 138, 144, 114, 11, 219, 114, 7, 163, 255, 9, 150 }; - -static uint8_t mockEcc512PriKeyBlobData[ECC512_PRI_KEY_LEN] = { 128, 210, 9, 28, 225, 87, 232, 88, 102, 55, 78, 216, - 162, 210, 219, 218, 26, 33, 206, 253, 165, 172, 111, 60, 157, 206, 77, 145, 123, 95, 92, 21, 254, 159, 145, 104, - 194, 49, 0, 108, 38, 40, 204, 1, 231, 162, 34, 64, 118, 191, 163, 143, 33, 44, 55, 231, 54, 64, 210, 54, 201, - 117, 251, 157, 109 }; +const int ECC224_PUB_KEY_LEN = 80; +const int ECC224_PRI_KEY_LEN = 44; +const int ECC256_PUB_KEY_LEN = 91; +const int ECC256_PRI_KEY_LEN = 51; +const int ECC384_PUB_KEY_LEN = 120; +const int ECC384_PRI_KEY_LEN = 64; +const int ECC512_PUB_KEY_LEN = 158; +const int ECC512_PRI_KEY_LEN = 82; + +static uint8_t mockEcc224PubKeyBlobData[ECC224_PUB_KEY_LEN] = { 48, 78, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, 1, + 6, 5, 43, 129, 4, 0, 33, 3, 58, 0, 4, 252, 171, 11, 115, 79, 252, 109, 120, 46, 97, 131, 145, 207, 141, 146, + 235, 133, 37, 218, 180, 8, 149, 47, 244, 137, 238, 207, 95, 153, 65, 250, 32, 77, 184, 249, 181, 172, 192, 2, + 99, 194, 170, 25, 44, 255, 87, 246, 42, 133, 83, 66, 197, 97, 95, 12, 84 }; + +static uint8_t mockEcc224PriKeyBlobData[ECC224_PRI_KEY_LEN] = { 48, 42, 2, 1, 1, 4, 28, 250, 86, 6, 147, 222, 43, + 252, 139, 90, 139, 5, 33, 184, 230, 26, 68, 94, 57, 145, 229, 146, 49, 221, 119, 206, 32, 198, 19, 160, 7, 6, + 5, 43, 129, 4, 0, 33 }; + +static uint8_t mockEcc256PubKeyBlobData[ECC256_PUB_KEY_LEN] = { 48, 89, 48, 19, 6, 7, 42, 134, 72, 206, 61, 2, 1, + 6, 8, 42, 134, 72, 206, 61, 3, 1, 7, 3, 66, 0, 4, 65, 43, 59, 227, 32, 51, 44, 104, 47, 135, 97, 144, 91, 70, + 231, 67, 2, 214, 197, 176, 161, 160, 227, 133, 158, 30, 118, 217, 243, 155, 88, 55, 214, 86, 86, 122, 166, 64, + 111, 2, 226, 93, 163, 194, 210, 74, 18, 63, 173, 113, 249, 196, 126, 165, 222, 230, 190, 101, 241, 95, 102, 174, + 252, 38 }; + +static uint8_t mockEcc256PriKeyBlobData[ECC256_PRI_KEY_LEN] = { 48, 49, 2, 1, 1, 4, 32, 223, 134, 255, 219, 45, + 68, 72, 231, 43, 72, 243, 113, 255, 60, 232, 203, 151, 65, 80, 6, 36, 112, 247, 186, 106, 148, 43, 170, 204, + 23, 189, 191, 160, 10, 6, 8, 42, 134, 72, 206, 61, 3, 1, 7 }; + +static uint8_t mockEcc384PubKeyBlobData[ECC384_PUB_KEY_LEN] = { 48, 118, 48, 16, 6, 7, 42, 134, 72, 206, 61, 2, + 1, 6, 5, 43, 129, 4, 0, 34, 3, 98, 0, 4, 149, 237, 84, 7, 62, 114, 48, 106, 64, 227, 243, 253, 90, 170, 184, + 80, 174, 159, 72, 117, 16, 24, 213, 146, 184, 159, 33, 209, 36, 143, 227, 11, 113, 228, 128, 13, 181, 195, 235, + 12, 255, 85, 187, 197, 109, 82, 242, 226, 186, 53, 128, 9, 133, 4, 170, 96, 150, 94, 197, 196, 107, 120, 55, + 159, 181, 208, 249, 176, 108, 6, 166, 253, 221, 156, 139, 140, 124, 240, 11, 194, 154, 139, 62, 218, 170, 61, + 12, 147, 7, 146, 243, 158, 103, 195, 123, 156 }; + +static uint8_t mockEcc384PriKeyBlobData[ECC384_PRI_KEY_LEN] = { 48, 62, 2, 1, 1, 4, 48, 137, 184, 12, 183, 201, + 211, 124, 203, 165, 9, 229, 68, 46, 17, 14, 14, 109, 195, 0, 206, 248, 21, 53, 72, 66, 3, 244, 165, 248, + 217, 176, 121, 155, 225, 222, 134, 155, 241, 59, 16, 253, 237, 158, 11, 221, 252, 58, 251, 160, 7, 6, 5, + 43, 129, 4, 0, 34 }; + +static uint8_t mockEcc512PubKeyBlobData[ECC512_PUB_KEY_LEN] = { 48, 129, 155, 48, 16, 6, 7, 42, 134, 72, 206, + 61, 2, 1, 6, 5, 43, 129, 4, 0, 35, 3, 129, 134, 0, 4, 0, 149, 60, 46, 252, 220, 227, 253, 219, 250, 60, 232, + 80, 190, 119, 38, 79, 202, 173, 35, 126, 228, 244, 207, 174, 191, 250, 147, 188, 22, 132, 125, 44, 26, 57, 242, + 203, 192, 100, 65, 185, 250, 80, 246, 76, 37, 242, 78, 64, 152, 47, 172, 165, 229, 99, 247, 61, 91, 152, 144, + 67, 34, 38, 130, 198, 22, 0, 179, 69, 69, 147, 72, 154, 76, 134, 28, 158, 33, 251, 94, 63, 77, 44, 100, 132, + 207, 159, 210, 113, 194, 174, 170, 194, 129, 215, 209, 50, 217, 204, 48, 53, 92, 231, 57, 179, 170, 6, 26, 77, + 187, 181, 35, 254, 17, 216, 205, 118, 104, 89, 155, 145, 28, 61, 169, 113, 195, 55, 13, 125, 6, 168, 156 }; + +static uint8_t mockEcc512PriKeyBlobData[ECC512_PRI_KEY_LEN] = { 48, 80, 2, 1, 1, 4, 66, 0, 210, 135, 140, 70, + 98, 28, 121, 169, 5, 202, 132, 165, 11, 56, 9, 110, 32, 9, 146, 185, 239, 69, 113, 79, 213, 24, 165, 194, 147, + 209, 223, 187, 100, 6, 149, 4, 56, 235, 120, 152, 146, 252, 92, 21, 222, 3, 182, 68, 39, 222, 49, 192, 154, 126, + 126, 243, 18, 99, 136, 199, 234, 134, 232, 13, 128, 160, 7, 6, 5, 43, 129, 4, 0, 35 }; static HcfBlob mockEcc224PubKeyBlob = { .data = mockEcc224PubKeyBlobData,