Home
last modified time | relevance | path

Searched refs:pubKeySize (Results 1 – 21 of 21) sorted by relevance

/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/
Dhks_openssl_dh.c60 …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()
Dhks_openssl_curve25519.c59 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()
Dhks_openssl_ed25519tox25519.c280 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/
Dopenssl_dh_helper.c61 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/
Dhks_mbedtls_dh.c82 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()
Dhks_crypto_ed25519.c64 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()
Dhks_mbedtls_x25519.c112 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/
Dhks_crypto_adapter.c291 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 …]
Dhks_check_paramset.c588 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/
Dhks_keyblob_lite.c221 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/
Dnative_huks_type.h830 uint32_t pubKeySize; member
849 uint32_t pubKeySize; member
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
Dhks_import_agree_test.cpp721 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()
Dhks_import_wrapped_x25519_suite_test.cpp327 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()
Dhks_import_sign_verify_test.cpp436 material.pubKeySize = pubKeyBlob.size; in ConstructImportedCurve25519Key()
440 uint32_t size = sizeof(material) + material.pubKeySize + material.priKeySize; in ConstructImportedCurve25519Key()
458 offset += material.pubKeySize; in ConstructImportedCurve25519Key()
Dhks_access_control_test_common.cpp751 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/
Dhks_crypto_hal.h105 uint32_t pubKeySize; member
113 uint32_t pubKeySize; member
/base/security/huks/utils/crypto_adapter/
Dhks_client_service_adapter.c815 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/
Dhks_type.h732 uint32_t pubKeySize; member
743 uint32_t pubKeySize; member
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/
Dhks_native_api_compatibility_test.cpp943 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/
Dcert_manager_app_cert_process.c220 keyMaterial->pubKeySize = pubKeyLen; in SaveKeyMaterialCurve25519()
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/
Dhks_crypto_hal_api_mbedtls.cpp468 uint32_t keyOutLen = sizeof(KeyMaterialDh) + keyMaterial->pubKeySize;