Home
last modified time | relevance | path

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

/base/update/updater/test/unittest/package/
Dpkg_algo_unittest.cpp42 std::unique_ptr<Crc32Algorithm> algo = std::make_unique<Crc32Algorithm>(); in TestCrcDigest() local
43 EXPECT_NE(algo, nullptr); in TestCrcDigest()
44 int ret = algo->Init(); in TestCrcDigest()
48 ret = algo->Update(crcBuffer, sizeof(buff)); in TestCrcDigest()
52 ret = algo->Final(crcResult); in TestCrcDigest()
57 ret = algo->Calculate(crcResult, crcBuffer, sizeof(buff)); in TestCrcDigest()
65 std::unique_ptr<Sha256Algorithm> algo = std::make_unique<Sha256Algorithm>(); in TestHash256Digest() local
66 EXPECT_NE(algo, nullptr); in TestHash256Digest()
67 int ret = algo->Init(); in TestHash256Digest()
71 ret = algo->Update(buffer, sizeof(buff)); in TestHash256Digest()
[all …]
/base/security/crypto_framework/frameworks/key/
Dasy_key_generator.c40 HCF_ALG_VALUE algo; member
53 if (ASY_KEY_GEN_ABILITY_SET[i].algo == params->algo) { in FindAbility()
57 LOGE("Algo not support! [Algo]: %d", params->algo); in FindAbility()
96 params->algo = HCF_ALG_ECC; in SetKeyType()
100 params->algo = HCF_ALG_RSA; in SetKeyType()
104 params->algo = HCF_ALG_RSA; in SetKeyType()
108 params->algo = HCF_ALG_RSA; in SetKeyType()
112 params->algo = HCF_ALG_RSA; in SetKeyType()
116 params->algo = HCF_ALG_RSA; in SetKeyType()
120 params->algo = HCF_ALG_RSA; in SetKeyType()
[all …]
Dsym_key_generator.c40 HCF_ALG_VALUE algo; member
61 if (SYMKEY_ABILITY_SET[i].algo == attr->algo) { in FindAbility()
65 LOGE("Algo not support! [Algo]: %d", attr->algo); in FindAbility()
75 keyAttr->algo = HCF_ALG_AES; in SetKeyLength()
79 keyAttr->algo = HCF_ALG_AES; in SetKeyLength()
83 keyAttr->algo = HCF_ALG_AES; in SetKeyLength()
87 keyAttr->algo = HCF_ALG_DES; in SetKeyLength()
/base/security/device_auth/deps_adapter/key_management_adapter/interfaces/
Dalg_defs.h99 typedef int32_t (*HashToPointFunc)(const Uint8Buff *hash, Algorithm algo, Uint8Buff *outEcPoint);
101 …t (*AgreeSharedSecretWithStorageFunc)(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo,
104 …edef int32_t (*AgreeSharedSecretFunc)(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo,
110 …t32_t (*GenerateKeyPairWithStorageFunc)(const Uint8Buff *keyAlias, uint32_t keyLen, Algorithm algo,
113 typedef int32_t (*GenerateKeyPairFunc)(Algorithm algo, Uint8Buff *outPriKey, Uint8Buff *outPubKey);
117 typedef int32_t (*SignFunc)(const Uint8Buff *keyAlias, const Uint8Buff *message, Algorithm algo,
120 typedef int32_t (*VerifyFunc)(const Uint8Buff *key, const Uint8Buff *message, Algorithm algo,
123 … int32_t (*ImportPublicKeyFunc)(const Uint8Buff *keyAlias, const Uint8Buff *pubKey, Algorithm algo,
126 typedef bool (*CheckEcPublicKeyFunc)(const Uint8Buff *pubKey, Algorithm algo);
/base/security/crypto_framework/common/inc/
Dparams_parser.h104 HCF_ALG_VALUE algo; member
113 HCF_ALG_VALUE algo; // algType member
119 HCF_ALG_VALUE algo; // algType member
127 HCF_ALG_VALUE algo; member
/base/security/crypto_framework/frameworks/crypto_operation/
Dsignature.c49 HCF_ALG_VALUE algo; member
55 HCF_ALG_VALUE algo; member
73 if (SIGN_GEN_ABILITY_SET[i].algo == params->algo) { in FindSignAbility()
77 LOGE("Algo not support! [Algo]: %d", params->algo); in FindSignAbility()
84 if (VERIFY_GEN_ABILITY_SET[i].algo == params->algo) { in FindVerifyAbility()
88 LOGE("Algo not support! [Algo]: %d", params->algo); in FindVerifyAbility()
100 paramsObj->algo = HCF_ALG_ECC; in SetKeyType()
109 paramsObj->algo = HCF_ALG_RSA; in SetKeyType()
Dkey_agreement.c39 HCF_ALG_VALUE algo; member
51 if (KEY_AGREEMENT_GEN_ABILITY_SET[i].algo == params->algo) { in FindAbility()
55 LOGE("Algo not support! [Algo]: %d", params->algo); in FindAbility()
67 paramsObj->algo = HCF_ALG_ECC; in SetKeyType()
Dcipher.c41 HCF_ALG_VALUE algo; member
61 cipherAttr->algo = HCF_ALG_AES; in SetKeyLength()
64 cipherAttr->algo = HCF_ALG_DES; in SetKeyLength()
73 cipherAttr->algo = HCF_ALG_RSA; in SetKeyLength()
225 if (CIPHER_ABILITY_SET[i].algo == attr->algo) { in FindAbility()
229 LOGE("Algo not support! [Algo]: %d", attr->algo); in FindAbility()
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/small/
Dhuks_adapter.c411 static int32_t HashToPoint(const Uint8Buff *hash, Algorithm algo, Uint8Buff *outEcPoint) in HashToPoint() argument
420 if (algo != X25519) { in HashToPoint()
421 LOGE("Invalid algo: %d.", algo); in HashToPoint()
434 …2_t ConstructAgreeWithStorageParams(struct HksParamSet **paramSet, uint32_t keyLen, Algorithm algo, in ConstructAgreeWithStorageParams() argument
457 .uint32Param = g_algToHksAlgorithm[algo] in ConstructAgreeWithStorageParams()
478 … int32_t AgreeSharedSecretWithStorage(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo, in AgreeSharedSecretWithStorage() argument
494 int32_t ret = ConstructAgreeWithStorageParams(&paramSet, sharedKeyLen, algo, priKey, pubKey); in AgreeSharedSecretWithStorage()
510 static int32_t AgreeSharedSecret(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo, Uint… in AgreeSharedSecret() argument
530 .uint32Param = g_algToHksAlgorithm[algo] // only support HKS_ALG_X25519 now in AgreeSharedSecret()
603 …ic int32_t ConstructGenerateKeyPairWithStorageParams(struct HksParamSet **paramSet, Algorithm algo, in ConstructGenerateKeyPairWithStorageParams() argument
[all …]
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/standard/
Dhuks_adapter.c423 static int32_t HashToPoint(const Uint8Buff *hash, Algorithm algo, Uint8Buff *outEcPoint) in HashToPoint() argument
431 if (algo != X25519 && algo != P256) { in HashToPoint()
432 LOGE("Compute algo: %d.", algo); in HashToPoint()
435 if (algo == P256) { in HashToPoint()
555 …2_t ConstructAgreeWithStorageParams(struct HksParamSet **paramSet, uint32_t keyLen, Algorithm algo, in ConstructAgreeWithStorageParams() argument
578 … .uint32Param = g_algToHksAlgorithm[algo] // only support HKS_ALG_ED25519 and HKS_ALG_X25519 in ConstructAgreeWithStorageParams()
598 … int32_t AgreeSharedSecretWithStorage(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo, in AgreeSharedSecretWithStorage() argument
613 if (g_algToHksAlgorithm[algo] == HKS_ALG_ECC) { in AgreeSharedSecretWithStorage()
618 int32_t ret = ConstructAgreeWithStorageParams(&paramSet, sharedKeyLen, algo, priKey, pubKey); in AgreeSharedSecretWithStorage()
634 static int32_t AgreeSharedSecret(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo, Uint… in AgreeSharedSecret() argument
[all …]
/base/security/crypto_framework/test/unittest/src/
Dcrypto_x509_cert_chain_validator_test.cpp168 const char *algo = g_validator->getAlgorithm(g_validator); variable
169 EXPECT_NE(algo, nullptr);
170 if (algo == nullptr) {
175 ASSERT_STREQ(algo, st.c_str());
332 const char *algo = g_validator->getAlgorithm(nullptr); variable
333 EXPECT_EQ(algo, nullptr);
344 const char *algo = g_validator->getAlgorithm(&invalidValidator); variable
345 EXPECT_EQ(algo, nullptr);
/base/security/device_auth/deps_adapter/key_management_adapter/impl/src/mini/
Dhuks_adapter.c685 static int32_t HashToPoint(const Uint8Buff *hash, Algorithm algo, Uint8Buff *outEcPoint) in HashToPoint() argument
688 (void)algo; in HashToPoint()
693 … int32_t AgreeSharedSecretWithStorage(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo, in AgreeSharedSecretWithStorage() argument
698 (void)algo; in AgreeSharedSecretWithStorage()
704 static int32_t AgreeSharedSecret(const KeyBuff *priKey, const KeyBuff *pubKey, Algorithm algo, Uint… in AgreeSharedSecret() argument
708 (void)algo; in AgreeSharedSecret()
713 …atic int32_t GenerateKeyPairWithStorage(const Uint8Buff *keyAlias, uint32_t keyLen, Algorithm algo, in GenerateKeyPairWithStorage() argument
718 (void)algo; in GenerateKeyPairWithStorage()
724 static int32_t GenerateKeyPair(Algorithm algo, Uint8Buff *outPriKey, Uint8Buff *outPubKey) in GenerateKeyPair() argument
726 (void)algo; in GenerateKeyPair()
[all …]
/base/security/crypto_framework/plugin/openssl_plugin/key/sym_key_generator/inc/
Dsym_common_defines.h24 HCF_ALG_VALUE algo; member
/base/security/crypto_framework/frameworks/js/napi/crypto/src/
Dnapi_key.cpp48 const char *algo = key->getAlgorithm(key); in JsGetAlgorithm() local
50 napi_create_string_utf8(env, algo, NAPI_AUTO_LENGTH, &instance); in JsGetAlgorithm()
Dnapi_sym_key_generator.cpp438 const char *algo = generator->getAlgoName(generator); in JsGetAlgorithm() local
440 napi_create_string_utf8(env, algo, NAPI_AUTO_LENGTH, &instance); in JsGetAlgorithm()
Dnapi_cipher.cpp582 const char *algo = cipher->getAlgorithm(cipher); in JsGetAlgorithm() local
584 napi_create_string_utf8(env, algo, NAPI_AUTO_LENGTH, &instance); in JsGetAlgorithm()
/base/security/crypto_framework/frameworks/certificate/
Dcert_chain_validator.c169 const char *algo = (const char *)impl->algorithm; in GetAlgorithm() local
170 return algo; in GetAlgorithm()
/base/startup/hvb/tools/
Dhvbtool.py138 self.algo, self.flags, self.key_offset, self.key_len = struct.unpack('2I2Q', \
167 if self.algo not in self.ALGORITHM_TYPES:
168 raise HvbError("Unknown algorithm type: {}".format(self.algo))
169 msg += "\tAlgorithm: {}\n".format(self.ALGORITHM_TYPES[self.algo])
709 self.algo = _params['algorithm']
890 if self.algo not in self.ALGORITHMS:
891 raise HvbError("Unknown algorithm: {}".format(self.algo))
892 algo = self.ALGORITHMS[self.algo]
906 self.hvb_cert_content += struct.pack('Q', sig_length) + struct.pack('I', algo.sig_algo) \
909 + struct.pack('Q', algo.sig_bytes) + b'\0' * 64 + keyblock
/base/security/crypto_framework/plugin/openssl_plugin/crypto_operation/rsa/src/
Dcipher_rsa_openssl.c283 if (params->algo != HCF_ALG_RSA) { in CheckRsaCipherParams()
284 LOGE("Cipher algo %u is invalid.", params->algo); in CheckRsaCipherParams()
/base/startup/hvb/libhvb/src/cert/
Dhvb_cert.c42 static uint64_t get_hash_size(uint32_t algo) in get_hash_size() argument
44 switch (algo) { in get_hash_size()
/base/security/crypto_framework/plugin/openssl_plugin/key/sym_key_generator/src/
Dsym_key_openssl.c200 HCF_ALG_VALUE type = impl->attr.algo; in GetAlgoName()
/base/update/updater/test/unittest/test_data/applypatch/
DTestDecompressGzip.new.gz