Home
last modified time | relevance | path

Searched refs:xSize (Results 1 – 24 of 24) sorted by relevance

/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/
Dhks_mbedtls_ecc.c78 if ((keyMaterial->xSize > maxKeyByteLen) || in EccKeyMaterialXyzSizeCheck()
81 … "zSize = 0x%" LOG_PUBLIC "X", keyMaterial->xSize, keyMaterial->ySize, keyMaterial->zSize); in EccKeyMaterialXyzSizeCheck()
97 …if (key->size < (sizeof(struct KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize + keyMate… in EccKeyCheck()
121 … ret = mbedtls_mpi_read_binary(&(pub->MBEDTLS_PRIVATE(X)), key->data + offset, keyMaterial->xSize); in HksEccKeyMaterialToPub()
127 offset = offset + keyMaterial->xSize; in HksEccKeyMaterialToPub()
148 uint32_t offset = sizeof(*keyMaterial) + keyMaterial->xSize + keyMaterial->ySize; in HksEccKeyMaterialToPri()
174 keyMaterial->xSize = keyByteLen; in EccSaveKeyMaterial()
182 keyMaterial->xSize); in EccSaveKeyMaterial()
188 offset = offset + keyMaterial->xSize; in EccSaveKeyMaterial()
256 if ((keyMaterial->xSize == 0) || (keyMaterial->ySize == 0)) { in GetEccPubKeyCheckParams()
[all …]
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
Dopenssl_ecc_helper.c57 if (BN_bn2binpad(pubX, rawMaterial + offset, keyMaterial->xSize) <= 0) { in TransEccKeyToKeyBlob()
60 offset += keyMaterial->xSize; in TransEccKeyToKeyBlob()
83 keyMaterial->xSize = HKS_KEY_BYTES(keyLen); in EccSaveKeyMaterial()
163 *publicXSize = keyMaterial->xSize; in GetEccModules()
170 static int32_t EccInitPublicKey(EC_KEY *eccKey, const uint8_t *keyPair, uint32_t xSize, uint32_t yS… in EccInitPublicKey() argument
180 BIGNUM *pubX = BN_bin2bn(keyPair + offset, xSize, NULL); in EccInitPublicKey()
181 offset += xSize; in EccInitPublicKey()
434 output->size = sizeof(struct KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize; in GetEccPubKey()
439 publickeyMaterial->xSize = keyMaterial->xSize; in GetEccPubKey()
446 keyMaterial->xSize + keyMaterial->ySize) != 0) { in GetEccPubKey()
[all …]
Dopenssl_dsa_helper.c89 x = BinToBN(key->data + offset, keyMaterial->xSize); in InitDsa()
90 offset += keyMaterial->xSize; in InitDsa()
290 keyMaterial->xSize = 0; in X509ToDsaPublicKey()
297 uint32_t offset = sizeof(struct KeyMaterialDsa) + keyMaterial->xSize; in X509ToDsaPublicKey()
357 …keyMaterial->xSize = (keyByteLen > OPENSSL_DSA_KEY_LEN_DIVID) ? HKS_DIGEST_SHA256_LEN : HKS_DIGEST… in SaveDsaKeyToHksBlob()
374 if (BN_bn2bin(x, key->data + offset + (keyMaterial->xSize - (uint32_t)BN_num_bytes(x))) <= 0) { in SaveDsaKeyToHksBlob()
377 offset += keyMaterial->xSize; in SaveDsaKeyToHksBlob()
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/
Dhks_openssl_ecc.c86 retCode = BN_bn2binpad(pubX, rawMaterial + offset, keyMaterial->xSize); in TransEccKeyToKeyBlob()
91 offset += keyMaterial->xSize; in TransEccKeyToKeyBlob()
127 keyMaterial->xSize = HKS_KEY_BYTES(keySize); in EccSaveKeyMaterial()
210 if ((keyMaterial->xSize == 0) || (keyMaterial->ySize == 0)) { in HksOpensslGetEccPubKey()
215 output->size = sizeof(struct KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize; in HksOpensslGetEccPubKey()
220 publickeyMaterial->xSize = keyMaterial->xSize; in HksOpensslGetEccPubKey()
225 input->data + sizeof(struct KeyMaterialEcc), keyMaterial->xSize + keyMaterial->ySize); in HksOpensslGetEccPubKey()
236 *publicXSize = keyMaterial->xSize; in GetEccModules()
243 static int32_t EccInitPublicKey(EC_KEY *eccKey, const uint8_t *keyPair, uint32_t xSize, uint32_t yS… in EccInitPublicKey() argument
254 BIGNUM *pubX = BN_bin2bn(keyPair + offset, xSize, NULL); in EccInitPublicKey()
[all …]
Dhks_openssl_dsa.c58 if (keyMaterial->xSize == 0) { in InitDsaStructKey()
62 …cpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->xSize) != EOK) { in InitDsaStructKey()
66 x = BN_bin2bn(buff, keyMaterial->xSize, NULL); in InitDsaStructKey()
69 *offset += keyMaterial->xSize; in InitDsaStructKey()
192 &keyMaterial->xSize, in DsaKeyMaterialParam()
211 ret = BN_bn2bin(x, rawMaterial + offset + (keyMaterial->xSize - (uint32_t)BN_num_bytes(x))); in DsaKeyMaterialData()
216 offset += keyMaterial->xSize; in DsaKeyMaterialData()
317 publickeyMaterial->xSize = 0; in HksOpensslGetDsaPubKey()
323 if (memcpy_s(output->data + sizeof(struct KeyMaterialDsa) + publickeyMaterial->xSize, in HksOpensslGetDsaPubKey()
324 output->size - (sizeof(struct KeyMaterialDsa) + publickeyMaterial->xSize), in HksOpensslGetDsaPubKey()
[all …]
Dhks_openssl_sm2.c84 keyMaterial->xSize = pubXBlob.size; in EvpPkeyToKeyMaterialEc()
155 "u", keyMaterial->keySize, keyMaterial->xSize, keyMaterial->ySize, keyMaterial->zSize); in GetSm2Modules()
159 (keyMaterial->xSize > HKS_KEY_BYTES(keyMaterial->keySize)) || in GetSm2Modules()
162 … (sizeof(struct KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize + keyMaterial->zSize != in GetSm2Modules()
184 …Ret = memcpy_s(uncompressedPublicKey + 1 + HKS_KEY_BYTES(size->keySize) - size->xSize, size->xSize, in PushPubKeyToParam()
185 keyPair + sizeof(struct KeyMaterialEcc), size->xSize); in PushPubKeyToParam()
191 keyPair + sizeof(struct KeyMaterialEcc) + size->xSize, size->ySize); in PushPubKeyToParam()
226 if (size->xSize != 0 && size->ySize != 0) { in ConstructSm2ParamsFromRawKey()
241 priBn = BN_bin2bn(keyPair + sizeof(struct KeyMaterialEcc) + size->xSize + size->ySize, in ConstructSm2ParamsFromRawKey()
/base/security/huks/test/unittest/huks_standard_test/module_test/framework_test/common_test/src/
Dhks_check_paramset_test.cpp321 .xSize = HKS_ECC_KEY_SIZE_521,
340 materialEcc.xSize = HKS_ECC_KEY_SIZE_521 + 1;
344 materialEcc.xSize = HKS_ECC_KEY_SIZE_521;
355 materialEcc.xSize = 0;
359 materialEcc.xSize = HKS_ECC_KEY_SIZE_521;
380 .xSize = MAX_KEY_SIZE + 1,
403 materialDsa.xSize = MAX_KEY_SIZE;
435 .xSize = MAX_KEY_SIZE,
450 materialDsa.xSize = 0;
454 materialDsa.xSize = MAX_KEY_SIZE;
/base/security/huks/utils/crypto_adapter/
Dhks_client_service_adapter_lite.c346 static int32_t CheckEccXySize(const uint32_t xSize, const uint32_t ySize) in CheckEccXySize() argument
349 if ((xSize > maxKeyByteLen) || (ySize > maxKeyByteLen)) { in CheckEccXySize()
350 …nvalid ecc public key size! xSize = 0x%" LOG_PUBLIC "X, ySize = 0x%" LOG_PUBLIC "X", xSize, ySize); in CheckEccXySize()
360 uint32_t xSize = mbedtls_mpi_size(&(pubKey->MBEDTLS_PRIVATE(grp).P)); in X509PublicKeyToEcc() local
363 int32_t ret = CheckEccXySize(xSize, ySize); in X509PublicKeyToEcc()
366 uint32_t totalSize = sizeof(struct HksPubKeyInfo) + xSize + ySize; in X509PublicKeyToEcc()
380 pubKeyInfo->nOrXSize = xSize; in X509PublicKeyToEcc()
385 keyBuffer + sizeof(struct HksPubKeyInfo), xSize); in X509PublicKeyToEcc()
393 keyBuffer + sizeof(struct HksPubKeyInfo) + xSize, ySize); in X509PublicKeyToEcc()
Dhks_client_service_adapter.c216 …uint32_t keyMaterialSize = sizeof(struct KeyMaterialDsa) + keyMaterial->xSize + keyMaterial->ySize… in GetDsaPubKeyParam()
222 uint32_t offset = sizeof(struct KeyMaterialDsa) + keyMaterial->xSize; in GetDsaPubKeyParam()
509 uint32_t xSize = HKS_KEY_BYTES(keyLen); in EcKeyToPublicKey() local
517 uint32_t totalSize = xSize + ySize + sizeof(struct HksPubKeyInfo); in EcKeyToPublicKey()
524 pubKeyInfo->nOrXSize = xSize; in EcKeyToPublicKey()
527 if (BN_bn2binpad(x, keyBuffer + sizeof(struct HksPubKeyInfo), xSize) == 0 || in EcKeyToPublicKey()
528 BN_bn2binpad(y, keyBuffer + sizeof(struct HksPubKeyInfo) + xSize, ySize) == 0) { in EcKeyToPublicKey()
672 keyMaterial->xSize = 0; in X509PublicKeyToDsa()
678 if ((BN_bn2bin(y, keyBuffer + sizeof(struct KeyMaterialDsa) + keyMaterial->xSize) == 0) || in X509PublicKeyToDsa()
679 … (BN_bn2bin(p, keyBuffer + sizeof(struct KeyMaterialDsa) + keyMaterial->xSize + ySize) == 0) || in X509PublicKeyToDsa()
[all …]
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
Dhks_import_sign_verify_test.cpp404 material.xSize = sizeof(g_xData); in ConstructImportedDsaPriOrPairKey()
410 uint32_t size = sizeof(material) + material.xSize + material.ySize + in ConstructImportedDsaPriOrPairKey()
430 offset += material.xSize; in ConstructImportedDsaPriOrPairKey()
479 material.xSize = 0; in ConstructEcPrivateKey()
483 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEcPrivateKey()
539 material.xSize = xDataBlob->size; in ConstructEcKey()
543 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEcKey()
562 offset += material.xSize; in ConstructEcKey()
585 const uint32_t xSize; member
603 material.xSize = isPriKey ? 0 : sm2Key->xSize; in ConstructImportedSm2Key()
[all …]
Dhks_import_agree_test.cpp707 material.xSize = isPriKey ? 0 : key->publicOrXData.size; in ConstructEccKey()
711 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEccKey()
731 offset += material.xSize; in ConstructEccKey()
Dhks_access_control_test_common.cpp797 material.xSize = params->xData->size; in ConstructDsaKeyPair()
803 uint32_t size = sizeof(material) + material.xSize + material.ySize + in ConstructDsaKeyPair()
823 offset += material.xSize; in ConstructDsaKeyPair()
Dhks_import_wrapped_sm2_suite_test.cpp719 material.xSize = isPriKey ? 0 : keyTest->publicOrXData.size; in ConstructEccKey()
723 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEccKey()
744 offset += material.xSize; in ConstructEccKey()
/base/security/huks/services/huks_standard/huks_engine/main/core_dependency/src/
Dhks_chipset_platform_key_hardcoded.c48 .xSize = PLATFORM_KEY_PLATFORM_PRI_KEY_SIZE, in MallocAndFillFullHksPublicKey()
81 .xSize = PLATFORM_KEY_PLATFORM_PRI_KEY_SIZE, in MallocFullPlatformPrivateKey()
/base/security/huks/interfaces/kits/c/include/
Dnative_huks_type.h842 uint32_t xSize; member
861 uint32_t xSize; member
/base/security/huks/frameworks/huks_standard/main/common/include/
Dhks_crypto_hal.h88 uint32_t xSize; member
96 uint32_t xSize; member
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/
Dcert_manager_app_cert_process.c66 retCode = BN_bn2binpad(pubX, rawMaterial->data + offset, keyMaterial->xSize); in TransEccKeyToKeyBlob()
71 offset += keyMaterial->xSize; in TransEccKeyToKeyBlob()
117 keyMaterial->xSize = CM_KEY_BYTES(keySize); in SaveKeyMaterialEcc()
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/
Dhks_crypto_hal_ecc_key.cpp193 uint32_t keyOutLen = sizeof(KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize;
Dhks_crypto_hal_api_mbedtls.cpp401 uint32_t keyOutLen = sizeof(KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize;
/base/security/huks/frameworks/huks_standard/main/common/src/
Dhks_check_paramset.c531 … if ((keyMaterial->xSize > HKS_ECC_KEY_SIZE_521) || (keyMaterial->ySize > HKS_ECC_KEY_SIZE_521) || in CheckEccKeyLen()
541 …if ((keyType == HKS_KEY_TYPE_KEY_PAIR) && ((keyMaterial->xSize == 0) || (keyMaterial->ySize == 0))… in CheckEccKeyLen()
546 …uint32_t keySize = sizeof(struct HksKeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize + ke… in CheckEccKeyLen()
569 if ((keyMaterial->xSize > MAX_KEY_SIZE) || (keyMaterial->ySize > MAX_KEY_SIZE) || in CheckDsaKeyLen()
576 if ((keyMaterial->xSize == 0) || in CheckDsaKeyLen()
587 uint32_t keySize = sizeof(struct HksKeyMaterialDsa) + keyMaterial->xSize + keyMaterial->ySize + in CheckDsaKeyLen()
Dhks_crypto_adapter.c501 uint32_t outOffset = sizeof(struct KeyMaterialDsa) + keyMaterial->xSize; in FormatDsaKey()
503 ((struct KeyMaterialDsa *)publicKey)->xSize = 0; in FormatDsaKey()
520 … uint32_t publicKeySize = sizeof(struct KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize; in FormatEccKey()
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/
Dhks_native_api_compatibility_test.cpp876 ASSERT_EQ(sizeof(keyMaterialEcc.xSize) == sizeof(uint32_t), true);
882 ASSERT_EQ(sizeof(hksKeyMaterialEcc.xSize) == sizeof(uint32_t), true);
898 ASSERT_EQ(sizeof(keyMaterialDsa.xSize) == sizeof(uint32_t), true);
906 ASSERT_EQ(sizeof(hksKeyMaterialDsa.xSize) == sizeof(uint32_t), true);
/base/security/huks/interfaces/inner_api/huks_standard/main/include/
Dhks_type.h752 uint32_t xSize; member
763 uint32_t xSize; member
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_inner_test.cpp404 keyMaterial->xSize = 1;