Lines Matching refs:alg

44 static inline void supp_psa_set_attributes(psa_key_attributes_t *attributes, u32 type, u32 alg, u32…  in supp_psa_set_attributes()  argument
47 psa_set_key_algorithm(attributes, alg); in supp_psa_set_attributes()
51 static void supp_psa_get_hash_alg(mbedtls_md_type_t type, psa_algorithm_t *alg, int *block_size) in supp_psa_get_hash_alg() argument
56 *alg = PSA_ALG_MD5; in supp_psa_get_hash_alg()
59 *alg = PSA_ALG_SHA_1; in supp_psa_get_hash_alg()
62 *alg = PSA_ALG_SHA_224; in supp_psa_get_hash_alg()
65 *alg = PSA_ALG_SHA_256; in supp_psa_get_hash_alg()
68 *alg = PSA_ALG_SHA_384; in supp_psa_get_hash_alg()
71 *alg = PSA_ALG_SHA_512; in supp_psa_get_hash_alg()
74 *alg = PSA_ALG_RIPEMD160; in supp_psa_get_hash_alg()
77 *alg = PSA_ALG_NONE; in supp_psa_get_hash_alg()
80 *block_size = PSA_HASH_LENGTH(*alg); in supp_psa_get_hash_alg()
125 psa_algorithm_t alg = PSA_ALG_ECB_NO_PADDING; in aes_128_encrypt_block_psa() local
128 supp_psa_set_attributes(&attributes, PSA_KEY_TYPE_AES, alg, PSA_KEY_USAGE_ENCRYPT); in aes_128_encrypt_block_psa()
134 …status = psa_cipher_encrypt(key_id, alg, in, SUPP_PSA_BLOCK_SIZE_128, out, SUPP_PSA_BLOCK_SIZE_128… in aes_128_encrypt_block_psa()
152 psa_algorithm_t alg = PSA_ALG_CBC_NO_PADDING; in aes_128_cbc_encrypt_psa() local
161 supp_psa_set_attributes(&attributes, key_type, alg, PSA_KEY_USAGE_ENCRYPT); in aes_128_cbc_encrypt_psa()
167 status = psa_cipher_encrypt_setup(&operation, key_id, alg); in aes_128_cbc_encrypt_psa()
170 status = psa_cipher_set_iv(&operation, iv, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_128_cbc_encrypt_psa()
195 psa_algorithm_t alg = PSA_ALG_CBC_NO_PADDING; in aes_128_cbc_decrypt_psa() local
204 supp_psa_set_attributes(&attributes, key_type, alg, PSA_KEY_USAGE_DECRYPT); in aes_128_cbc_decrypt_psa()
210 status = psa_cipher_decrypt_setup(&operation, key_id, alg); in aes_128_cbc_decrypt_psa()
213 status = psa_cipher_set_iv(&operation, iv, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_128_cbc_decrypt_psa()
238 psa_algorithm_t alg = PSA_ALG_CTR; in aes_ctr_encrypt_psa() local
247 supp_psa_set_attributes(&attributes, key_type, alg, PSA_KEY_USAGE_ENCRYPT); in aes_ctr_encrypt_psa()
253 status = psa_cipher_encrypt_setup(&operation, key_id, alg); in aes_ctr_encrypt_psa()
256 status = psa_cipher_set_iv(&operation, nonce, PSA_CIPHER_IV_LENGTH(key_type, alg)); in aes_ctr_encrypt_psa()
282 psa_algorithm_t alg = PSA_ALG_CMAC; in omac1_aes_vector_psa() local
298 supp_psa_set_attributes(&attributes, PSA_KEY_TYPE_AES, alg, PSA_KEY_USAGE_SIGN_MESSAGE); in omac1_aes_vector_psa()
304 status = psa_mac_sign_setup(&operation, key_id, alg); in omac1_aes_vector_psa()
313 …status = psa_mac_sign_finish(&operation, mac, PSA_MAC_LENGTH(PSA_KEY_TYPE_AES, key_len * 8, alg), … in omac1_aes_vector_psa()
330 psa_algorithm_t alg = PSA_ALG_NONE; in md_vector_psa() local
335 supp_psa_get_hash_alg(md_type, &alg, &block_size); in md_vector_psa()
336 if (alg == PSA_ALG_NONE) in md_vector_psa()
342 status = psa_hash_setup(&operation, alg); in md_vector_psa()
368 psa_algorithm_t alg = PSA_ALG_NONE; in hmac_vector_psa() local
376 supp_psa_get_hash_alg(md_type, &alg, &block_size); in hmac_vector_psa()
377 if (alg == PSA_ALG_NONE) in hmac_vector_psa()
382 alg = PSA_ALG_HMAC(alg); in hmac_vector_psa()
384 supp_psa_set_attributes(&attributes, PSA_KEY_TYPE_HMAC, alg, PSA_KEY_USAGE_SIGN_MESSAGE); in hmac_vector_psa()
390 status = psa_mac_sign_setup(&operation, key_id, alg); in hmac_vector_psa()
399 …sa_mac_sign_finish(&operation, mac, PSA_MAC_LENGTH(PSA_KEY_TYPE_HMAC, key_len * 8, alg), &out_len); in hmac_vector_psa()