/base/security/huks/test/unittest/huks_standard_test/crypto_engine_test/src/ |
D | hks_crypto_hal_rsa_oaep_encrypt.cpp | 36 HksKeySize keySize = HksKeySize::HKS_RSA_KEY_SIZE_512; member 56 .keySize = HKS_RSA_KEY_SIZE_512, 78 .keySize = HKS_RSA_KEY_SIZE_768, 102 .keySize = HKS_RSA_KEY_SIZE_1024, 133 .keySize = HKS_RSA_KEY_SIZE_2048, 171 .keySize = HKS_RSA_KEY_SIZE_3072, 216 .keySize = HKS_RSA_KEY_SIZE_4096, 236 .keySize = HKS_RSA_KEY_SIZE_512, 258 .keySize = HKS_RSA_KEY_SIZE_768, 282 .keySize = HKS_RSA_KEY_SIZE_1024, [all …]
|
D | hks_crypto_hal_rsa_encrypt.cpp | 35 HksKeySize keySize = HksKeySize::HKS_RSA_KEY_SIZE_512; member 56 .keySize = HKS_RSA_KEY_SIZE_512, 84 .keySize = HKS_RSA_KEY_SIZE_768, 114 .keySize = HKS_RSA_KEY_SIZE_1024, 154 .keySize = HKS_RSA_KEY_SIZE_2048, 203 .keySize = HKS_RSA_KEY_SIZE_3072, 262 .keySize = HKS_RSA_KEY_SIZE_4096, 287 .keySize = HKS_RSA_KEY_SIZE_512, 309 .keySize = HKS_RSA_KEY_SIZE_768, 333 .keySize = HKS_RSA_KEY_SIZE_1024, [all …]
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
D | hks_import_agree_test.cpp | 665 static void ModifyImportParams(uint32_t alg, uint32_t keySize, uint32_t importType) in ModifyImportParams() argument 668 g_importKeyParams[TAG_KEY_SIZE_ID].uint32Param = keySize; in ModifyImportParams() 672 static void ModifyinitOpParams(uint32_t alg, uint32_t keySize) in ModifyinitOpParams() argument 675 g_initOpParams[TAG_KEY_SIZE_ID].uint32Param = keySize; in ModifyinitOpParams() 702 uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructCurve25519Key() argument 710 material.keySize = keySize; in ConstructCurve25519Key() 747 uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructEccKey() argument 757 material.keySize = keySize; in ConstructEccKey() 803 uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructDhKey() argument 813 material.keySize = keySize; in ConstructDhKey() [all …]
|
D | hks_import_key_test.cpp | 52 uint32_t keySize = 0; member 66 .keySize = HKS_AES_KEY_SIZE_128 / HKS_BITS_PER_BYTE, 80 .keySize = HKS_AES_KEY_SIZE_192 / HKS_BITS_PER_BYTE, 94 .keySize = HKS_AES_KEY_SIZE_256 / HKS_BITS_PER_BYTE, 108 .keySize = HKS_AES_KEY_SIZE_256 / HKS_BITS_PER_BYTE, 122 .keySize = HKS_AES_KEY_SIZE_256 / HKS_BITS_PER_BYTE, 136 .keySize = HKS_AES_KEY_SIZE_256 / HKS_BITS_PER_BYTE, 149 .keySize = HKS_AES_KEY_SIZE_256 / HKS_BITS_PER_BYTE, 162 .keySize = HKS_AES_KEY_SIZE_256 / HKS_BITS_PER_BYTE, 175 .keySize = HKS_AES_KEY_SIZE_256 / HKS_BITS_PER_BYTE, [all …]
|
D | hks_import_sign_verify_test.cpp | 387 static int32_t ConstructImportedCurve25519Key(uint32_t alg, uint32_t keySize, uint32_t importType, in ConstructImportedCurve25519Key() argument 402 material.keySize = keySize; in ConstructImportedCurve25519Key() 438 static int32_t ConstructImportedDsaPriOrPairKey(uint32_t keySize, uint32_t importType, struct HksBl… in ConstructImportedDsaPriOrPairKey() argument 443 material.keySize = keySize; in ConstructImportedDsaPriOrPairKey() 505 static int32_t ConstructImportedDsaKey(uint32_t keySize, uint32_t importType, struct HksBlob *outKe… in ConstructImportedDsaKey() argument 510 return ConstructImportedDsaPriOrPairKey(keySize, importType, outKey); in ConstructImportedDsaKey() 514 static int32_t ConstructEcPrivateKey(const struct HksBlob *zDataBlob, uint32_t keySize, struct HksB… in ConstructEcPrivateKey() argument 518 material.keySize = keySize; in ConstructEcPrivateKey() 547 static int32_t ConstructEccPubKey(uint32_t keySize, struct HksBlob *outKey) in ConstructEccPubKey() argument 550 switch (keySize) { in ConstructEccPubKey() [all …]
|
D | hks_import_rsa_test.cpp | 447 static int32_t ConstructPubKey(uint32_t keySize, struct HksBlob *outKey) in ConstructPubKey() argument 450 switch (keySize) { in ConstructPubKey() 482 uint32_t keySize, struct HksBlob *outKey, bool isPriKey) in ConstructKey() argument 486 material.keySize = keySize; in ConstructKey() 531 static int32_t ConstructImportedKey(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructImportedKey() argument 534 return ConstructPubKey(keySize, outKey); in ConstructImportedKey() 541 switch (keySize) { in ConstructImportedKey() 582 return ConstructKey(&nDataBlob, &dDataBlob, keySize, outKey, isPriKey); in ConstructImportedKey() 585 static void ModifyImportParams(uint32_t purpose, uint32_t keySize, uint32_t padding, in ModifyImportParams() argument 589 g_importRsaKeyParams[TAG_KEY_SIZE_ID].uint32Param = keySize; in ModifyImportParams() [all …]
|
/base/security/certificate_manager/services/cert_manager_standard/cert_manager_engine/main/core/src/ |
D | cert_manager_app_cert_process.c | 98 static int32_t SaveKeyMaterialEcc(const EC_KEY *eccKey, const uint32_t keySize, struct CmBlob *keyO… in SaveKeyMaterialEcc() argument 102 rawMaterial.size = sizeof(struct HksKeyMaterialEcc) + CM_KEY_BYTES(keySize) * ECC_KEYPAIR_CNT; in SaveKeyMaterialEcc() 116 keyMaterial->keySize = keySize; in SaveKeyMaterialEcc() 117 keyMaterial->xSize = CM_KEY_BYTES(keySize); in SaveKeyMaterialEcc() 118 keyMaterial->ySize = CM_KEY_BYTES(keySize); in SaveKeyMaterialEcc() 119 keyMaterial->zSize = CM_KEY_BYTES(keySize); in SaveKeyMaterialEcc() 134 static int32_t SaveKeyMaterialRsa(const RSA *rsa, const uint32_t keySize, struct CmBlob *keyOut) in SaveKeyMaterialRsa() argument 136 const uint32_t keyByteLen = keySize / CM_BITS_PER_BYTE; in SaveKeyMaterialRsa() 146 keyMaterial->keySize = keySize; in SaveKeyMaterialRsa() 219 keyMaterial->keySize = HKS_CURVE25519_KEY_SIZE_256; in SaveKeyMaterialCurve25519() [all …]
|
/base/security/huks/services/huks_standard/huks_engine/main/core/src/ |
D | hks_keyblob.c | 46 uint32_t keySize; member 162 uint32_t keySize; in BuildKeyBlobUsageSpec() local 163 … (void)memcpy_s(&keySize, sizeof(keySize), &(keyBlobInfo->keySize), sizeof(keyBlobInfo->keySize)); in BuildKeyBlobUsageSpec() 165 aeadParam->payloadLen = keySize; in BuildKeyBlobUsageSpec() 199 uint32_t keySize; in EncryptAndDecryptKeyBlob() local 200 (void)memcpy_s(&keySize, sizeof(keySize), &(keyBlobInfo->keySize), sizeof(keySize)); in EncryptAndDecryptKeyBlob() 201 if ((keyParam->blob.size - sizeof(*keyBlobInfo)) != keySize) { in EncryptAndDecryptKeyBlob() 203 keySize, keyParam->blob.size); in EncryptAndDecryptKeyBlob() 209 struct HksBlob srcKey = { keySize, keyParam->blob.data + sizeof(*keyBlobInfo) }; in EncryptAndDecryptKeyBlob() 269 keyBlobInfo->keySize = key->size; in InitKeyBlobInfo() [all …]
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/src/ |
D | hks_openssl_dsa.c | 53 uint8_t *buff = (uint8_t *)HksMalloc(HKS_KEY_BYTES(keyMaterial->keySize)); in InitDsaStructKey() 62 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->xSize) !… in InitDsaStructKey() 70 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->ySize) !… in InitDsaStructKey() 85 … (void)memset_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), 0, HKS_KEY_BYTES(keyMaterial->keySize)); in InitDsaStructKey() 94 uint8_t *buff = HksMalloc(HKS_KEY_BYTES(keyMaterial->keySize)); in InitDsaStructParameter() 97 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->pSize) !… in InitDsaStructParameter() 103 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->qSize) !… in InitDsaStructParameter() 110 …if (memcpy_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), key->data + *offset, keyMaterial->gSize) !… in InitDsaStructParameter() 111 … (void)memset_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), 0, HKS_KEY_BYTES(keyMaterial->keySize)); in InitDsaStructParameter() 128 … (void)memset_s(buff, HKS_KEY_BYTES(keyMaterial->keySize), 0, HKS_KEY_BYTES(keyMaterial->keySize)); in InitDsaStructParameter() [all …]
|
D | hks_openssl_sm4.c | 56 static const EVP_CIPHER *GetSm4CbcCipherType(uint32_t keySize) in GetSm4CbcCipherType() argument 58 switch (keySize) { in GetSm4CbcCipherType() 66 static const EVP_CIPHER *GetSm4CtrCipherType(uint32_t keySize) in GetSm4CtrCipherType() argument 68 switch (keySize) { in GetSm4CtrCipherType() 76 static const EVP_CIPHER *GetSm4EcbCipherType(uint32_t keySize) in GetSm4EcbCipherType() argument 78 switch (keySize) { in GetSm4EcbCipherType() 86 static const EVP_CIPHER *GetSm4CipherType(uint32_t keySize, uint32_t mode) in GetSm4CipherType() argument 88 …return GetBlockCipherType(keySize, mode, GetSm4CbcCipherType, GetSm4CtrCipherType, GetSm4EcbCipher… in GetSm4CipherType()
|
D | hks_openssl_ecc.c | 112 uint32_t keySize = spec->keyLen; in EccSaveKeyMaterial() local 114 …uint32_t rawMaterialLen = sizeof(struct KeyMaterialEcc) + HKS_KEY_BYTES(keySize) * ECC_KEYPAIR_CNT; in EccSaveKeyMaterial() 126 keyMaterial->keySize = keySize; in EccSaveKeyMaterial() 127 keyMaterial->xSize = HKS_KEY_BYTES(keySize); in EccSaveKeyMaterial() 128 keyMaterial->ySize = HKS_KEY_BYTES(keySize); in EccSaveKeyMaterial() 129 keyMaterial->zSize = HKS_KEY_BYTES(keySize); in EccSaveKeyMaterial() 228 publickeyMaterial->keySize = keyMaterial->keySize; in HksOpensslGetEccPubKey() 241 …const uint8_t *key, uint32_t *keySize, uint32_t *publicXSize, uint32_t *publicYSize, uint32_t *pri… in GetEccModules() argument 244 *keySize = keyMaterial->keySize; in GetEccModules() 308 uint32_t keySize; in EccInitKey() local [all …]
|
D | hks_openssl_dh.c | 39 static int32_t HksOpensslGetNid(uint32_t keySize, int *nid) in HksOpensslGetNid() argument 41 switch (keySize) { in HksOpensslGetNid() 52 HKS_LOG_E("invalid key size, keySize = %" LOG_PUBLIC "u", keySize); in HksOpensslGetNid() 65 int32_t ret = HksOpensslGetNid(keyMaterial->keySize, &nid); in InitDhStruct() 89 static int32_t DhSaveKeyMaterial(const DH *dh, const uint32_t keySize, struct HksBlob *key) in DhSaveKeyMaterial() argument 103 keyMaterial->keySize = keySize; in DhSaveKeyMaterial()
|
D | hks_openssl_sm2.c | 55 …const uint8_t *key, uint32_t *keySize, uint32_t *publicXSize, uint32_t *publicYSize, uint32_t *pri… in GetSm2Modules() argument 58 *keySize = keyMaterial->keySize; in GetSm2Modules() 112 uint32_t keySize; in Sm2InitKey() local 114 …HKS_IF_NOT_SUCC_LOGE_RETURN(GetSm2Modules(keyPair, &keySize, &publicXSize, &publicYSize, &privateS… in Sm2InitKey()
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
D | hks_mbedtls_ecc.c | 42 static int32_t HksMbedtlsEccCheckKeySize(const uint32_t keySize) in HksMbedtlsEccCheckKeySize() argument 44 …if ((keySize != HKS_ECC_KEY_SIZE_224) && (keySize != HKS_ECC_KEY_SIZE_256) && (keySize != HKS_ECC_… in HksMbedtlsEccCheckKeySize() 45 (keySize != HKS_ECC_KEY_SIZE_521)) { in HksMbedtlsEccCheckKeySize() 46 HKS_LOG_E("Invalid ecc keySize! keySize = 0x%" LOG_PUBLIC "X", keySize); in HksMbedtlsEccCheckKeySize() 91 int32_t ret = HksMbedtlsEccCheckKeySize(keyMaterial->keySize); in EccKeyCheck() 113 return GetEccGroupId(keyMaterial->keySize, curve); in HksMbedtlsEccGetKeyCurveNist() 161 const uint32_t keySize, struct HksBlob *key) in EccSaveKeyMaterial() argument 164 const uint32_t keyByteLen = HKS_KEY_BYTES(keySize); in EccSaveKeyMaterial() 173 keyMaterial->keySize = keySize; in EccSaveKeyMaterial()
|
D | hks_mbedtls_dh.c | 43 static int32_t GetDhParam(uint32_t keySize, struct HksBlob *P, struct HksBlob *G) in GetDhParam() argument 45 switch (keySize) { in GetDhParam() 71 static int32_t DhSaveKeyMaterial(const mbedtls_dhm_context *ctx, const uint32_t keySize, struct Hks… in DhSaveKeyMaterial() argument 73 const uint32_t keyByteLen = HKS_KEY_BYTES(keySize); in DhSaveKeyMaterial() 81 keyMaterial->keySize = keySize; in DhSaveKeyMaterial() 193 ret = GetDhParam(keyMaterial->keySize, ¶mP, ¶mG); in DhKeyMaterialToCtx() 201 ctx->len = HKS_KEY_BYTES(keyMaterial->keySize); in DhKeyMaterialToCtx()
|
/base/security/huks/frameworks/huks_standard/main/common/src/ |
D | hks_check_paramset.c | 351 if ((keyMaterial->keyAlg != alg) || (keyMaterial->keySize != params->keyLen.value)) { in CheckImportKeySize() 454 if ((keyMaterial->keyAlg != alg) || (keyMaterial->keySize != params->keyLen.value)) { in CheckRsaKeyLen() 466 …uint32_t keySize = sizeof(struct HksKeyMaterialRsa) + keyMaterial->nSize + keyMaterial->dSize + ke… in CheckRsaKeyLen() local 467 if (key->size < keySize) { in CheckRsaKeyLen() 468 …_E("import key size[%" LOG_PUBLIC "u] smaller than keySize[%" LOG_PUBLIC "u]", key->size, keySize); in CheckRsaKeyLen() 484 if ((keyMaterial->keyAlg != alg) || (keyMaterial->keySize != params->keyLen.value)) { in CheckEccKeyLen() 504 …uint32_t keySize = sizeof(struct HksKeyMaterialEcc) + keyMaterial->xSize + keyMaterial->ySize + ke… in CheckEccKeyLen() local 505 if (key->size < keySize) { in CheckEccKeyLen() 506 …_E("import key size[%" LOG_PUBLIC "u] smaller than keySize[%" LOG_PUBLIC "u]", key->size, keySize); in CheckEccKeyLen() 522 if ((keyMaterial->keyAlg != alg) || (keyMaterial->keySize != params->keyLen.value)) { in CheckDsaKeyLen() [all …]
|
D | hks_base_check.c | 700 uint32_t expectCnt, uint32_t *keySize) in CheckAndGetKeySize() argument 719 *keySize = keySizeParam->uint32Param; in CheckAndGetKeySize() 724 uint32_t expectCnt, uint32_t *keySize) in CheckAndGetKeySize() argument 736 *keySize = keyLen; in CheckAndGetKeySize() 981 static int32_t CheckEccSignature(uint32_t cmdId, uint32_t keySize, const struct HksBlob *signature) in CheckEccSignature() argument 988 uint32_t eccSignRSize = keySize / HKS_BITS_PER_BYTE + keySize % HKS_BITS_PER_BYTE; in CheckEccSignature() 994 keySize, signature->size); in CheckEccSignature() 1001 keySize, signature->size); in CheckEccSignature() 1052 static int32_t CheckRsaSignature(uint32_t cmdId, uint32_t keySize, const struct HksBlob *signature) in CheckRsaSignature() argument 1060 if (signature->size < keySize / HKS_BITS_PER_BYTE) { in CheckRsaSignature() [all …]
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/openssl/include/ |
D | hks_openssl_aes.h | 76 const EVP_CIPHER *GetBlockCipherType(uint32_t keySize, uint32_t mode, 77 const EVP_CIPHER *(*getCbcCipherType)(uint32_t keySize), 78 const EVP_CIPHER *(*getCtrCipherType)(uint32_t keySize), 79 const EVP_CIPHER *(*getEcbCipherType)(uint32_t keySize)); 88 const EVP_CIPHER *(*getCipherType)(uint32_t keySize, uint32_t mode));
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/sdk_test/src/ |
D | hks_inner_test.cpp | 149 HksParam keySize; variable 150 keySize.tag = HKS_TAG_KEY_SIZE; 151 keySize.uint32Param = 256; 152 HksAddParams(paramSet, &keySize, 1); 196 HksParam keySize; variable 197 keySize.tag = HKS_TAG_KEY_SIZE; 198 keySize.uint32Param = 256; 199 HksAddParams(paramSet, &keySize, 1); 313 HksParam keySize; variable 314 keySize.tag = HKS_TAG_KEY_SIZE; [all …]
|
/base/security/huks/frameworks/huks_standard/main/core/src/ |
D | hks_local_engine.c | 181 uint32_t keySize = 0; in CheckLocalCipherParams() 183 keySize = key->size * HKS_BITS_PER_BYTE; in CheckLocalCipherParams() 186 keySize = keyMaterial->keySize; in CheckLocalCipherParams() 191 return HksLocalCheckCipherParams(cmdId, keySize, paramSet, inputText, outputText); in CheckLocalCipherParams() 261 uint32_t keySize = 0; in CheckLocalSignVerifyParams() 263 keySize = ((struct KeyMaterialRsa *)key->data)->keySize; in CheckLocalSignVerifyParams() 265 keySize = ((struct KeyMaterialDsa *)key->data)->keySize; in CheckLocalSignVerifyParams() 267 keySize = ((struct KeyMaterialEcc *)key->data)->keySize; in CheckLocalSignVerifyParams() 269 keySize = key->size * HKS_BITS_PER_BYTE; in CheckLocalSignVerifyParams() 272 ret = HksLocalCheckSignVerifyParams(cmdId, keySize, paramSet, srcData, signature); in CheckLocalSignVerifyParams()
|
/base/security/huks/test/unittest/huks_standard_test/interface_inner_test/alg_module_test/include/ |
D | openssl_dsa_helper.h | 31 EVP_PKEY *GenerateDsaKey(const uint32_t keySize); 43 int32_t SaveDsaKeyToHksBlob(EVP_PKEY *pkey, const uint32_t keySize, struct HksBlob *key);
|
/base/security/huks/interfaces/kits/napi/src/ |
D | huks_napi.cpp | 194 napi_value keySize = nullptr; in CreateHuksKeySize() local 195 NAPI_CALL(env, napi_create_object(env, &keySize)); in CreateHuksKeySize() 197 AddInt32Property(env, keySize, "HUKS_RSA_KEY_SIZE_512", HKS_RSA_KEY_SIZE_512); in CreateHuksKeySize() 198 AddInt32Property(env, keySize, "HUKS_RSA_KEY_SIZE_768", HKS_RSA_KEY_SIZE_768); in CreateHuksKeySize() 199 AddInt32Property(env, keySize, "HUKS_RSA_KEY_SIZE_1024", HKS_RSA_KEY_SIZE_1024); in CreateHuksKeySize() 200 AddInt32Property(env, keySize, "HUKS_RSA_KEY_SIZE_2048", HKS_RSA_KEY_SIZE_2048); in CreateHuksKeySize() 201 AddInt32Property(env, keySize, "HUKS_RSA_KEY_SIZE_3072", HKS_RSA_KEY_SIZE_3072); in CreateHuksKeySize() 202 AddInt32Property(env, keySize, "HUKS_RSA_KEY_SIZE_4096", HKS_RSA_KEY_SIZE_4096); in CreateHuksKeySize() 204 AddInt32Property(env, keySize, "HUKS_ECC_KEY_SIZE_224", HKS_ECC_KEY_SIZE_224); in CreateHuksKeySize() 205 AddInt32Property(env, keySize, "HUKS_ECC_KEY_SIZE_256", HKS_ECC_KEY_SIZE_256); in CreateHuksKeySize() [all …]
|
/base/security/huks/interfaces/kits/c/include/ |
D | native_huks_type.h | 724 uint32_t keySize; member 743 uint32_t keySize; member 762 uint32_t keySize; member 781 uint32_t keySize; member 804 uint32_t keySize; member 823 uint32_t keySize; member
|
/base/security/huks/interfaces/innerkits/huks_standard/main/include/ |
D | hks_type.h | 54 #define HKS_KEY_BYTES(keySize) (((keySize) + HKS_BITS_PER_BYTE - 1) / HKS_BITS_PER_BYTE) argument 567 uint32_t keySize; member 575 uint32_t keySize; member 583 uint32_t keySize; member 591 uint32_t keySize; member 601 uint32_t keySize; member 609 uint32_t keySize; member 654 uint16_t keySize; /* keySize of key from crypto hal after encrypted */ member
|
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/aes/src/ |
D | cipher_aes_openssl.c | 209 return CipherEcbType(impl->attr.keySize); in GetCipherType() 211 return CipherCbcType(impl->attr.keySize); in GetCipherType() 213 return CipherCtrType(impl->attr.keySize); in GetCipherType() 215 return CipherOfbType(impl->attr.keySize); in GetCipherType() 217 return CipherCfbType(impl->attr.keySize); in GetCipherType() 219 return CipherCfb1Type(impl->attr.keySize); in GetCipherType() 221 return CipherCfb8Type(impl->attr.keySize); in GetCipherType() 223 return CipherCfb128Type(impl->attr.keySize); in GetCipherType() 225 return CipherCcmType(impl->attr.keySize); in GetCipherType() 227 return CipherGcmType(impl->attr.keySize); in GetCipherType() [all …]
|