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.cpp323 .xSize = HKS_ECC_KEY_SIZE_521,
342 materialEcc.xSize = HKS_ECC_KEY_SIZE_521 + 1;
346 materialEcc.xSize = HKS_ECC_KEY_SIZE_521;
357 materialEcc.xSize = 0;
361 materialEcc.xSize = HKS_ECC_KEY_SIZE_521;
382 .xSize = MAX_KEY_SIZE + 1,
405 materialDsa.xSize = MAX_KEY_SIZE;
437 .xSize = MAX_KEY_SIZE,
452 materialDsa.xSize = 0;
456 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.c327 …uint32_t keyMaterialSize = sizeof(struct KeyMaterialDsa) + keyMaterial->xSize + keyMaterial->ySize… in GetDsaPubKeyParam()
333 uint32_t offset = sizeof(struct KeyMaterialDsa) + keyMaterial->xSize; in GetDsaPubKeyParam()
620 uint32_t xSize = HKS_KEY_BYTES(keyLen); in EcKeyToPublicKey() local
628 uint32_t totalSize = xSize + ySize + sizeof(struct HksPubKeyInfo); in EcKeyToPublicKey()
635 pubKeyInfo->nOrXSize = xSize; in EcKeyToPublicKey()
638 if (BN_bn2binpad(x, keyBuffer + sizeof(struct HksPubKeyInfo), xSize) == 0 || in EcKeyToPublicKey()
639 BN_bn2binpad(y, keyBuffer + sizeof(struct HksPubKeyInfo) + xSize, ySize) == 0) { in EcKeyToPublicKey()
783 keyMaterial->xSize = 0; in X509PublicKeyToDsa()
789 if ((BN_bn2bin(y, keyBuffer + sizeof(struct KeyMaterialDsa) + keyMaterial->xSize) == 0) || in X509PublicKeyToDsa()
790 … (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.cpp477 material.xSize = sizeof(g_xData); in ConstructImportedDsaPriOrPairKey()
483 uint32_t size = sizeof(material) + material.xSize + material.ySize + in ConstructImportedDsaPriOrPairKey()
503 offset += material.xSize; in ConstructImportedDsaPriOrPairKey()
552 material.xSize = 0; in ConstructEcPrivateKey()
556 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEcPrivateKey()
612 material.xSize = xDataBlob->size; in ConstructEcKey()
616 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEcKey()
635 offset += material.xSize; in ConstructEcKey()
658 const uint32_t xSize; member
676 material.xSize = isPriKey ? 0 : sm2Key->xSize; in ConstructImportedSm2Key()
[all …]
Dhks_import_agree_test.cpp768 material.xSize = isPriKey ? 0 : key->publicOrXData.size; in ConstructEccKey()
772 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEccKey()
792 offset += material.xSize; in ConstructEccKey()
Dhks_access_control_test_common.cpp791 material.xSize = params->xData->size; in ConstructDsaKeyPair()
797 uint32_t size = sizeof(material) + material.xSize + material.ySize + in ConstructDsaKeyPair()
817 offset += material.xSize; in ConstructDsaKeyPair()
Dhks_import_wrapped_sm2_suite_test.cpp725 material.xSize = isPriKey ? 0 : key->publicOrXData.size; in ConstructEccKey()
729 uint32_t size = sizeof(material) + material.xSize + material.ySize + material.zSize; in ConstructEccKey()
749 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.h788 uint32_t xSize; member
807 uint32_t xSize; member
/base/security/huks/frameworks/huks_standard/main/common/include/
Dhks_crypto_hal.h87 uint32_t xSize; member
95 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.cpp195 uint32_t keyOutLen = sizeof(KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize;
Dhks_crypto_hal_api_mbedtls.cpp403 uint32_t keyOutLen = sizeof(KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize;
/base/security/huks/frameworks/huks_standard/main/common/src/
Dhks_check_paramset.c508 … if ((keyMaterial->xSize > HKS_ECC_KEY_SIZE_521) || (keyMaterial->ySize > HKS_ECC_KEY_SIZE_521) || in CheckEccKeyLen()
518 …if ((keyType == HKS_KEY_TYPE_KEY_PAIR) && ((keyMaterial->xSize == 0) || (keyMaterial->ySize == 0))… in CheckEccKeyLen()
523 …uint32_t keySize = sizeof(struct HksKeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize + ke… in CheckEccKeyLen()
546 if ((keyMaterial->xSize > MAX_KEY_SIZE) || (keyMaterial->ySize > MAX_KEY_SIZE) || in CheckDsaKeyLen()
553 if ((keyMaterial->xSize == 0) || in CheckDsaKeyLen()
564 uint32_t keySize = sizeof(struct HksKeyMaterialDsa) + keyMaterial->xSize + keyMaterial->ySize + in CheckDsaKeyLen()
Dhks_crypto_adapter.c453 uint32_t outOffset = sizeof(struct KeyMaterialDsa) + keyMaterial->xSize; in FormatDsaKey()
455 ((struct KeyMaterialDsa *)publicKey)->xSize = 0; in FormatDsaKey()
472 … uint32_t publicKeySize = sizeof(struct KeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize; in FormatEccKey()
/base/security/huks/interfaces/inner_api/huks_standard/main/include/
Dhks_type.h708 uint32_t xSize; member
719 uint32_t xSize; member
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/
Dhks_native_api_compatibility_test.cpp895 ASSERT_EQ(sizeof(keyMaterialEcc.xSize) == sizeof(uint32_t), true);
901 ASSERT_EQ(sizeof(hksKeyMaterialEcc.xSize) == sizeof(uint32_t), true);
917 ASSERT_EQ(sizeof(keyMaterialDsa.xSize) == sizeof(uint32_t), true);
925 ASSERT_EQ(sizeof(hksKeyMaterialDsa.xSize) == sizeof(uint32_t), true);
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/
Dhks_inner_test.cpp404 keyMaterial->xSize = 1;