Home
last modified time | relevance | path

Searched refs:nSize (Results 1 – 22 of 22) sorted by relevance

/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/
Dhks_openssl_rsa.c74 …if (key->size != sizeof(struct KeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize + keyMate… in RsaCheckKeyMaterial()
83 if (keyMaterial->nSize >= keyMaterial->eSize) { in InitRsaKeyBuf()
84 maxSize = keyMaterial->nSize; in InitRsaKeyBuf()
109 if (memcpy_s(bufBlob.data, bufBlob.size, key->data + offset, keyMaterial->nSize) != EOK) { in InitRsaStruct()
112 BIGNUM *n = BN_bin2bn(bufBlob.data, keyMaterial->nSize, NULL); in InitRsaStruct()
113 offset += keyMaterial->nSize; in InitRsaStruct()
176 keyMaterial->nSize = (uint32_t)BN_bn2bin(RSA_get0_n(rsa), tmp_buff); in RsaSaveKeyMaterial()
177 if (memcpy_s(rawMaterial + offset, keyByteLen, tmp_buff, keyMaterial->nSize) != EOK) { in RsaSaveKeyMaterial()
182 offset += keyMaterial->nSize; in RsaSaveKeyMaterial()
197 …key->size = sizeof(struct KeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize + keyMaterial-… in RsaSaveKeyMaterial()
[all …]
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/
Dhks_mbedtls_rsa.c66 if ((keyMaterial->nSize > maxKeyByteLen) || (keyMaterial->eSize > maxKeyByteLen) || in RsaKeyMaterialNedSizeCheck()
70 keyMaterial->nSize, in RsaKeyMaterialNedSizeCheck()
89 …if (key->size < (sizeof(struct KeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize + keyMate… in RsaKeyCheck()
110 keyMaterial->nSize = keyByteLen; in RsaSaveKeyMaterial()
117 …t = mbedtls_mpi_write_binary(&(ctx->MBEDTLS_PRIVATE(N)), rawMaterial + offset, keyMaterial->nSize); in RsaSaveKeyMaterial()
123 offset = offset + keyMaterial->nSize; in RsaSaveKeyMaterial()
202 ret = mbedtls_mpi_read_binary(&n, key->data + offset, keyMaterial->nSize); in RsaKeyMaterialToCtx()
208 offset = offset + keyMaterial->nSize; in RsaKeyMaterialToCtx()
423 if (keyOut->size < (sizeof(struct HksPubKeyInfo) + keyMaterial->nSize + keyMaterial->eSize)) { in GetRsaPubKeyCheckParams()
438 const uint32_t outLen = sizeof(struct HksPubKeyInfo) + keyMaterial->nSize + keyMaterial->eSize; in HksMbedtlsGetRsaPubKey()
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/src/
Dopenssl_rsa_helper.c36 keyMaterial->nSize = keyByteLen; in SaveRsaKeyToHksBlob()
45 if (memcpy_s(key->data + offset, keyMaterial->nSize, tmpBuff, keyMaterial->nSize) != 0) { in SaveRsaKeyToHksBlob()
50 offset += keyMaterial->nSize; in SaveRsaKeyToHksBlob()
63 …key->size = sizeof(struct KeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize + keyMaterial-… in SaveRsaKeyToHksBlob()
146 uint32_t nSize = (uint32_t)nSizeTemp; in X509ToRsaPublicKey() local
152 pubKeyInfo->nOrXSize = nSize; in X509ToRsaPublicKey()
155 (BN_bn2bin(RSA_get0_e(rsa), publicKey->data + sizeof(struct HksPubKeyInfo) + nSize) == 0)) { in X509ToRsaPublicKey()
176 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + offset, keyMaterial->nSize) ==… in InitRsa()
177 n = BN_bin2bn(buff, keyMaterial->nSize, NULL); in InitRsa()
179 offset += keyMaterial->nSize; in InitRsa()
/base/security/huks/test/unittest/huks_standard_test/module_test/framework_test/common_test/src/
Dhks_check_paramset_test.cpp235 .nSize = HKS_RSA_KEY_SIZE_4096,
252 materialRsa.nSize = HKS_RSA_KEY_SIZE_4096 + 1;
256 materialRsa.nSize = HKS_RSA_KEY_SIZE_4096;
278 .nSize = HKS_RSA_KEY_SIZE_4096,
292 materialRsa.nSize = 0;
296 materialRsa.nSize = HKS_RSA_KEY_SIZE_4096;
/base/security/huks/utils/crypto_adapter/
Dhks_client_service_adapter_lite.c308 uint32_t nSize = rsaCtx->MBEDTLS_PRIVATE(len); in X509PublicKeyToRsa()
311 uint32_t totalSize = sizeof(struct HksPubKeyInfo) + nSize + eSize; in X509PublicKeyToRsa()
319 pubKeyInfo->nOrXSize = nSize; in X509PublicKeyToRsa()
323 …tls_mpi_write_binary(&rsaCtx->MBEDTLS_PRIVATE(N), keyBuffer + sizeof(struct HksPubKeyInfo), nSize); in X509PublicKeyToRsa()
331 keyBuffer + sizeof(struct HksPubKeyInfo) + nSize, eSize); in X509PublicKeyToRsa()
Dhks_client_service_adapter.c568 int nSize = BN_num_bytes(RSA_get0_n(rsa)); in X509PublicKeyToRsa()
570 if (nSize <= 0 || eSize <= 0) { in X509PublicKeyToRsa()
576 uint32_t totalSize = (uint32_t)nSize + (uint32_t)eSize + sizeof(struct HksPubKeyInfo); in X509PublicKeyToRsa()
583 pubKeyInfo->nOrXSize = (uint32_t)nSize; in X509PublicKeyToRsa()
587 … BN_bn2bin(RSA_get0_e(rsa), keyBuffer + sizeof(struct HksPubKeyInfo) + (uint32_t)nSize) == 0) { in X509PublicKeyToRsa()
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/
Dcert_manager_app_cert_process.c152 keyMaterial->nSize = (uint32_t)BN_bn2bin(RSA_get0_n(rsa), tmpBuff); in SaveKeyMaterialRsa()
153 if (memcpy_s(rawMaterial + offset, keyByteLen, tmpBuff, keyMaterial->nSize) != EOK) { in SaveKeyMaterialRsa()
158 offset += keyMaterial->nSize; in SaveKeyMaterialRsa()
173 …keyOut->size = sizeof(struct HksKeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize + keyMat… in SaveKeyMaterialRsa()
/base/security/huks/test/unittest/huks_standard_test/module_test/framework_test/crypto_engine_test/src/
Dhks_openssl_rsa_test.cpp109 .nSize = 20,
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/
Dhks_import_wrapped_ecdh_suite_test.cpp351 material.nSize = nDataBlob->size; in ConstructKey()
355 uint32_t size = sizeof(material) + material.nSize + material.eSize + material.dSize; in ConstructKey()
374 offset += material.nSize; in ConstructKey()
Dhks_import_wrapped_x25519_suite_test.cpp382 material.nSize = nDataBlob->size; in ConstructRsaKey()
386 uint32_t size = sizeof(material) + material.nSize + material.eSize + material.dSize; in ConstructRsaKey()
405 offset += material.nSize; in ConstructRsaKey()
Dhks_import_rsa_test.cpp497 material.nSize = nDataBlob->size; in ConstructKey()
501 uint32_t size = sizeof(material) + material.nSize + material.eSize + material.dSize; in ConstructKey()
520 offset += material.nSize; in ConstructKey()
Dhks_access_control_test_common.cpp703 material.nSize = nDataBlob->size; in ConstructRsaKeyPair()
707 uint32_t size = sizeof(material) + material.nSize + material.eSize + material.dSize; in ConstructRsaKeyPair()
725 offset += material.nSize; in ConstructRsaKeyPair()
/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/
Dhks_crypto_hal_rsa_key.cpp241 uint32_t keyOutLen = sizeof(KeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize;
Dhks_crypto_hal_api_mbedtls.cpp308 keyMaterial->nSize = HKS_KEY_BYTES(HKS_RSA_KEY_SIZE_4096);
348 uint32_t keyOutLen = sizeof(KeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize;
/base/security/huks/interfaces/kits/c/include/
Dnative_huks_type.h769 uint32_t nSize; member
/base/security/huks/frameworks/huks_standard/main/common/include/
Dhks_crypto_hal.h79 uint32_t nSize; member
/base/security/huks/services/huks_standard/huks_engine/main/core/src/
Dhks_core_service.c914 if ((keyMaterial->nSize > HKS_RSA_KEY_SIZE_4096) || (keyMaterial->nSize == 0) || in CheckRsaKeyMaterialLen()
926 …uint32_t keySize = sizeof(struct HksKeyMaterialRsa) + keyMaterial->nSize + keyMaterial->dSize + ke… in CheckRsaKeyMaterialLen()
939 uint32_t size = sizeof(struct HksKeyMaterialRsa) + keyMaterial->nSize + keyMaterial->dSize + in AppendRsaPublicExponent()
953 (void)memcpy_s(out + offset, size - offset, key->data + offset, keyMaterial->nSize); in AppendRsaPublicExponent()
954 offset += keyMaterial->nSize; in AppendRsaPublicExponent()
/base/security/huks/frameworks/huks_standard/main/common/src/
Dhks_check_paramset.c478 if ((keyMaterial->nSize > HKS_RSA_KEY_SIZE_4096) || (keyMaterial->nSize == 0) || in CheckRsaKeyLen()
485 …uint32_t keySize = sizeof(struct HksKeyMaterialRsa) + keyMaterial->nSize + keyMaterial->dSize + ke… in CheckRsaKeyLen()
Dhks_crypto_adapter.c414 … uint32_t publicKeySize = sizeof(struct KeyMaterialRsa) + keyMaterial->nSize + keyMaterial->eSize; in FormatRsaKey()
/base/security/huks/interfaces/inner_api/huks_standard/main/include/
Dhks_type.h697 uint32_t nSize; member
/base/security/huks/test/unittest/huks_standard_test/module_test/interface_test/src/
Dhks_native_api_compatibility_test.cpp873 ASSERT_EQ(sizeof(keyMaterialRsa.nSize) == sizeof(uint32_t), true);
879 ASSERT_EQ(sizeof(hksKeyMaterialRsa.nSize) == sizeof(uint32_t), true);
/base/security/huks/services/huks_standard/huks_engine/main/device_cert_manager/src/
Ddcm_attest.c804 keyMaterial->nSize = obj.value.size; in GetPrivateKeyMaterial()
806 offset += keyMaterial->nSize; in GetPrivateKeyMaterial()