• Home
  • Raw
  • Download

Lines Matching refs:alg

65 #define PSA_HASH_LENGTH(alg)                                        \  argument
67 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_MD5 ? 16 : \
68 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_RIPEMD160 ? 20 : \
69 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_1 ? 20 : \
70 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_224 ? 28 : \
71 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_256 ? 32 : \
72 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_384 ? 48 : \
73 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512 ? 64 : \
74 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_224 ? 28 : \
75 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_256 ? 32 : \
76 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_224 ? 28 : \
77 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_256 ? 32 : \
78 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_384 ? 48 : \
79 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_512 ? 64 : \
97 #define PSA_HASH_BLOCK_LENGTH(alg) \ argument
99 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_MD5 ? 64 : \
100 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_RIPEMD160 ? 64 : \
101 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_1 ? 64 : \
102 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_224 ? 64 : \
103 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_256 ? 64 : \
104 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_384 ? 128 : \
105 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512 ? 128 : \
106 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_224 ? 128 : \
107 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA_512_256 ? 128 : \
108 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_224 ? 144 : \
109 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_256 ? 136 : \
110 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_384 ? 104 : \
111 PSA_ALG_HMAC_GET_HASH(alg) == PSA_ALG_SHA3_512 ? 72 : \
167 #define PSA_AEAD_TAG_LENGTH(key_type, key_bits, alg) \ argument
168 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \
169 PSA_ALG_AEAD_GET_TAG_LENGTH(alg) : \
266 #define PSA_MAC_LENGTH(key_type, key_bits, alg) \ argument
267 ((alg) & PSA_ALG_MAC_TRUNCATION_MASK ? PSA_MAC_TRUNCATED_LENGTH(alg) : \
268 PSA_ALG_IS_HMAC(alg) ? PSA_HASH_LENGTH(PSA_ALG_HMAC_GET_HASH(alg)) : \
269 PSA_ALG_IS_BLOCK_CIPHER_MAC(alg) ? PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \
298 #define PSA_AEAD_ENCRYPT_OUTPUT_SIZE(key_type, alg, plaintext_length) \ argument
299 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \
300 (plaintext_length) + PSA_ALG_AEAD_GET_TAG_LENGTH(alg) : \
351 #define PSA_AEAD_DECRYPT_OUTPUT_SIZE(key_type, alg, ciphertext_length) \ argument
352 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 && \
353 (ciphertext_length) > PSA_ALG_AEAD_GET_TAG_LENGTH(alg) ? \
354 (ciphertext_length) - PSA_ALG_AEAD_GET_TAG_LENGTH(alg) : \
403 #define PSA_AEAD_NONCE_LENGTH(key_type, alg) \ argument
405 MBEDTLS_PSA_ALG_AEAD_EQUAL(alg, PSA_ALG_CCM) ? 13 : \
406 MBEDTLS_PSA_ALG_AEAD_EQUAL(alg, PSA_ALG_GCM) ? 12 : \
409 MBEDTLS_PSA_ALG_AEAD_EQUAL(alg, PSA_ALG_CHACHA20_POLY1305) ? 12 : \
455 #define PSA_AEAD_UPDATE_OUTPUT_SIZE(key_type, alg, input_length) \ argument
456 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 ? \
457 PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) ? \
496 #define PSA_AEAD_FINISH_OUTPUT_SIZE(key_type, alg) \ argument
497 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 && \
498 PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) ? \
530 #define PSA_AEAD_VERIFY_OUTPUT_SIZE(key_type, alg) \ argument
531 (PSA_AEAD_NONCE_LENGTH(key_type, alg) != 0 && \
532 PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER(alg) ? \
543 #define PSA_RSA_MINIMUM_PADDING_SIZE(alg) \ argument
544 (PSA_ALG_IS_RSA_OAEP(alg) ? \
545 2 * PSA_HASH_LENGTH(PSA_ALG_RSA_OAEP_GET_HASH(alg)) + 1 : \
584 #define PSA_SIGN_OUTPUT_SIZE(key_type, key_bits, alg) \ argument
585 (PSA_KEY_TYPE_IS_RSA(key_type) ? ((void)alg, PSA_BITS_TO_BYTES(key_bits)) : \
587 ((void)alg, 0))
629 #define PSA_ASYMMETRIC_ENCRYPT_OUTPUT_SIZE(key_type, key_bits, alg) \ argument
631 ((void)alg, PSA_BITS_TO_BYTES(key_bits)) : \
668 #define PSA_ASYMMETRIC_DECRYPT_OUTPUT_SIZE(key_type, key_bits, alg) \ argument
670 PSA_BITS_TO_BYTES(key_bits) - PSA_RSA_MINIMUM_PADDING_SIZE(alg) : \
984 #define PSA_CIPHER_IV_LENGTH(key_type, alg) \ argument
986 ((alg) == PSA_ALG_CTR || \
987 (alg) == PSA_ALG_CFB || \
988 (alg) == PSA_ALG_OFB || \
989 (alg) == PSA_ALG_XTS || \
990 (alg) == PSA_ALG_CBC_NO_PADDING || \
991 (alg) == PSA_ALG_CBC_PKCS7) ? PSA_BLOCK_CIPHER_BLOCK_LENGTH(key_type) : \
993 (alg) == PSA_ALG_STREAM_CIPHER ? 12 : \
994 (alg) == PSA_ALG_CCM_STAR_NO_TAG ? 13 : \
1026 #define PSA_CIPHER_ENCRYPT_OUTPUT_SIZE(key_type, alg, input_length) \ argument
1027 (alg == PSA_ALG_CBC_PKCS7 ? \
1031 PSA_CIPHER_IV_LENGTH((key_type), (alg)) : 0) : \
1032 (PSA_ALG_IS_CIPHER(alg) ? \
1033 (input_length) + PSA_CIPHER_IV_LENGTH((key_type), (alg)) : \
1071 #define PSA_CIPHER_DECRYPT_OUTPUT_SIZE(key_type, alg, input_length) \ argument
1072 (PSA_ALG_IS_CIPHER(alg) && \
1108 #define PSA_CIPHER_UPDATE_OUTPUT_SIZE(key_type, alg, input_length) \ argument
1109 (PSA_ALG_IS_CIPHER(alg) ? \
1111 (((alg) == PSA_ALG_CBC_PKCS7 || \
1112 (alg) == PSA_ALG_CBC_NO_PADDING || \
1113 (alg) == PSA_ALG_ECB_NO_PADDING) ? \
1149 #define PSA_CIPHER_FINISH_OUTPUT_SIZE(key_type, alg) \ argument
1150 (PSA_ALG_IS_CIPHER(alg) ? \
1151 (alg == PSA_ALG_CBC_PKCS7 ? \