/base/security/huks/utils/crypto_adapter/ |
H A D | hks_client_service_adapter_common.c | 33 int32_t CopyToInnerKey(const struct HksBlob *key, struct HksBlob *outKey)
in CopyToInnerKey() argument 44 outKey->data = outData;
in CopyToInnerKey() 45 outKey->size = key->size;
in CopyToInnerKey() 78 struct HksParam *algParam, const struct HksBlob *key, struct HksBlob *outKey)
in HksSymmetricKeySizeCheck() 107 return CopyToInnerKey(key, outKey);
in HksSymmetricKeySizeCheck() 112 const struct HksBlob *key, struct HksBlob *outKey)
in GetHksPubKeyInnerFormat() 114 if ((CheckBlob(key) != HKS_SUCCESS) || (outKey == NULL)) {
in GetHksPubKeyInnerFormat() 115 HKS_LOG_E("invalid key or outKey");
in GetHksPubKeyInnerFormat() 129 return HksSymmetricKeySizeCheck(algParam, key, outKey);
in GetHksPubKeyInnerFormat() 133 return CopyToInnerKey(key, outKey);
in GetHksPubKeyInnerFormat() 77 HksSymmetricKeySizeCheck( struct HksParam *algParam, const struct HksBlob *key, struct HksBlob *outKey) HksSymmetricKeySizeCheck() argument 111 GetHksPubKeyInnerFormat(const struct HksParamSet *paramSet, const struct HksBlob *key, struct HksBlob *outKey) GetHksPubKeyInnerFormat() argument [all...] |
H A D | hks_client_service_adapter_common.h | 27 int32_t CopyToInnerKey(const struct HksBlob *key, struct HksBlob *outKey);
29 int32_t GetHksPubKeyInnerFormat(const struct HksParamSet *paramSet, const struct HksBlob *key, struct HksBlob *outKey);
|
/base/security/huks/frameworks/huks_standard/main/crypto_engine/mbedtls/src/ |
H A D | hks_mbedtls_hmac.c | 52 uint8_t *outKey = (uint8_t *)HksMalloc(keyByteLen);
in HksMbedtlsHmacGenerateKey() local 53 HKS_IF_NULL_RETURN(outKey, HKS_ERROR_MALLOC_FAIL)
in HksMbedtlsHmacGenerateKey() 61 HKS_FREE(outKey);
in HksMbedtlsHmacGenerateKey() 66 ret = mbedtls_ctr_drbg_random(&ctrDrbg, outKey, keyByteLen);
in HksMbedtlsHmacGenerateKey() 72 (void)memset_s(outKey, keyByteLen, 0, keyByteLen);
in HksMbedtlsHmacGenerateKey() 73 HKS_FREE(outKey);
in HksMbedtlsHmacGenerateKey() 77 key->data = outKey;
in HksMbedtlsHmacGenerateKey()
|
H A D | hks_mbedtls_3des.c | 67 uint8_t *outKey = (uint8_t *)HksMalloc(keyByteLen); in HksMbedtls3DesGenerateKey() local 68 HKS_IF_NULL_RETURN(outKey, HKS_ERROR_MALLOC_FAIL) in HksMbedtls3DesGenerateKey() 76 HKS_FREE(outKey); in HksMbedtls3DesGenerateKey() 81 ret = mbedtls_ctr_drbg_random(&ctrDrbg, outKey, keyByteLen); in HksMbedtls3DesGenerateKey() 84 (void)memset_s(outKey, keyByteLen, 0, keyByteLen); in HksMbedtls3DesGenerateKey() 85 HKS_FREE(outKey); in HksMbedtls3DesGenerateKey() 90 key->data = outKey; in HksMbedtls3DesGenerateKey()
|
H A D | hks_mbedtls_des.c | 71 uint8_t *outKey = (uint8_t *)HksMalloc(keyByteLen); in HksMbedtlsDesGenerateKey() local 72 HKS_IF_NULL_RETURN(outKey, HKS_ERROR_MALLOC_FAIL) in HksMbedtlsDesGenerateKey() 80 HKS_FREE(outKey); in HksMbedtlsDesGenerateKey() 85 ret = mbedtls_ctr_drbg_random(&ctrDrbg, outKey, keyByteLen); in HksMbedtlsDesGenerateKey() 88 (void)memset_s(outKey, keyByteLen, 0, keyByteLen); in HksMbedtlsDesGenerateKey() 89 HKS_FREE(outKey); in HksMbedtlsDesGenerateKey() 94 key->data = outKey; in HksMbedtlsDesGenerateKey()
|
H A D | hks_mbedtls_aes.c | 64 uint8_t *outKey = (uint8_t *)HksMalloc(keyByteLen); in HksMbedtlsAesGenerateKey() local 65 HKS_IF_NULL_RETURN(outKey, HKS_ERROR_MALLOC_FAIL) in HksMbedtlsAesGenerateKey() 73 HKS_FREE(outKey); in HksMbedtlsAesGenerateKey() 78 ret = mbedtls_ctr_drbg_random(&ctrDrbg, outKey, keyByteLen); in HksMbedtlsAesGenerateKey() 81 (void)memset_s(outKey, keyByteLen, 0, keyByteLen); in HksMbedtlsAesGenerateKey() 82 HKS_FREE(outKey); in HksMbedtlsAesGenerateKey() 87 key->data = outKey; in HksMbedtlsAesGenerateKey()
|
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/src/ |
H A D | hks_import_sign_verify_test.cpp | 320 static int32_t CopyKey(const uint8_t *key, uint32_t size, struct HksBlob *outKey) in CopyKey() argument 328 outKey->data = outData; in CopyKey() 329 outKey->size = size; in CopyKey() 334 static int32_t CopyToInner(uint32_t alg, uint32_t importType, struct HksBlob *outKey) in CopyToInner() argument 345 return CopyKey(dataBlob.data, dataBlob.size, outKey); in CopyToInner() 349 struct HksBlob *outKey) in ConstructImportedCurve25519Key() 352 return CopyToInner(alg, importType, outKey); in ConstructImportedCurve25519Key() 394 outKey->data = data; in ConstructImportedCurve25519Key() 395 outKey->size = size; in ConstructImportedCurve25519Key() 399 static int32_t ConstructImportedDsaPriOrPairKey(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructImportedDsaPriOrPairKey() argument 348 ConstructImportedCurve25519Key(uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedCurve25519Key() argument 466 ConstructImportedDsaKey(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedDsaKey() argument 475 ConstructEcPrivateKey(const struct HksBlob *zDataBlob, uint32_t keySize, struct HksBlob *outKey) ConstructEcPrivateKey() argument 508 ConstructEccPubKey(uint32_t keySize, struct HksBlob *outKey) ConstructEccPubKey() argument 534 ConstructEcKey(const struct HksBlob *xDataBlob, const struct HksBlob *yDataBlob, const struct HksBlob *zDataBlob, uint32_t keySize, struct HksBlob *outKey) ConstructEcKey() argument 593 ConstructImportedSm2Key(uint32_t keySize, uint32_t importType, struct HksBlob *outKey, Sm2TestKeyData *sm2Key) ConstructImportedSm2Key() argument 648 ConstructImportedSm2KeyForOpenssl1(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedSm2KeyForOpenssl1() argument 663 ConstructImportedSm2KeyForOpenssl3(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedSm2KeyForOpenssl3() argument 678 ConstructImportedEccKey(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedEccKey() argument 732 ConstructImportedKey(uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey, bool sm2CompabilityTest) ConstructImportedKey() argument [all...] |
H A D | hks_import_wrapped_x25519_suite_test.cpp | 278 uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructCurve25519Key() 313 outKey->data = data; in ConstructCurve25519Key() 314 outKey->size = size; in ConstructCurve25519Key() 319 struct HksBlob *outKey) in ConstructImportedCurve25519Key() 328 return ConstructCurve25519Key(&key, alg, keySize, importType, outKey); in ConstructImportedCurve25519Key() 333 uint32_t keySize, struct HksBlob *outKey, bool isPriKey) in ConstructRsaKey() 377 outKey->data = data; in ConstructRsaKey() 378 outKey->size = size; in ConstructRsaKey() 277 ConstructCurve25519Key(struct TestImportKeyData *key, uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructCurve25519Key() argument 318 ConstructImportedCurve25519Key(uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedCurve25519Key() argument 332 ConstructRsaKey(const struct HksBlob *nDataBlob, const struct HksBlob *dDataBlob, uint32_t keySize, struct HksBlob *outKey, bool isPriKey) ConstructRsaKey() argument
|
H A D | hks_import_wrapped_sm2_suite_test.cpp | 696 static int32_t CopyKey(const uint8_t *key, uint32_t size, struct HksBlob *outKey) in CopyKey() argument 704 outKey->data = outData; in CopyKey() 705 outKey->size = size; in CopyKey() 711 uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructEccKey() 714 return CopyKey(keyTest->x509PublicKey.data, keyTest->x509PublicKey.size, outKey); in ConstructEccKey() 763 outKey->data = data; in ConstructEccKey() 764 outKey->size = size; in ConstructEccKey() 769 struct HksBlob *outKey) in ConstructImportedSm2Key() 782 return ConstructEccKey(&key, keySize, importType, outKey); in ConstructImportedSm2Key() 710 ConstructEccKey(struct TestImportKeyData *keyTest, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructEccKey() argument 768 ConstructImportedSm2Key(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedSm2Key() argument
|
H A D | hks_access_control_test_common.cpp | 705 const struct HksBlob *eDataBlob, uint32_t keySize, struct HksBlob *outKey) in ConstructRsaKeyPair() 747 outKey->data = data; in ConstructRsaKeyPair() 748 outKey->size = size; in ConstructRsaKeyPair() 753 struct HksBlob *ed25519PrivData, struct HksBlob *outKey) in ConstructEd25519KeyPair() 788 outKey->data = data; in ConstructEd25519KeyPair() 789 outKey->size = size; in ConstructEd25519KeyPair() 793 int32_t ConstructDsaKeyPair(uint32_t keySize, const struct TestDsaKeyParams *params, struct HksBlob *outKey) in ConstructDsaKeyPair() argument 852 outKey->data = data; in ConstructDsaKeyPair() 853 outKey->size = size; in ConstructDsaKeyPair() 704 ConstructRsaKeyPair(const struct HksBlob *nDataBlob, const struct HksBlob *dDataBlob, const struct HksBlob *eDataBlob, uint32_t keySize, struct HksBlob *outKey) ConstructRsaKeyPair() argument 752 ConstructEd25519KeyPair(uint32_t keySize, uint32_t alg, struct HksBlob *ed25519PubData, struct HksBlob *ed25519PrivData, struct HksBlob *outKey) ConstructEd25519KeyPair() argument
|
H A D | hks_import_wrapped_ecdh_suite_test.cpp | 270 uint32_t keySize, struct HksBlob *outKey, bool isPriKey) in ConstructKey() 314 outKey->data = dataTest; in ConstructKey() 315 outKey->size = size; in ConstructKey() 269 ConstructKey(const struct HksBlob *nDataBlob, const struct HksBlob *dDataBlob, uint32_t keySize, struct HksBlob *outKey, bool isPriKey) ConstructKey() argument
|
H A D | hks_import_agree_test.cpp | 628 static int32_t CopyKey(const uint8_t *key, uint32_t size, struct HksBlob *outKey) in CopyKey() argument 636 outKey->data = outData; in CopyKey() 637 outKey->size = size; in CopyKey() 642 static int32_t CopyToInner(struct TestImportKeyData *key, uint32_t importType, struct HksBlob *outKey) in CopyToInner() argument 645 return CopyKey(key->privateOrYData.data, key->privateOrYData.size, outKey); in CopyToInner() 647 return CopyKey(key->publicOrXData.data, key->publicOrXData.size, outKey); in CopyToInner() 652 uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructCurve25519Key() 655 return CopyToInner(key, importType, outKey); in ConstructCurve25519Key() 691 outKey->data = dataTest; in ConstructCurve25519Key() 692 outKey in ConstructCurve25519Key() 651 ConstructCurve25519Key(struct TestImportKeyData *key, uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructCurve25519Key() argument 696 ConstructEccKey(struct TestImportKeyData *key, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructEccKey() argument 752 ConstructDhKey(struct TestImportKeyData *key, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructDhKey() argument 801 ConstructImportedCurve25519Key(uint32_t id, uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedCurve25519Key() argument 821 ConstructImportedEccKey(uint32_t id, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedEccKey() argument 915 ConstructImportedDhKey(uint32_t id, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedDhKey() argument 933 ConstructImportedKey(uint32_t id, uint32_t alg, uint32_t keySize, uint32_t importType, struct HksBlob *outKey) ConstructImportedKey() argument [all...] |
H A D | hks_import_rsa_test.cpp | 330 static int32_t CopyKey(const struct HksBlob *key, struct HksBlob *outKey) in CopyKey() argument 338 outKey->data = outData; in CopyKey() 339 outKey->size = key->size; in CopyKey() 344 static int32_t ConstructPubKey(uint32_t keySize, struct HksBlob *outKey) in ConstructPubKey() argument 375 return CopyKey(&pubDataBlob, outKey); in ConstructPubKey() 379 uint32_t keySize, struct HksBlob *outKey, bool isPriKey) in ConstructKey() 423 outKey->data = data; in ConstructKey() 424 outKey->size = sizeTest; in ConstructKey() 428 static int32_t ConstructImportedKey(uint32_t keySize, uint32_t importType, struct HksBlob *outKey) in ConstructImportedKey() argument 431 return ConstructPubKey(keySize, outKey); in ConstructImportedKey() 378 ConstructKey(const struct HksBlob *nDataBlob, const struct HksBlob *dDataBlob, uint32_t keySize, struct HksBlob *outKey, bool isPriKey) ConstructKey() argument [all...] |
/base/security/huks/test/unittest/huks_standard_test/three_stage_test/include/ |
H A D | hks_access_control_test_common.h | 146 const struct HksBlob *eDataBlob, uint32_t keySize, struct HksBlob *outKey); 149 struct HksBlob *ed25519PrivData, struct HksBlob *outKey); 151 int32_t ConstructDsaKeyPair(uint32_t keySize, const struct TestDsaKeyParams *params, struct HksBlob *outKey);
|
/base/security/huks/services/huks_standard/huks_engine/main/core/src/ |
H A D | hks_core_service_key_generate.c | 655 static int32_t AppendRsaPublicExponent(const struct HksBlob *key, struct HksBlob *outKey) in AppendRsaPublicExponent() argument 682 outKey->data = out; in AppendRsaPublicExponent() 683 outKey->size = size; in AppendRsaPublicExponent() 687 static int32_t GetRsaPrivateOrPairInnerFormat(uint32_t keyType, const struct HksBlob *key, struct HksBlob *outKey) in GetRsaPrivateOrPairInnerFormat() argument 694 return AppendRsaPublicExponent(key, outKey); in GetRsaPrivateOrPairInnerFormat() 697 return CopyToInnerKey(key, outKey); in GetRsaPrivateOrPairInnerFormat() 701 const struct HksBlob *key, struct HksBlob *outKey) in GetCurve25519PrivateOrPairInnerFormat() 704 return CopyToInnerKey(key, outKey); in GetCurve25519PrivateOrPairInnerFormat() 725 outKey->data = buffer; in GetCurve25519PrivateOrPairInnerFormat() 726 outKey in GetCurve25519PrivateOrPairInnerFormat() 700 GetCurve25519PrivateOrPairInnerFormat(uint8_t alg, uint32_t keyType, const struct HksBlob *key, struct HksBlob *outKey) GetCurve25519PrivateOrPairInnerFormat() argument 730 GetPrivateOrPairInnerFormat(uint32_t keyType, const struct HksBlob *key, const struct HksParamSet *paramSet, struct HksBlob *outKey) GetPrivateOrPairInnerFormat() argument [all...] |
/base/security/device_auth/services/legacy/authenticators/src/account_related/auth/iso_auth_task/ |
H A D | iso_auth_task_common.c | 142 static int32_t GenerateAuthTokenForAccessory(const IsoAuthParams *params, Uint8Buff *outKey) in GenerateAuthTokenForAccessory() argument 152 res = InitSingleParam(outKey, AUTH_TOKEN_SIZE_BYTE); in GenerateAuthTokenForAccessory() 162 res = params->isoBaseParams.loader->computeHkdf(&keyAliasParams, &userIdSelfBuff, ¶ms->challenge, outKey); in GenerateAuthTokenForAccessory() 165 FreeAndCleanKey(outKey); in GenerateAuthTokenForAccessory()
|