Home
last modified time | relevance | path

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

12345

/mbedtls/include/psa/
A Dcrypto_sizes.h329 ((alg) & PSA_ALG_MAC_TRUNCATION_MASK ? PSA_MAC_TRUNCATED_LENGTH(alg) : \
330 PSA_ALG_IS_HMAC(alg) ? PSA_HASH_LENGTH(PSA_ALG_HMAC_GET_HASH(alg)) : \
465 #define PSA_AEAD_NONCE_LENGTH(key_type, alg) \ argument
649 ((void) alg, 0u))
1112 #define PSA_CIPHER_IV_LENGTH(key_type, alg) \ argument
1114 ((alg) == PSA_ALG_CTR || \
1115 (alg) == PSA_ALG_CFB || \
1116 (alg) == PSA_ALG_OFB || \
1117 (alg) == PSA_ALG_XTS || \
1118 (alg) == PSA_ALG_CBC_NO_PADDING || \
[all …]
A Dcrypto_values.h1577 (PSA_ALG_IS_ECDSA(alg) && PSA_ALG_ECDSA_IS_DETERMINISTIC(alg))
1579 (PSA_ALG_IS_ECDSA(alg) && !PSA_ALG_ECDSA_IS_DETERMINISTIC(alg))
1687 (PSA_ALG_IS_RSA_PSS(alg) || PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) || \
1688 PSA_ALG_IS_ECDSA(alg) || PSA_ALG_IS_HASH_EDDSA(alg) || \
1703 (PSA_ALG_IS_SIGN_HASH(alg) || (alg) == PSA_ALG_PURE_EDDSA)
2182 ((PSA_ALG_IS_KEY_DERIVATION(alg) || PSA_ALG_IS_KEY_AGREEMENT(alg)))
2205 #define PSA_ALG_IS_FFDH(alg) \ argument
2249 #define PSA_ALG_IS_ECDH(alg) \ argument
2272 (alg) == PSA_ALG_ANY_HASH)
2283 #define PSA_ALG_GET_HASH(alg) \ argument
[all …]
A Dcrypto.h860 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,
2107 psa_algorithm_t alg,
2180 psa_algorithm_t alg,
2887 psa_algorithm_t alg,
2992 psa_algorithm_t alg,
3043 psa_algorithm_t alg,
[all …]
A Dcrypto_extra.h391 #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)
583 #define PSA_ALG_IS_PAKE(alg) \ argument
584 (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_PAKE)
[all …]
/mbedtls/tests/suites/
A Dtest_suite_psa_crypto_metadata.function74 * PSA_##flag(alg) is true.
253 psa_algorithm_t alg = alg_arg;
299 psa_algorithm_t alg = alg_arg;
307 TEST_EQUAL(PSA_ALG_FULL_LENGTH_MAC(alg), alg);
379 psa_algorithm_t alg = alg_arg;
404 psa_algorithm_t alg = alg_arg;
425 psa_algorithm_t alg = alg_arg;
440 alg);
473 alg);
504 psa_algorithm_t alg = alg_arg;
[all …]
A Dtest_suite_psa_crypto_op_fail.function48 psa_algorithm_t alg = alg_arg;
77 psa_algorithm_t alg = alg_arg;
91 psa_set_key_algorithm(&attributes, alg);
105 psa_mac_verify(key_id, alg,
123 psa_algorithm_t alg = alg_arg;
169 psa_algorithm_t alg = alg_arg;
218 psa_algorithm_t alg = alg_arg;
244 psa_sign_hash(key_id, alg,
293 psa_algorithm_t alg = alg_arg;
337 psa_algorithm_t alg = alg_arg;
[all …]
A Dtest_suite_psa_crypto.function367 psa_algorithm_t alg = alg_arg;
622 psa_algorithm_t alg = alg_arg;
1464 psa_algorithm_t alg;
1561 psa_algorithm_t alg = alg_arg;
1775 psa_algorithm_t alg = alg_arg;
1894 psa_algorithm_t alg = alg_arg;
2027 psa_algorithm_t alg = alg_arg;
2078 psa_algorithm_t alg = alg_arg;
6265 if (operation.alg == PSA_ALG_CCM || operation.alg == PSA_ALG_GCM) {
6337 if (operation.alg == PSA_ALG_CCM || operation.alg == PSA_ALG_GCM) {
[all …]
/mbedtls/library/
A Dpsa_crypto_cipher.c30 psa_algorithm_t alg, in mbedtls_cipher_validate_values() argument
127 psa_algorithm_t alg, in mbedtls_cipher_values_from_psa() argument
140 alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, 0); in mbedtls_cipher_values_from_psa()
143 if (PSA_ALG_IS_CIPHER(alg) || PSA_ALG_IS_AEAD(alg)) { in mbedtls_cipher_values_from_psa()
144 switch (alg) { in mbedtls_cipher_values_from_psa()
259 psa_algorithm_t alg, in mbedtls_cipher_info_from_psa() argument
286 psa_algorithm_t alg, in psa_cipher_setup() argument
298 operation->alg = alg; in psa_cipher_setup()
332 switch (alg) { in psa_cipher_setup()
364 psa_algorithm_t alg) in mbedtls_psa_cipher_encrypt_setup() argument
[all …]
A Dpsa_crypto_mac.c43 hmac->alg = hash_alg; in psa_hmac_setup_internal()
204 psa_algorithm_t alg) in mac_init() argument
208 operation->alg = alg; in mac_init()
236 if (operation->alg == 0) { in mbedtls_psa_mac_abort()
258 operation->alg = 0; in mbedtls_psa_mac_abort()
280 if (operation->alg != 0) { in psa_mac_setup()
324 psa_algorithm_t alg) in mbedtls_psa_mac_sign_setup() argument
335 psa_algorithm_t alg) in mbedtls_psa_mac_verify_setup() argument
346 if (operation->alg == 0) { in mbedtls_psa_mac_update()
411 if (operation->alg == 0) { in mbedtls_psa_mac_sign_finish()
[all …]
A Dpsa_crypto_aead.c31 psa_algorithm_t alg) in psa_aead_setup() argument
48 operation->alg = PSA_ALG_CCM; in psa_aead_setup()
68 operation->alg = PSA_ALG_GCM; in psa_aead_setup()
120 psa_algorithm_t alg, in mbedtls_psa_aead_encrypt() argument
146 if (operation.alg == PSA_ALG_CCM) { in mbedtls_psa_aead_encrypt()
158 if (operation.alg == PSA_ALG_GCM) { in mbedtls_psa_aead_encrypt()
232 psa_algorithm_t alg, in mbedtls_psa_aead_decrypt() argument
257 if (operation.alg == PSA_ALG_CCM) { in mbedtls_psa_aead_decrypt()
326 psa_algorithm_t alg) in mbedtls_psa_aead_encrypt_setup() argument
347 psa_algorithm_t alg) in mbedtls_psa_aead_decrypt_setup() argument
[all …]
A Dpsa_crypto_driver_wrappers.h115 psa_algorithm_t alg, in psa_driver_wrapper_sign_message() argument
190 psa_algorithm_t alg, in psa_driver_wrapper_verify_message() argument
1149 (void)alg; in psa_driver_wrapper_cipher_encrypt()
1233 (void)alg; in psa_driver_wrapper_cipher_decrypt()
1265 alg ); in psa_driver_wrapper_cipher_encrypt_setup()
1297 alg ); in psa_driver_wrapper_cipher_encrypt_setup()
1311 (void)alg; in psa_driver_wrapper_cipher_encrypt_setup()
1338 alg ); in psa_driver_wrapper_cipher_decrypt_setup()
1384 (void)alg; in psa_driver_wrapper_cipher_decrypt_setup()
1574 (void) alg; in psa_driver_wrapper_hash_compute()
[all …]
A Dpsa_crypto.c2605 alg); in psa_mac_setup()
2801 alg); in psa_mac_compute_internal()
2820 alg, in psa_mac_compute_internal()
2969 alg); in psa_sign_internal()
3024 alg); in psa_verify_internal()
3853 operation->alg = alg; in mbedtls_psa_sign_hash_start()
4773 alg, in psa_aead_encrypt()
4840 alg, in psa_aead_decrypt()
6087 psa_algorithm_t alg = operation->alg; in psa_key_derivation_output_bytes() local
6089 operation->alg = alg; in psa_key_derivation_output_bytes()
[all …]
A Dpsa_crypto_rsa.c305 if (alg != PSA_ALG_RSA_PKCS1V15_SIGN_RAW) { in psa_rsa_decode_md_type()
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()
446 if (PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg)) { in mbedtls_psa_rsa_verify_hash()
459 if (PSA_ALG_IS_RSA_PSS(alg)) { in mbedtls_psa_rsa_verify_hash()
557 if (alg == PSA_ALG_RSA_PKCS1V15_CRYPT) { in mbedtls_psa_asymmetric_encrypt()
570 if (PSA_ALG_IS_RSA_OAEP(alg)) { in mbedtls_psa_asymmetric_encrypt()
654 if (alg == PSA_ALG_RSA_PKCS1V15_CRYPT) { in mbedtls_psa_asymmetric_decrypt()
[all …]
A 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()
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()
365 switch (operation->alg) { in mbedtls_psa_hash_finish()
[all …]
/mbedtls/tests/src/drivers/
A Dtest_driver_signature.c45 psa_algorithm_t alg, in sign_hash() argument
100 (void) alg; in sign_hash()
113 psa_algorithm_t alg, in verify_hash() argument
167 (void) alg; in verify_hash()
179 psa_algorithm_t alg, in mbedtls_test_transparent_signature_sign_message() argument
235 psa_algorithm_t alg, in mbedtls_test_opaque_signature_sign_message() argument
245 (void) alg; in mbedtls_test_opaque_signature_sign_message()
259 psa_algorithm_t alg, in mbedtls_test_transparent_signature_verify_message() argument
311 (void) alg; in mbedtls_test_opaque_signature_verify_message()
358 (void) alg; in mbedtls_test_opaque_signature_sign_hash()
[all …]
A Dtest_driver_cipher.c34 psa_algorithm_t alg, in mbedtls_test_transparent_cipher_encrypt() argument
87 psa_algorithm_t alg, in mbedtls_test_transparent_cipher_decrypt() argument
134 psa_algorithm_t alg) in mbedtls_test_transparent_cipher_encrypt_setup() argument
166 psa_algorithm_t alg) in mbedtls_test_transparent_cipher_decrypt_setup() argument
319 psa_algorithm_t alg, in mbedtls_test_opaque_cipher_encrypt() argument
327 (void) alg; in mbedtls_test_opaque_cipher_encrypt()
341 psa_algorithm_t alg, in mbedtls_test_opaque_cipher_decrypt() argument
348 (void) alg; in mbedtls_test_opaque_cipher_decrypt()
361 psa_algorithm_t alg) in mbedtls_test_opaque_cipher_encrypt_setup() argument
367 (void) alg; in mbedtls_test_opaque_cipher_encrypt_setup()
[all …]
A Dtest_driver_mac.c26 psa_algorithm_t alg, in mbedtls_test_transparent_mac_compute() argument
57 (void) alg; in mbedtls_test_transparent_mac_compute()
75 psa_algorithm_t alg) in mbedtls_test_transparent_mac_sign_setup() argument
99 (void) alg; in mbedtls_test_transparent_mac_sign_setup()
112 psa_algorithm_t alg) in mbedtls_test_transparent_mac_verify_setup() argument
136 (void) alg; in mbedtls_test_transparent_mac_verify_setup()
268 psa_algorithm_t alg, in mbedtls_test_opaque_mac_compute() argument
284 (void) alg; in mbedtls_test_opaque_mac_compute()
301 psa_algorithm_t alg) in mbedtls_test_opaque_mac_sign_setup() argument
313 (void) alg; in mbedtls_test_opaque_mac_sign_setup()
[all …]
A 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()
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
169 alg, input, input_length, salt, salt_length, in mbedtls_test_opaque_asymmetric_decrypt()
[all …]
A Dtest_driver_aead.c28 psa_algorithm_t alg, in mbedtls_test_transparent_aead_encrypt() argument
46 alg, in mbedtls_test_transparent_aead_encrypt()
55 alg, in mbedtls_test_transparent_aead_encrypt()
64 (void) alg; in mbedtls_test_transparent_aead_encrypt()
84 psa_algorithm_t alg, in mbedtls_test_transparent_aead_decrypt() argument
102 alg, in mbedtls_test_transparent_aead_decrypt()
111 alg, in mbedtls_test_transparent_aead_decrypt()
120 (void) alg; in mbedtls_test_transparent_aead_decrypt()
141 psa_algorithm_t alg) in mbedtls_test_transparent_aead_encrypt_setup() argument
166 (void) alg; in mbedtls_test_transparent_aead_encrypt_setup()
[all …]
/mbedtls/tests/src/
A Dpsa_exercise_key.c132 alg = PSA_ALG_TRUNCATED_MAC(alg, PSA_MAC_TRUNCATED_LENGTH(alg)); in exercise_mac_key()
280 alg = PSA_ALG_AEAD_WITH_SHORTENED_TAG(alg, PSA_ALG_AEAD_GET_TAG_LENGTH(alg)); in exercise_aead_key()
331 if (alg == PSA_ALG_ECDSA_ANY || alg == PSA_ALG_RSA_PKCS1V15_SIGN_RAW) { in can_sign_or_verify_message()
489 psa_algorithm_t alg, in mbedtls_test_psa_setup_key_derivation_wrap() argument
496 if (PSA_ALG_IS_HKDF(alg)) { in mbedtls_test_psa_setup_key_derivation_wrap()
684 psa_algorithm_t alg, in mbedtls_test_psa_raw_key_agreement_with_self() argument
1130 if (alg == 0) { in mbedtls_test_psa_exercise_key()
1166 if (PSA_ALG_IS_MAC(alg) || PSA_ALG_IS_SIGN(alg)) { in mbedtls_test_psa_usage_to_exercise()
1183 } else if (PSA_ALG_IS_CIPHER(alg) || PSA_ALG_IS_AEAD(alg) || in mbedtls_test_psa_usage_to_exercise()
1234 if (PSA_ALG_IS_ECDH(alg)) { in mbedtls_test_can_exercise_psa_algorithm()
[all …]
/mbedtls/tests/scripts/
A Dgenerate_psa_tests.py301 if alg.can_do(category):
447 alg: psa_storage.Expr
608 if alg is not None:
609 alg1 = alg.expression
613 if alg is not None:
636 compatible_algorithms = [alg for alg in all_algorithms
662 usage=usage, alg=alg, alg2=0,
669 usage=usage, alg=0, alg2=alg,
722 alg: str,
747 alg=alg, alg2=alg2,
[all …]
/mbedtls/scripts/mbedtls_dev/
A Dcrypto_data_tests.py39 [alg
40 for alg in all_algorithms
41 if (not alg.is_wildcard and
68 def one_test_case(alg: crypto_knowledge.Algorithm,
76 alg.short_expression()))
79 tc.set_arguments([alg.expression] +
84 alg: crypto_knowledge.Algorithm
87 calc = self.CALCULATE[alg.expression]
101 yield self.one_test_case(alg, 'hash_valid_one_shot', '',
111 for alg in self.algorithms:
[all …]
A Dcrypto_knowledge.py206 def can_do(self, alg: 'Algorithm') -> bool:
212 if not alg.is_valid_for_operation():
218 return alg.head in [
226 if alg.head in ['CMAC', 'OFB'] and \
233 alg.head == 'STREAM_CIPHER':
249 if alg.head == 'ECDH' and \
253 if alg.head == 'ECDSA' and \
460 def hash_length(cls, alg: str) -> int:
462 if alg in cls.HASH_LENGTH:
463 return cls.HASH_LENGTH[alg]
[all …]
/mbedtls/programs/psa/
A 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()
140 *alg = PSA_ALG_CHACHA20_POLY1305; in aead_prepare()
151 psa_set_key_algorithm(&attributes, *alg); in aead_prepare()
204 PSA_CHECK(psa_aead_encrypt_setup(&op, key, alg)); in aead_encrypt()
234 psa_algorithm_t alg; in aead_demo() local
236 PSA_CHECK(aead_prepare(info, &key, &alg)); in aead_demo()
238 aead_info(key, alg); in aead_demo()
240 PSA_CHECK(aead_encrypt(key, alg, in aead_demo()
[all …]
A Dcrypto_examples.c85 psa_algorithm_t alg, in cipher_encrypt() argument
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()
224 status = cipher_encrypt(key, alg, iv, sizeof(iv), in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi()
229 status = cipher_decrypt(key, alg, iv, sizeof(iv), in cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi()
250 const psa_algorithm_t alg = PSA_ALG_CTR; in cipher_example_encrypt_decrypt_aes_ctr_multi() local
264 psa_set_key_algorithm(&attributes, alg); in cipher_example_encrypt_decrypt_aes_ctr_multi()
[all …]

Completed in 91 milliseconds

12345