/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/ |
D | hks_openssl_dh.c | 60 …if (key->size != sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize + keyMaterial->priKeySize)… in InitDhStruct() 75 BIGNUM *pubKey = BN_bin2bn(key->data + offset, keyMaterial->pubKeySize, NULL); in InitDhStruct() 76 offset += keyMaterial->pubKeySize; in InitDhStruct() 104 keyMaterial->pubKeySize = (uint32_t)BN_num_bytes(pubKey); in DhSaveKeyMaterial() 110 offset += keyMaterial->pubKeySize; in DhSaveKeyMaterial() 149 if (input->size < sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) { in HksOpensslGetDhPubKey() 152 if (output->size < sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) { in HksOpensslGetDhPubKey() 156 …s(output->data, output->size, input->data, sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize); in HksOpensslGetDhPubKey() 159 output->size = sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize; in HksOpensslGetDhPubKey() 175 …BIGNUM *pub = BN_bin2bn(pubKey->data + sizeof(struct KeyMaterialDh), pubKeyMaterial->pubKeySize, N… in HksOpensslDhAgreeKey()
|
D | hks_openssl_curve25519.c | 59 keyMaterial->pubKeySize = pubKeyLen; in SaveCurve25519KeyMaterial() 117 uint32_t offset = sizeof(struct KeyMaterial25519) + km->pubKeySize; in ImportX25519EvpKey() 129 …irs = EVP_PKEY_new_raw_public_key(EVP_PKEY_X25519, NULL, pubKey->data + offset, kmPub->pubKeySize); in ImportX25519EvpKey() 225 uint32_t offset = sizeof(struct KeyMaterial25519) + km->pubKeySize; in HksOpensslEd25519Sign() 273 key->data + sizeof(struct KeyMaterial25519), km->pubKeySize); in HksOpensslEd25519Verify() 310 uint32_t outLen = sizeof(struct KeyMaterial25519) + key->pubKeySize; in HksOpensslGetEd25519PubKey()
|
D | hks_openssl_ed25519tox25519.c | 280 static int32_t FillPubKeyByZero(uint8_t *pubKey, uint32_t *pubKeySize) in FillPubKeyByZero() argument 282 if (*pubKeySize < P_BYTES) { in FillPubKeyByZero() 284 int baseAddr = P_BYTES - *pubKeySize; in FillPubKeyByZero() 285 (void)memcpy_s(tmpKey + baseAddr, P_BYTES - baseAddr, pubKey, *pubKeySize); in FillPubKeyByZero() 287 *pubKeySize = P_BYTES; in FillPubKeyByZero() 346 keyMaterialOut->pubKeySize = CURVE25519_KEY_LEN; in ConvertPubkeyX25519FromED25519() 380 keyMaterialOut->pubKeySize = 0; in ConvertPrivX25519FromED25519()
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/ |
D | openssl_dh_helper.c | 61 keyMaterial->pubKeySize = BN_num_bytes(pubKey); in DhSaveKeyMaterial() 67 offset += keyMaterial->pubKeySize; in DhSaveKeyMaterial() 109 …if (key->size != sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize + keyMaterial->priKeySize)… in InitDhStruct() 125 BIGNUM *pubKey = BN_bin2bn(key->data + offset, keyMaterial->pubKeySize, NULL); in InitDhStruct() 126 offset += keyMaterial->pubKeySize; in InitDhStruct() 158 …BIGNUM *pub = BN_bin2bn(pubKey->data + sizeof(struct KeyMaterialDh), pubKeyMaterial->pubKeySize, N… in DhAgreeKey() 199 if (input->size < sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) { in DhGetDhPubKey() 202 if (output->size < sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) { in DhGetDhPubKey() 206 …output->data, output->size, input->data, sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) != in DhGetDhPubKey() 212 output->size = sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize; in DhGetDhPubKey() [all …]
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
D | hks_mbedtls_dh.c | 82 keyMaterial->pubKeySize = mbedtls_mpi_size(&ctx->GX); in DhSaveKeyMaterial() 88 ret = mbedtls_mpi_write_binary(&(ctx->GX), rawMaterial + offset, keyMaterial->pubKeySize); in DhSaveKeyMaterial() 96 offset = offset + keyMaterial->pubKeySize; in DhSaveKeyMaterial() 165 if (input->size < sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) { in HksMbedtlsGetDhPubKey() 168 if (output->size < sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) { in HksMbedtlsGetDhPubKey() 172 …output->data, output->size, input->data, sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize) != in HksMbedtlsGetDhPubKey() 178 output->size = sizeof(struct KeyMaterialDh) + keyMaterial->pubKeySize; in HksMbedtlsGetDhPubKey() 204 ret = mbedtls_mpi_read_binary(&ctx->GX, key->data + offset, keyMaterial->pubKeySize); in DhKeyMaterialToCtx() 212 offset = offset + keyMaterial->pubKeySize; in DhKeyMaterialToCtx() 254 …tls_dhm_read_public(&ctx, pubKey->data + sizeof(struct KeyMaterialDh), pubKeyMaterial->pubKeySize); in HksMbedtlsDhAgreeKey()
|
D | hks_crypto_ed25519.c | 64 keyMaterial->pubKeySize = pubKey->size; in SaveEd25519KeyMaterial() 131 if (((key->size - totalSize) < km->pubKeySize) || in CheckEd25519Material() 133 (km->pubKeySize > (UINT32_MAX - km->priKeySize)) || in CheckEd25519Material() 134 ((key->size - totalSize) < (km->pubKeySize + km->priKeySize))) { in CheckEd25519Material() 136 "%" LOG_PUBLIC "u", key->size, km->pubKeySize, km->priKeySize); in CheckEd25519Material() 151 if ((km->pubKeySize > (UINT32_MAX - sizeof(struct KeyMaterial25519))) || in GetEd25519PubKeyCheck() 152 (keyOut->size < (sizeof(struct KeyMaterial25519) + km->pubKeySize))) { in GetEd25519PubKeyCheck() 166 uint32_t outLen = sizeof(struct KeyMaterial25519) + key->pubKeySize; in HksGetEd25519PubKey()
|
D | hks_mbedtls_x25519.c | 112 if ((keyMaterial->pubKeySize > HKS_X25519_KEY_BYTES) || in X25519CheckKeyMaterialPubPriSize() 115 keyMaterial->pubKeySize, keyMaterial->priKeySize); in X25519CheckKeyMaterialPubPriSize() 143 if (key->size < (sizeof(struct KeyMaterial25519) + keyMaterial->pubKeySize + in X25519CheckKeySize() 182 keyMaterial->pubKeySize = keyByteLen; in X25519SaveKeyMaterial() 187 …bedtls_mpi_write_binary(&(pub->MBEDTLS_PRIVATE(X)), rawMaterial + offset, keyMaterial->pubKeySize); in X25519SaveKeyMaterial() 195 ret = EndianSwap(rawMaterial + offset, keyMaterial->pubKeySize); in X25519SaveKeyMaterial() 202 offset = offset + keyMaterial->pubKeySize; in X25519SaveKeyMaterial() 266 uint8_t *tmpPubKey = (uint8_t *)HksMalloc(keyMaterial->pubKeySize); in X25519KeyMaterialToPub() 271 …if (memcpy_s(tmpPubKey, keyMaterial->pubKeySize, pubKey->data + offset, keyMaterial->pubKeySize) !… in X25519KeyMaterialToPub() 276 ret = EndianSwap(tmpPubKey, keyMaterial->pubKeySize); in X25519KeyMaterialToPub() [all …]
|
/base/security/huks/frameworks/huks_standard/main/common/src/ |
D | hks_crypto_adapter.c | 291 curve25519Km.pubKeySize = keyIn->size; in SetCurve25519KeyMaterial() 294 curve25519Km.pubKeySize = 0; in SetCurve25519KeyMaterial() 298 …keyOut->size = sizeof(struct KeyMaterial25519) + curve25519Km.pubKeySize + curve25519Km.priKeySize; in SetCurve25519KeyMaterial() 319 …if (keyIn->size < (sizeof(struct KeyMaterial25519) + keyMaterial->pubKeySize + keyMaterial->priKey… in CheckCurve25519KeySize() 334 if (keyMaterial->pubKeySize > MAX_KEY_SIZE || keyMaterial->priKeySize > MAX_KEY_SIZE) { in CheckFormatCurve25519Key() 338 if (paramSetOut->paramSetSize < (offset + keyMaterial->pubKeySize + keyMaterial->priKeySize)) { in CheckFormatCurve25519Key() 355 .blob = { keyMaterial->pubKeySize, keyIn->data + sizeof(struct KeyMaterial25519) }, in FormatCurve25519Key() 360 keyIn->data + sizeof(struct KeyMaterial25519) + keyMaterial->pubKeySize }, in FormatCurve25519Key() 375 uint32_t size = (isPubKey ? km->pubKeySize : km->priKeySize); in GetCurve25519FromKeyMaterial() 378 km->pubKeySize, km->priKeySize); in GetCurve25519FromKeyMaterial() [all …]
|
D | hks_check_paramset.c | 588 if ((keyMaterial->pubKeySize > HKS_CURVE25519_KEY_SIZE_256) || in CheckCurve25519KeyLen() 599 if ((keyType == HKS_KEY_TYPE_KEY_PAIR) && (keyMaterial->pubKeySize == 0)) { in CheckCurve25519KeyLen() 604 …uint32_t keySize = sizeof(struct HksKeyMaterial25519) + keyMaterial->pubKeySize + keyMaterial->pri… in CheckCurve25519KeyLen() 627 …if ((keyMaterial->pubKeySize > HKS_DH_KEY_SIZE_4096) || (keyMaterial->priKeySize > HKS_DH_KEY_SIZE… in CheckDHKeyLen() 637 if ((keyType == HKS_KEY_TYPE_KEY_PAIR) && (keyMaterial->pubKeySize == 0)) { in CheckDHKeyLen() 642 …uint32_t keySize = sizeof(struct HksKeyMaterialDh) + keyMaterial->pubKeySize + keyMaterial->priKey… in CheckDHKeyLen()
|
/base/security/huks/services/huks_standard/huks_engine/main/core/src/ |
D | hks_keyblob_lite.c | 221 keyMaterial->pubKeySize = HKS_KEY_BYTES(HKS_CURVE25519_KEY_SIZE_256); in Ed25519BlobToKeyMaterial() 244 if ((keyMaterial->pubKeySize != HKS_KEY_BYTES(HKS_CURVE25519_KEY_SIZE_256)) || in Ed25519KeyMaterialToBlob() 246 (key->size < (sizeof(*keyMaterial) + keyMaterial->pubKeySize + keyMaterial->priKeySize))) { in Ed25519KeyMaterialToBlob() 248 key->size, keyMaterial->pubKeySize, keyMaterial->priKeySize); in Ed25519KeyMaterialToBlob() 252 int32_t ret = HksBlobInit(adjustedKey, keyMaterial->priKeySize + keyMaterial->pubKeySize); in Ed25519KeyMaterialToBlob() 257 keyMaterial->pubKeySize + keyMaterial->priKeySize) != EOK) { in Ed25519KeyMaterialToBlob()
|
/base/security/huks/interfaces/kits/c/include/ |
D | native_huks_type.h | 830 uint32_t pubKeySize; member 849 uint32_t pubKeySize; member
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
D | hks_import_agree_test.cpp | 721 material.pubKeySize = key->publicOrXData.size; in ConstructCurve25519Key() 725 uint32_t size = sizeof(material) + material.pubKeySize + material.priKeySize; in ConstructCurve25519Key() 743 offset += material.pubKeySize; in ConstructCurve25519Key() 824 material.pubKeySize = isPriKey ? 0 : key->publicOrXData.size; in ConstructDhKey() 828 uint32_t size = sizeof(material) + material.pubKeySize + material.priKeySize; in ConstructDhKey() 847 offset += material.pubKeySize; in ConstructDhKey()
|
D | hks_import_wrapped_x25519_suite_test.cpp | 327 material.pubKeySize = key->publicOrXData.size; in ConstructCurve25519Key() 331 uint32_t size = sizeof(material) + material.pubKeySize + material.priKeySize; in ConstructCurve25519Key() 349 offset += material.pubKeySize; in ConstructCurve25519Key()
|
D | hks_import_sign_verify_test.cpp | 436 material.pubKeySize = pubKeyBlob.size; in ConstructImportedCurve25519Key() 440 uint32_t size = sizeof(material) + material.pubKeySize + material.priKeySize; in ConstructImportedCurve25519Key() 458 offset += material.pubKeySize; in ConstructImportedCurve25519Key()
|
D | hks_access_control_test_common.cpp | 751 material.pubKeySize = ed25519PubData->size; in ConstructEd25519KeyPair() 755 uint32_t size = sizeof(material) + material.pubKeySize + material.priKeySize; in ConstructEd25519KeyPair() 773 offset += material.pubKeySize; in ConstructEd25519KeyPair()
|
/base/security/huks/frameworks/huks_standard/main/common/include/ |
D | hks_crypto_hal.h | 105 uint32_t pubKeySize; member 113 uint32_t pubKeySize; member
|
/base/security/huks/utils/crypto_adapter/ |
D | hks_client_service_adapter.c | 815 uint32_t pubKeySize = (uint32_t)BN_num_bytes(pubKey); in X509PublicKeyToDh() 816 if (pubKeySize > UINT32_MAX - sizeof(struct KeyMaterialDh)) { in X509PublicKeyToDh() 821 uint32_t totalSize = sizeof(struct KeyMaterialDh) + pubKeySize; in X509PublicKeyToDh() 827 keyMaterial->pubKeySize = pubKeySize; in X509PublicKeyToDh()
|
/base/security/huks/interfaces/inner_api/huks_standard/main/include/ |
D | hks_type.h | 732 uint32_t pubKeySize; member 743 uint32_t pubKeySize; member
|
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/ |
D | hks_native_api_compatibility_test.cpp | 943 ASSERT_EQ(sizeof(keyMaterialDh.pubKeySize) == sizeof(uint32_t), true); 949 ASSERT_EQ(sizeof(hksKeyMaterialDh.pubKeySize) == sizeof(uint32_t), true); 965 ASSERT_EQ(sizeof(keyMaterial25519.pubKeySize) == sizeof(uint32_t), true); 971 ASSERT_EQ(sizeof(hksKeyMaterial25519.pubKeySize) == sizeof(uint32_t), true);
|
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/ |
D | cert_manager_app_cert_process.c | 220 keyMaterial->pubKeySize = pubKeyLen; in SaveKeyMaterialCurve25519()
|
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/ |
D | hks_crypto_hal_api_mbedtls.cpp | 468 uint32_t keyOutLen = sizeof(KeyMaterialDh) + keyMaterial->pubKeySize;
|