Home
last modified time | relevance | path

Searched refs:alg (Results 1 – 25 of 111) sorted by relevance

12345

/openthread-latest/third_party/mbedtls/repo/include/psa/
Dcrypto_sizes.h60 #define PSA_HASH_LENGTH(alg) \ argument
62 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_MD5 ? 16u : \
63 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_RIPEMD160 ? 20u : \
64 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_1 ? 20u : \
65 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_224 ? 28u : \
66 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_256 ? 32u : \
67 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_384 ? 48u : \
68 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512 ? 64u : \
69 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_224 ? 28u : \
70 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_256 ? 32u : \
[all …]
Dcrypto_values.h797 #define PSA_ALG_IS_VENDOR_DEFINED(alg) \ argument
798 (((alg) & PSA_ALG_VENDOR_FLAG) != 0)
808 #define PSA_ALG_IS_HASH(alg) \ argument
809 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_HASH)
819 #define PSA_ALG_IS_MAC(alg) \ argument
820 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_MAC)
830 #define PSA_ALG_IS_CIPHER(alg) \ argument
831 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_CIPHER)
842 #define PSA_ALG_IS_AEAD(alg) \ argument
843 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_AEAD)
[all …]
Dcrypto.h275 psa_algorithm_t alg);
860 psa_status_t psa_hash_compute(psa_algorithm_t alg,
895 psa_status_t psa_hash_compare(psa_algorithm_t alg,
990 psa_algorithm_t alg);
1212 psa_algorithm_t alg,
1253 psa_algorithm_t alg,
1360 psa_algorithm_t alg);
1422 psa_algorithm_t alg);
1619 psa_algorithm_t alg,
1666 psa_algorithm_t alg,
[all …]
Dcrypto_extra.h388 #define PSA_ALG_IS_DSA(alg) \ argument
389 (((alg) & ~PSA_ALG_HASH_MASK & ~PSA_ALG_DSA_DETERMINISTIC_FLAG) == \
391 #define PSA_ALG_DSA_IS_DETERMINISTIC(alg) \ argument
392 (((alg) & PSA_ALG_DSA_DETERMINISTIC_FLAG) != 0)
393 #define PSA_ALG_IS_DETERMINISTIC_DSA(alg) \ argument
394 (PSA_ALG_IS_DSA(alg) && PSA_ALG_DSA_IS_DETERMINISTIC(alg))
395 #define PSA_ALG_IS_RANDOMIZED_DSA(alg) \ argument
396 (PSA_ALG_IS_DSA(alg) && !PSA_ALG_DSA_IS_DETERMINISTIC(alg))
402 #define PSA_ALG_IS_VENDOR_HASH_AND_SIGN(alg) \ argument
403 PSA_ALG_IS_DSA(alg)
[all …]
/openthread-latest/third_party/mbedtls/repo/tests/suites/
Dtest_suite_psa_crypto_metadata.function74 * PSA_##flag(alg) is true.
83 #define TEST_CLASSIFICATION_MACRO(cond, flag, alg, flags) \
89 TEST_ASSERT(PSA_##flag(alg)); \
91 TEST_ASSERT(!PSA_##flag(alg)); \
119 void algorithm_classification(psa_algorithm_t alg, unsigned flags)
122 TEST_CLASSIFICATION_MACRO(1, ALG_IS_VENDOR_DEFINED, alg, flags);
123 TEST_CLASSIFICATION_MACRO(1, ALG_IS_HMAC, alg, flags);
124 TEST_CLASSIFICATION_MACRO(1, ALG_IS_BLOCK_CIPHER_MAC, alg, flags);
125 TEST_CLASSIFICATION_MACRO(1, ALG_IS_STREAM_CIPHER, alg, flags);
126 TEST_CLASSIFICATION_MACRO(1, ALG_IS_RSA_PKCS1V15_SIGN, alg, flags);
[all …]
Dtest_suite_psa_crypto_op_fail.function48 psa_algorithm_t alg = alg_arg;
57 psa_hash_setup(&operation, alg));
59 psa_hash_compute(alg, input, sizeof(input),
62 psa_hash_compare(alg, input, sizeof(input),
77 psa_algorithm_t alg = alg_arg;
91 psa_set_key_algorithm(&attributes, alg);
97 psa_mac_sign_setup(&operation, key_id, alg));
99 psa_mac_verify_setup(&operation, key_id, alg));
101 psa_mac_compute(key_id, alg,
105 psa_mac_verify(key_id, alg,
[all …]
Dtest_suite_psa_crypto.function181 psa_algorithm_t alg,
189 psa_set_key_algorithm(&attributes, alg);
193 *status = psa_mac_sign_setup(operation, key, alg);
199 TEST_EQUAL(psa_mac_sign_setup(operation, key, alg), *status);
213 psa_algorithm_t alg,
221 psa_set_key_algorithm(&attributes, alg);
225 *status = psa_cipher_encrypt_setup(operation, key, alg);
231 TEST_EQUAL(psa_cipher_encrypt_setup(operation, key, alg),
367 psa_algorithm_t alg = alg_arg;
400 psa_set_key_algorithm(&attributes, alg);
[all …]
/openthread-latest/third_party/mbedtls/repo/library/
Dpsa_crypto_cipher.c30 psa_algorithm_t alg, in mbedtls_cipher_validate_values() argument
51 MBEDTLS_ASSUME(alg != PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CCM, 0)); in mbedtls_cipher_validate_values()
54 MBEDTLS_ASSUME(alg != PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 0)); in mbedtls_cipher_validate_values()
57 MBEDTLS_ASSUME(alg != PSA_ALG_STREAM_CIPHER); in mbedtls_cipher_validate_values()
60 MBEDTLS_ASSUME(alg != PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_CHACHA20_POLY1305, 0)); in mbedtls_cipher_validate_values()
63 MBEDTLS_ASSUME(alg != PSA_ALG_CCM_STAR_NO_TAG); in mbedtls_cipher_validate_values()
66 MBEDTLS_ASSUME(alg != PSA_ALG_CTR); in mbedtls_cipher_validate_values()
69 MBEDTLS_ASSUME(alg != PSA_ALG_CFB); in mbedtls_cipher_validate_values()
72 MBEDTLS_ASSUME(alg != PSA_ALG_OFB); in mbedtls_cipher_validate_values()
75 MBEDTLS_ASSUME(alg != PSA_ALG_XTS); in mbedtls_cipher_validate_values()
[all …]
Dpsa_crypto_mac.c43 hmac->alg = hash_alg; in psa_hmac_setup_internal()
117 psa_algorithm_t hash_alg = hmac->alg; in psa_hmac_finish_internal()
204 psa_algorithm_t alg) in mac_init() argument
208 operation->alg = alg; in mac_init()
211 if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) { in mac_init()
217 if (PSA_ALG_IS_HMAC(operation->alg)) { in mac_init()
219 operation->ctx.hmac.alg = 0; in mac_init()
236 if (operation->alg == 0) { in mbedtls_psa_mac_abort()
243 if (PSA_ALG_FULL_LENGTH_MAC(operation->alg) == PSA_ALG_CMAC) { in mbedtls_psa_mac_abort()
248 if (PSA_ALG_IS_HMAC(operation->alg)) { in mbedtls_psa_mac_abort()
[all …]
Dpsa_crypto_aead.c31 psa_algorithm_t alg) in psa_aead_setup() argument
39 status = mbedtls_cipher_values_from_psa(alg, attributes->type, in psa_aead_setup()
45 switch (PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0)) { in psa_aead_setup()
48 operation->alg = PSA_ALG_CCM; in psa_aead_setup()
68 operation->alg = PSA_ALG_GCM; in psa_aead_setup()
88 operation->alg = PSA_ALG_CHACHA20_POLY1305; in psa_aead_setup()
90 if (alg != PSA_ALG_CHACHA20_POLY1305) { in psa_aead_setup()
112 operation->tag_length = PSA_ALG_AEAD_GET_TAG_LENGTH(alg); in psa_aead_setup()
120 psa_algorithm_t alg, in mbedtls_psa_aead_encrypt() argument
131 key_buffer_size, alg); in mbedtls_psa_aead_encrypt()
[all …]
Dpsa_crypto_driver_wrappers.h115 psa_algorithm_t alg, in psa_driver_wrapper_sign_message() argument
137 alg, in psa_driver_wrapper_sign_message()
158 alg, in psa_driver_wrapper_sign_message()
178 alg, in psa_driver_wrapper_sign_message()
190 psa_algorithm_t alg, in psa_driver_wrapper_verify_message() argument
211 alg, in psa_driver_wrapper_verify_message()
231 alg, in psa_driver_wrapper_verify_message()
250 alg, in psa_driver_wrapper_verify_message()
260 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, in psa_driver_wrapper_sign_hash() argument
278 alg, hash, hash_length, in psa_driver_wrapper_sign_hash()
[all …]
Dpsa_crypto_rsa.c288 static psa_status_t psa_rsa_decode_md_type(psa_algorithm_t alg, in psa_rsa_decode_md_type() argument
292 psa_algorithm_t hash_alg = PSA_ALG_SIGN_GET_HASH(alg); in psa_rsa_decode_md_type()
305 if (alg != PSA_ALG_RSA_PKCS1V15_SIGN_RAW) { in psa_rsa_decode_md_type()
320 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, in mbedtls_psa_rsa_sign_hash() argument
336 status = psa_rsa_decode_md_type(alg, hash_length, &md_alg); in mbedtls_psa_rsa_sign_hash()
347 if (PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg)) { in mbedtls_psa_rsa_sign_hash()
362 if (PSA_ALG_IS_RSA_PSS(alg)) { in mbedtls_psa_rsa_sign_hash()
394 static int rsa_pss_expected_salt_len(psa_algorithm_t alg, in rsa_pss_expected_salt_len() argument
398 if (PSA_ALG_IS_RSA_PSS_ANY_SALT(alg)) { in rsa_pss_expected_salt_len()
419 psa_algorithm_t alg, const uint8_t *hash, size_t hash_length, in mbedtls_psa_rsa_verify_hash() argument
[all …]
Dpsa_crypto.c1011 psa_algorithm_t alg) in psa_key_policy_permits() argument
1014 if (alg == 0) { in psa_key_policy_permits()
1019 if (PSA_ALG_IS_WILDCARD(alg)) { in psa_key_policy_permits()
1023 if (psa_key_algorithm_permits(key_type, policy->alg, alg) || in psa_key_policy_permits()
1024 psa_key_algorithm_permits(key_type, policy->alg2, alg)) { in psa_key_policy_permits()
1055 psa_key_policy_algorithm_intersection(key_type, policy->alg, in psa_restrict_key_policy()
1056 constraint->alg); in psa_restrict_key_policy()
1060 if (intersection_alg == 0 && policy->alg != 0 && constraint->alg != 0) { in psa_restrict_key_policy()
1067 policy->alg = intersection_alg; in psa_restrict_key_policy()
1095 psa_algorithm_t alg) in psa_get_and_lock_key_slot_with_policy() argument
[all …]
Dpsa_crypto_hash.c24 switch (operation->alg) { in mbedtls_psa_hash_abort()
87 operation->alg = 0; in mbedtls_psa_hash_abort()
93 psa_algorithm_t alg) in mbedtls_psa_hash_setup() argument
98 if (operation->alg != 0) { in mbedtls_psa_hash_setup()
102 switch (alg) { in mbedtls_psa_hash_setup()
170 return PSA_ALG_IS_HASH(alg) ? in mbedtls_psa_hash_setup()
175 operation->alg = alg; in mbedtls_psa_hash_setup()
186 switch (source_operation->alg) { in mbedtls_psa_hash_clone()
257 target_operation->alg = source_operation->alg; in mbedtls_psa_hash_clone()
268 switch (operation->alg) { in mbedtls_psa_hash_update()
[all …]
/openthread-latest/third_party/mbedtls/repo/tests/src/drivers/
Dtest_driver_signature.c45 psa_algorithm_t alg, in sign_hash() argument
53 if (PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) || in sign_hash()
54 PSA_ALG_IS_RSA_PSS(alg)) { in sign_hash()
61 alg, hash, hash_length, in sign_hash()
68 alg, hash, hash_length, in sign_hash()
75 if (PSA_ALG_IS_ECDSA(alg)) { in sign_hash()
82 alg, hash, hash_length, in sign_hash()
89 alg, hash, hash_length, in sign_hash()
100 (void) alg; in sign_hash()
113 psa_algorithm_t alg, in verify_hash() argument
[all …]
Dtest_driver_cipher.c34 psa_algorithm_t alg, in mbedtls_test_transparent_cipher_encrypt() argument
71 alg, iv, iv_length, input, input_length, in mbedtls_test_transparent_cipher_encrypt()
76 alg, iv, iv_length, input, input_length, in mbedtls_test_transparent_cipher_encrypt()
87 psa_algorithm_t alg, in mbedtls_test_transparent_cipher_decrypt() argument
118 alg, input, input_length, in mbedtls_test_transparent_cipher_decrypt()
123 alg, input, input_length, in mbedtls_test_transparent_cipher_decrypt()
134 psa_algorithm_t alg) in mbedtls_test_transparent_cipher_encrypt_setup() argument
153 key, key_length, alg); in mbedtls_test_transparent_cipher_encrypt_setup()
156 operation, attributes, key, key_length, alg); in mbedtls_test_transparent_cipher_encrypt_setup()
166 psa_algorithm_t alg) in mbedtls_test_transparent_cipher_decrypt_setup() argument
[all …]
Dtest_driver_asymmetric_encryption.c30 size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input, in mbedtls_test_transparent_asymmetric_encrypt() argument
57 alg, input, input_length, salt, salt_length, in mbedtls_test_transparent_asymmetric_encrypt()
62 alg, input, input_length, salt, salt_length, in mbedtls_test_transparent_asymmetric_encrypt()
71 size_t key_buffer_size, psa_algorithm_t alg, const uint8_t *input, in mbedtls_test_transparent_asymmetric_decrypt() argument
98 alg, input, input_length, salt, salt_length, in mbedtls_test_transparent_asymmetric_decrypt()
103 alg, input, input_length, salt, salt_length, in mbedtls_test_transparent_asymmetric_decrypt()
115 size_t key_length, psa_algorithm_t alg, const uint8_t *input, in mbedtls_test_opaque_asymmetric_encrypt() argument
135 alg, input, input_length, salt, salt_length, in mbedtls_test_opaque_asymmetric_encrypt()
140 alg, input, input_length, salt, salt_length, in mbedtls_test_opaque_asymmetric_encrypt()
149 size_t key_length, psa_algorithm_t alg, const uint8_t *input, in mbedtls_test_opaque_asymmetric_decrypt() argument
[all …]
Dtest_driver_mac.c26 psa_algorithm_t alg, in mbedtls_test_transparent_mac_compute() argument
44 key_buffer, key_buffer_size, alg, in mbedtls_test_transparent_mac_compute()
50 attributes, key_buffer, key_buffer_size, alg, in mbedtls_test_transparent_mac_compute()
57 (void) alg; in mbedtls_test_transparent_mac_compute()
75 psa_algorithm_t alg) in mbedtls_test_transparent_mac_sign_setup() argument
89 key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_sign_setup()
93 operation, attributes, key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_sign_setup()
99 (void) alg; in mbedtls_test_transparent_mac_sign_setup()
112 psa_algorithm_t alg) in mbedtls_test_transparent_mac_verify_setup() argument
126 key_buffer, key_buffer_size, alg); in mbedtls_test_transparent_mac_verify_setup()
[all …]
Dtest_driver_key_agreement.c35 psa_algorithm_t alg, in mbedtls_test_transparent_key_agreement() argument
60 if (PSA_ALG_IS_ECDH(alg)) { in mbedtls_test_transparent_key_agreement()
66 alg, peer_key, peer_key_length, in mbedtls_test_transparent_key_agreement()
73 alg, peer_key, peer_key_length, in mbedtls_test_transparent_key_agreement()
88 if (PSA_ALG_IS_FFDH(alg)) { in mbedtls_test_transparent_key_agreement()
128 psa_algorithm_t alg, in mbedtls_test_opaque_key_agreement() argument
138 (void) alg; in mbedtls_test_opaque_key_agreement()
/openthread-latest/third_party/mbedtls/repo/tests/src/
Dpsa_exercise_key.c122 psa_algorithm_t alg, in exercise_mac_key() argument
131 if (alg & PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG) { in exercise_mac_key()
132 alg = PSA_ALG_TRUNCATED_MAC(alg, PSA_MAC_TRUNCATED_LENGTH(alg)); in exercise_mac_key()
136 status = psa_mac_sign_setup(&operation, key, alg); in exercise_mac_key()
155 status = psa_mac_verify_setup(&operation, key, alg); in exercise_mac_key()
177 psa_algorithm_t alg, in exercise_cipher_key() argument
194 iv_length = PSA_CIPHER_IV_LENGTH(key_type, alg); in exercise_cipher_key()
197 status = psa_cipher_encrypt_setup(&operation, key, alg); in exercise_cipher_key()
223 maybe_invalid_padding = !PSA_ALG_IS_STREAM_CIPHER(alg); in exercise_cipher_key()
225 status = psa_cipher_decrypt_setup(&operation, key, alg); in exercise_cipher_key()
[all …]
/openthread-latest/third_party/mbedtls/repo/scripts/mbedtls_dev/
Dcrypto_data_tests.py39 [alg
40 for alg in all_algorithms
41 if (not alg.is_wildcard and
42 alg.can_do(crypto_knowledge.AlgorithmCategory.HASH))]
68 def one_test_case(alg: crypto_knowledge.Algorithm,
76 alg.short_expression()))
77 tc.set_dependencies(psa_low_level_dependencies(alg.expression))
79 tc.set_arguments([alg.expression] +
84 alg: crypto_knowledge.Algorithm
87 calc = self.CALCULATE[alg.expression]
[all …]
/openthread-latest/third_party/mbedtls/repo/tests/scripts/
Dgenerate_psa_tests.py248 alg: crypto_knowledge.Algorithm,
257 pretty_alg = alg.short_expression()
275 dependencies = psa_information.automatic_dependencies(alg.base_expression, key_type)
286 arguments.append(alg.expression)
297 alg: crypto_knowledge.Algorithm,
301 if alg.can_do(category):
303 for dep in psa_information.automatic_dependencies(alg.base_expression):
304 yield self.make_test_case(alg, category,
309 yield self.make_test_case(alg, category, self.Reason.INVALID)
313 alg: crypto_knowledge.Algorithm,
[all …]
/openthread-latest/third_party/mbedtls/repo/programs/psa/
Daead_demo.c120 psa_algorithm_t *alg) in aead_prepare() argument
128 *alg = PSA_ALG_GCM; in aead_prepare()
132 *alg = PSA_ALG_GCM; in aead_prepare()
136 *alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM, 8); in aead_prepare()
140 *alg = PSA_ALG_CHACHA20_POLY1305; in aead_prepare()
151 psa_set_key_algorithm(&attributes, *alg); in aead_prepare()
168 static void aead_info(psa_key_id_t key, psa_algorithm_t alg) in aead_info() argument
174 psa_algorithm_t base_alg = PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG(alg); in aead_info()
175 size_t tag_len = PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg); in aead_info()
191 static int aead_encrypt(psa_key_id_t key, psa_algorithm_t alg, in aead_encrypt() argument
[all …]
Dcrypto_examples.c85 psa_algorithm_t alg, in cipher_encrypt() argument
100 status = psa_cipher_encrypt_setup(&operation, key, alg); in cipher_encrypt()
116 psa_algorithm_t alg, in cipher_decrypt() argument
130 status = psa_cipher_decrypt_setup(&operation, key, alg); in cipher_decrypt()
153 const psa_algorithm_t alg = PSA_ALG_CBC_NO_PADDING; in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block() local
169 psa_set_key_algorithm(&attributes, alg); in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
176 status = cipher_encrypt(key, alg, iv, sizeof(iv), in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
181 status = cipher_decrypt(key, alg, iv, sizeof(iv), in cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block()
203 const psa_algorithm_t alg = PSA_ALG_CBC_PKCS7; in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi() local
217 psa_set_key_algorithm(&attributes, alg); in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi()
[all …]
/openthread-latest/third_party/mbedtls/repo/tests/include/test/drivers/
Dsignature.h45 psa_algorithm_t alg,
56 psa_algorithm_t alg,
67 psa_algorithm_t alg,
77 psa_algorithm_t alg,
86 psa_algorithm_t alg,
93 psa_algorithm_t alg,
100 psa_algorithm_t alg,
107 psa_algorithm_t alg,

12345