Key and algorithm types#

Typedefs#

typedef uint16_t

Encoding of a key type.

typedef uint8_t

The type of PSA elliptic curve family identifiers.

typedef uint8_t

The type of PSA Diffie-Hellman group family identifiers.

typedef uint32_t

Encoding of a cryptographic algorithm.

typedef uint16_t

Encoding of a key type.

typedef uint8_t

The type of PSA elliptic curve family identifiers.

typedef uint8_t

The type of PSA Diffie-Hellman group family identifiers.

typedef uint32_t

Encoding of a cryptographic algorithm.

Macros#

#define
PSA_KEY_TYPE_NONE ((psa_key_type_t) 0x0000)

An invalid key type value.

#define
PSA_KEY_TYPE_VENDOR_FLAG ((psa_key_type_t) 0x8000)

Vendor-defined key type flag.

#define
PSA_KEY_TYPE_CATEGORY_MASK ((psa_key_type_t) 0x7000)
#define
PSA_KEY_TYPE_CATEGORY_RAW ((psa_key_type_t) 0x1000)
#define
PSA_KEY_TYPE_CATEGORY_SYMMETRIC ((psa_key_type_t) 0x2000)
#define
PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY ((psa_key_type_t) 0x4000)
#define
PSA_KEY_TYPE_CATEGORY_KEY_PAIR ((psa_key_type_t) 0x7000)
#define
PSA_KEY_TYPE_CATEGORY_FLAG_PAIR ((psa_key_type_t) 0x3000)
#define
PSA_KEY_TYPE_IS_VENDOR_DEFINED (type)

Whether a key type is vendor-defined.

#define
PSA_KEY_TYPE_IS_UNSTRUCTURED (type)

Whether a key type is an unstructured array of bytes.

#define
PSA_KEY_TYPE_IS_ASYMMETRIC (type)

Whether a key type is asymmetric: either a key pair or a public key.

#define
PSA_KEY_TYPE_IS_PUBLIC_KEY (type)

Whether a key type is the public part of a key pair.

#define
PSA_KEY_TYPE_IS_KEY_PAIR (type)

Whether a key type is a key pair containing a private part and a public part.

#define
PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEY (type)

The key pair type corresponding to a public key type.

#define
PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR (type)

The public key type corresponding to a key pair type.

#define
PSA_KEY_TYPE_RAW_DATA ((psa_key_type_t) 0x1001)

Raw data.

#define
PSA_KEY_TYPE_HMAC ((psa_key_type_t) 0x1100)

HMAC key.

#define
PSA_KEY_TYPE_DERIVE ((psa_key_type_t) 0x1200)

A secret for key derivation.

#define
PSA_KEY_TYPE_PASSWORD ((psa_key_type_t) 0x1203)

A low-entropy secret for password hashing or key derivation.

#define
PSA_KEY_TYPE_PASSWORD_HASH ((psa_key_type_t) 0x1205)

A secret value that can be used to verify a password hash.

#define
PSA_KEY_TYPE_PEPPER ((psa_key_type_t) 0x1206)

A secret value that can be used in when computing a password hash.

#define
PSA_KEY_TYPE_AES ((psa_key_type_t) 0x2400)

Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.

#define
PSA_KEY_TYPE_ARIA ((psa_key_type_t) 0x2406)

Key for a cipher, AEAD or MAC algorithm based on the ARIA block cipher.

#define
PSA_KEY_TYPE_DES ((psa_key_type_t) 0x2301)

Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).

#define
PSA_KEY_TYPE_CAMELLIA ((psa_key_type_t) 0x2403)

Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.

#define
PSA_KEY_TYPE_CHACHA20 ((psa_key_type_t) 0x2004)

Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.

#define
PSA_KEY_TYPE_RSA_PUBLIC_KEY ((psa_key_type_t) 0x4001)

RSA public key.

#define
PSA_KEY_TYPE_RSA_KEY_PAIR ((psa_key_type_t) 0x7001)

RSA key pair (private and public key).

#define
PSA_KEY_TYPE_IS_RSA (type)

Whether a key type is an RSA key (pair or public-only).

#define
PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4100)
#define
PSA_KEY_TYPE_ECC_KEY_PAIR_BASE ((psa_key_type_t) 0x7100)
#define
PSA_KEY_TYPE_ECC_CURVE_MASK ((psa_key_type_t) 0x00ff)
#define
PSA_KEY_TYPE_ECC_KEY_PAIR (curve)

Elliptic curve key pair.

#define
PSA_KEY_TYPE_ECC_PUBLIC_KEY (curve)

Elliptic curve public key.

#define
PSA_KEY_TYPE_IS_ECC (type)

Whether a key type is an elliptic curve key (pair or public-only).

#define
PSA_KEY_TYPE_IS_ECC_KEY_PAIR (type)

Whether a key type is an elliptic curve key pair.

#define
PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY (type)

Whether a key type is an elliptic curve public key.

#define
PSA_KEY_TYPE_ECC_GET_FAMILY (type)

Extract the curve from an elliptic curve key type.

#define
PSA_ECC_FAMILY_IS_WEIERSTRASS (family)

Check if the curve of given family is Weierstrass elliptic curve.

#define
PSA_ECC_FAMILY_SECP_K1 ((psa_ecc_family_t) 0x17)

SEC Koblitz curves over prime fields.

#define
PSA_ECC_FAMILY_SECP_R1 ((psa_ecc_family_t) 0x12)

SEC random curves over prime fields.

#define
PSA_ECC_FAMILY_SECP_R2 ((psa_ecc_family_t) 0x1b)
#define
PSA_ECC_FAMILY_SECT_K1 ((psa_ecc_family_t) 0x27)

SEC Koblitz curves over binary fields.

#define
PSA_ECC_FAMILY_SECT_R1 ((psa_ecc_family_t) 0x22)

SEC random curves over binary fields.

#define
PSA_ECC_FAMILY_SECT_R2 ((psa_ecc_family_t) 0x2b)

SEC additional random curves over binary fields.

#define
PSA_ECC_FAMILY_BRAINPOOL_P_R1 ((psa_ecc_family_t) 0x30)

Brainpool P random curves.

#define
PSA_ECC_FAMILY_MONTGOMERY ((psa_ecc_family_t) 0x41)

Curve25519 and Curve448.

#define
PSA_ECC_FAMILY_TWISTED_EDWARDS ((psa_ecc_family_t) 0x42)

The twisted Edwards curves Ed25519 and Ed448.

#define
PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4200)
#define
PSA_KEY_TYPE_DH_KEY_PAIR_BASE ((psa_key_type_t) 0x7200)
#define
PSA_KEY_TYPE_DH_GROUP_MASK ((psa_key_type_t) 0x00ff)
#define
PSA_KEY_TYPE_DH_KEY_PAIR (group)

Diffie-Hellman key pair.

#define
PSA_KEY_TYPE_DH_PUBLIC_KEY (group)

Diffie-Hellman public key.

#define
PSA_KEY_TYPE_IS_DH (type)

Whether a key type is a Diffie-Hellman key (pair or public-only).

#define
PSA_KEY_TYPE_IS_DH_KEY_PAIR (type)

Whether a key type is a Diffie-Hellman key pair.

#define
PSA_KEY_TYPE_IS_DH_PUBLIC_KEY (type)

Whether a key type is a Diffie-Hellman public key.

#define
PSA_KEY_TYPE_DH_GET_FAMILY (type)

Extract the group from a Diffie-Hellman key type.

#define
PSA_DH_FAMILY_RFC7919 ((psa_dh_family_t) 0x03)

Diffie-Hellman groups defined in RFC 7919 Appendix A.

#define
PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT (type)
#define
PSA_BLOCK_CIPHER_BLOCK_LENGTH (type)

The block size of a block cipher.

#define
PSA_ALG_VENDOR_FLAG ((psa_algorithm_t) 0x80000000)

Vendor-defined algorithm flag.

#define
PSA_ALG_CATEGORY_MASK ((psa_algorithm_t) 0x7f000000)
#define
PSA_ALG_CATEGORY_HASH ((psa_algorithm_t) 0x02000000)
#define
PSA_ALG_CATEGORY_MAC ((psa_algorithm_t) 0x03000000)
#define
PSA_ALG_CATEGORY_CIPHER ((psa_algorithm_t) 0x04000000)
#define
PSA_ALG_CATEGORY_AEAD ((psa_algorithm_t) 0x05000000)
#define
PSA_ALG_CATEGORY_SIGN ((psa_algorithm_t) 0x06000000)
#define
PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION ((psa_algorithm_t) 0x07000000)
#define
PSA_ALG_CATEGORY_KEY_DERIVATION ((psa_algorithm_t) 0x08000000)
#define
PSA_ALG_CATEGORY_KEY_AGREEMENT ((psa_algorithm_t) 0x09000000)
#define
PSA_ALG_IS_VENDOR_DEFINED (alg)

Whether an algorithm is vendor-defined.

#define
PSA_ALG_IS_HASH (alg)

Whether the specified algorithm is a hash algorithm.

#define
PSA_ALG_IS_MAC (alg)

Whether the specified algorithm is a MAC algorithm.

#define
PSA_ALG_IS_CIPHER (alg)

Whether the specified algorithm is a symmetric cipher algorithm.

#define
PSA_ALG_IS_AEAD (alg)

Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.

#define
PSA_ALG_IS_SIGN (alg)

Whether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.

#define
PSA_ALG_IS_ASYMMETRIC_ENCRYPTION (alg)

Whether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.

#define
PSA_ALG_IS_KEY_AGREEMENT (alg)

Whether the specified algorithm is a key agreement algorithm.

#define
PSA_ALG_IS_KEY_DERIVATION (alg)

Whether the specified algorithm is a key derivation algorithm.

#define
PSA_ALG_IS_KEY_DERIVATION_STRETCHING (alg)

Whether the specified algorithm is a key stretching / password hashing algorithm.

#define
PSA_ALG_NONE ((psa_algorithm_t)0)

An invalid algorithm identifier value.

#define
PSA_ALG_HASH_MASK ((psa_algorithm_t) 0x000000ff)
#define
PSA_ALG_MD5 ((psa_algorithm_t) 0x02000003)

MD5.

#define
PSA_ALG_RIPEMD160 ((psa_algorithm_t) 0x02000004)

PSA_ALG_RIPEMD160.

#define
PSA_ALG_SHA_1 ((psa_algorithm_t) 0x02000005)

SHA1.

#define
PSA_ALG_SHA_224 ((psa_algorithm_t) 0x02000008)

SHA2-224.

#define
PSA_ALG_SHA_256 ((psa_algorithm_t) 0x02000009)

SHA2-256.

#define
PSA_ALG_SHA_384 ((psa_algorithm_t) 0x0200000a)

SHA2-384.

#define
PSA_ALG_SHA_512 ((psa_algorithm_t) 0x0200000b)

SHA2-512.

#define
PSA_ALG_SHA_512_224 ((psa_algorithm_t) 0x0200000c)

SHA2-512/224.

#define
PSA_ALG_SHA_512_256 ((psa_algorithm_t) 0x0200000d)

SHA2-512/256.

#define
PSA_ALG_SHA3_224 ((psa_algorithm_t) 0x02000010)

SHA3-224.

#define
PSA_ALG_SHA3_256 ((psa_algorithm_t) 0x02000011)

SHA3-256.

#define
PSA_ALG_SHA3_384 ((psa_algorithm_t) 0x02000012)

SHA3-384.

#define
PSA_ALG_SHA3_512 ((psa_algorithm_t) 0x02000013)

SHA3-512.

#define
PSA_ALG_SHAKE256_512 ((psa_algorithm_t) 0x02000015)

The first 512 bits (64 bytes) of the SHAKE256 output.

#define
PSA_ALG_ANY_HASH ((psa_algorithm_t) 0x020000ff)

In a hash-and-sign algorithm policy, allow any hash algorithm.

#define
PSA_ALG_MAC_SUBCATEGORY_MASK ((psa_algorithm_t) 0x00c00000)
#define
PSA_ALG_HMAC_BASE ((psa_algorithm_t) 0x03800000)
#define
PSA_ALG_HMAC (hash_alg)

Macro to build an HMAC algorithm.

#define
PSA_ALG_HMAC_GET_HASH (hmac_alg)
#define
PSA_ALG_IS_HMAC (alg)

Whether the specified algorithm is an HMAC algorithm.

#define
PSA_ALG_MAC_TRUNCATION_MASK ((psa_algorithm_t) 0x003f0000)
#define
PSA_MAC_TRUNCATION_OFFSET 16
#define
PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ((psa_algorithm_t) 0x00008000)
#define
PSA_ALG_TRUNCATED_MAC (mac_alg, mac_length)

Macro to build a truncated MAC algorithm.

#define
PSA_ALG_FULL_LENGTH_MAC (mac_alg)

Macro to build the base MAC algorithm corresponding to a truncated MAC algorithm.

#define
PSA_MAC_TRUNCATED_LENGTH (mac_alg)

Length to which a MAC algorithm is truncated.

#define
PSA_ALG_AT_LEAST_THIS_LENGTH_MAC (mac_alg, min_mac_length)

Macro to build a MAC minimum-MAC-length wildcard algorithm.

#define
PSA_ALG_CIPHER_MAC_BASE ((psa_algorithm_t) 0x03c00000)
#define
PSA_ALG_CBC_MAC ((psa_algorithm_t) 0x03c00100)

The CBC-MAC construction over a block cipher.

#define
PSA_ALG_CMAC ((psa_algorithm_t) 0x03c00200)

The CMAC construction over a block cipher.

#define
PSA_ALG_IS_BLOCK_CIPHER_MAC (alg)

Whether the specified algorithm is a MAC algorithm based on a block cipher.

#define
PSA_ALG_CIPHER_STREAM_FLAG ((psa_algorithm_t) 0x00800000)
#define
PSA_ALG_CIPHER_FROM_BLOCK_FLAG ((psa_algorithm_t) 0x00400000)
#define
PSA_ALG_IS_STREAM_CIPHER (alg)

Whether the specified algorithm is a stream cipher.

#define
PSA_ALG_STREAM_CIPHER ((psa_algorithm_t) 0x04800100)

The stream cipher mode of a stream cipher algorithm.

#define
PSA_ALG_CTR ((psa_algorithm_t) 0x04c01000)

The CTR stream cipher mode.

#define
PSA_ALG_CFB ((psa_algorithm_t) 0x04c01100)

The CFB stream cipher mode.

#define
PSA_ALG_OFB ((psa_algorithm_t) 0x04c01200)

The OFB stream cipher mode.

#define
PSA_ALG_XTS ((psa_algorithm_t) 0x0440ff00)

The XTS cipher mode.

#define
PSA_ALG_ECB_NO_PADDING ((psa_algorithm_t) 0x04404400)

The Electronic Code Book (ECB) mode of a block cipher, with no padding.

#define
PSA_ALG_CBC_NO_PADDING ((psa_algorithm_t) 0x04404000)

The CBC block cipher chaining mode, with no padding.

#define
PSA_ALG_CBC_PKCS7 ((psa_algorithm_t) 0x04404100)

The CBC block cipher chaining mode with PKCS#7 padding.

#define
PSA_ALG_AEAD_FROM_BLOCK_FLAG ((psa_algorithm_t) 0x00400000)
#define
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER (alg)

Whether the specified algorithm is an AEAD mode on a block cipher.

#define
PSA_ALG_CCM ((psa_algorithm_t) 0x05500100)

The CCM authenticated encryption algorithm.

#define
PSA_ALG_CCM_STAR_NO_TAG ((psa_algorithm_t) 0x04c01300)

The CCM* cipher mode without authentication.

#define
PSA_ALG_GCM ((psa_algorithm_t) 0x05500200)

The GCM authenticated encryption algorithm.

#define
PSA_ALG_CHACHA20_POLY1305 ((psa_algorithm_t) 0x05100500)

The Chacha20-Poly1305 AEAD algorithm.

#define
PSA_ALG_AEAD_TAG_LENGTH_MASK ((psa_algorithm_t) 0x003f0000)
#define
PSA_AEAD_TAG_LENGTH_OFFSET 16
#define
PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG ((psa_algorithm_t) 0x00008000)
#define
PSA_ALG_AEAD_WITH_SHORTENED_TAG (aead_alg, tag_length)

Macro to build a shortened AEAD algorithm.

#define
PSA_ALG_AEAD_GET_TAG_LENGTH (aead_alg)

Retrieve the tag length of a specified AEAD algorithm.

#define
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG (aead_alg)

Calculate the corresponding AEAD algorithm with the default tag length.

#define
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE (aead_alg, ref)
#define
PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG (aead_alg, min_tag_length)

Macro to build an AEAD minimum-tag-length wildcard algorithm.

#define
PSA_ALG_RSA_PKCS1V15_SIGN_BASE ((psa_algorithm_t) 0x06000200)
#define
PSA_ALG_RSA_PKCS1V15_SIGN (hash_alg)

RSA PKCS#1 v1.5 signature with hashing.

#define
PSA_ALG_RSA_PKCS1V15_SIGN_RAW PSA_ALG_RSA_PKCS1V15_SIGN_BASE

Raw PKCS#1 v1.5 signature.

#define
PSA_ALG_IS_RSA_PKCS1V15_SIGN (alg)
#define
PSA_ALG_RSA_PSS_BASE ((psa_algorithm_t) 0x06000300)
#define
PSA_ALG_RSA_PSS_ANY_SALT_BASE ((psa_algorithm_t) 0x06001300)
#define
PSA_ALG_RSA_PSS (hash_alg)

RSA PSS signature with hashing.

#define
PSA_ALG_RSA_PSS_ANY_SALT (hash_alg)

RSA PSS signature with hashing with relaxed verification.

#define
PSA_ALG_IS_RSA_PSS_STANDARD_SALT (alg)

Whether the specified algorithm is RSA PSS with standard salt.

#define
PSA_ALG_IS_RSA_PSS_ANY_SALT (alg)

Whether the specified algorithm is RSA PSS with any salt.

#define
PSA_ALG_IS_RSA_PSS (alg)

Whether the specified algorithm is RSA PSS.

#define
PSA_ALG_ECDSA_BASE ((psa_algorithm_t) 0x06000600)
#define
PSA_ALG_ECDSA (hash_alg)

ECDSA signature with hashing.

#define
PSA_ALG_ECDSA_ANY PSA_ALG_ECDSA_BASE

ECDSA signature without hashing.

#define
PSA_ALG_DETERMINISTIC_ECDSA_BASE ((psa_algorithm_t) 0x06000700)
#define
PSA_ALG_DETERMINISTIC_ECDSA (hash_alg)

Deterministic ECDSA signature with hashing.

#define
PSA_ALG_ECDSA_DETERMINISTIC_FLAG ((psa_algorithm_t) 0x00000100)
#define
PSA_ALG_IS_ECDSA (alg)
#define
PSA_ALG_ECDSA_IS_DETERMINISTIC (alg)
#define
PSA_ALG_IS_DETERMINISTIC_ECDSA (alg)
#define
PSA_ALG_IS_RANDOMIZED_ECDSA (alg)
#define
PSA_ALG_PURE_EDDSA ((psa_algorithm_t) 0x06000800)

Edwards-curve digital signature algorithm without prehashing (PureEdDSA), using standard parameters.

#define
PSA_ALG_HASH_EDDSA_BASE ((psa_algorithm_t) 0x06000900)
#define
PSA_ALG_IS_HASH_EDDSA (alg)
#define
PSA_ALG_ED25519PH (PSA_ALG_HASH_EDDSA_BASE | (PSA_ALG_SHA_512 & PSA_ALG_HASH_MASK))

Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHA-512 and the Edwards25519 curve.

#define
PSA_ALG_ED448PH (PSA_ALG_HASH_EDDSA_BASE | (PSA_ALG_SHAKE256_512 & PSA_ALG_HASH_MASK))

Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHAKE256 and the Edwards448 curve.

#define
PSA_ALG_IS_VENDOR_HASH_AND_SIGN (alg)
#define
PSA_ALG_IS_SIGN_HASH (alg)

Whether the specified algorithm is a signature algorithm that can be used with psa_sign_hash() and psa_verify_hash().

#define
PSA_ALG_IS_SIGN_MESSAGE (alg)

Whether the specified algorithm is a signature algorithm that can be used with psa_sign_message() and psa_verify_message().

#define
PSA_ALG_IS_HASH_AND_SIGN (alg)

Whether the specified algorithm is a hash-and-sign algorithm.

#define
PSA_ALG_SIGN_GET_HASH (alg)

Get the hash used by a hash-and-sign signature algorithm.

#define
PSA_ALG_RSA_PKCS1V15_CRYPT ((psa_algorithm_t) 0x07000200)

RSA PKCS#1 v1.5 encryption.

#define
PSA_ALG_RSA_OAEP_BASE ((psa_algorithm_t) 0x07000300)
#define
PSA_ALG_RSA_OAEP (hash_alg)

RSA OAEP encryption.

#define
PSA_ALG_IS_RSA_OAEP (alg)
#define
PSA_ALG_RSA_OAEP_GET_HASH (alg)
#define
PSA_ALG_HKDF_BASE ((psa_algorithm_t) 0x08000100)
#define
PSA_ALG_HKDF (hash_alg)

Macro to build an HKDF algorithm.

#define
PSA_ALG_IS_HKDF (alg)

Whether the specified algorithm is an HKDF algorithm.

#define
PSA_ALG_HKDF_GET_HASH (hkdf_alg)
#define
PSA_ALG_HKDF_EXTRACT_BASE ((psa_algorithm_t) 0x08000400)
#define
PSA_ALG_HKDF_EXTRACT (hash_alg)

Macro to build an HKDF-Extract algorithm.

#define
PSA_ALG_IS_HKDF_EXTRACT (alg)

Whether the specified algorithm is an HKDF-Extract algorithm.

#define
PSA_ALG_HKDF_EXPAND_BASE ((psa_algorithm_t) 0x08000500)
#define
PSA_ALG_HKDF_EXPAND (hash_alg)

Macro to build an HKDF-Expand algorithm.

#define
PSA_ALG_IS_HKDF_EXPAND (alg)

Whether the specified algorithm is an HKDF-Expand algorithm.

#define
PSA_ALG_IS_ANY_HKDF (alg)

Whether the specified algorithm is an HKDF or HKDF-Extract or HKDF-Expand algorithm.

#define
PSA_ALG_TLS12_PRF_BASE ((psa_algorithm_t) 0x08000200)
#define
PSA_ALG_TLS12_PRF (hash_alg)

Macro to build a TLS-1.2 PRF algorithm.

#define
PSA_ALG_IS_TLS12_PRF (alg)

Whether the specified algorithm is a TLS-1.2 PRF algorithm.

#define
PSA_ALG_TLS12_PRF_GET_HASH (hkdf_alg)
#define
PSA_ALG_TLS12_PSK_TO_MS_BASE ((psa_algorithm_t) 0x08000300)
#define
PSA_ALG_TLS12_PSK_TO_MS (hash_alg)

Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm.

#define
PSA_ALG_IS_TLS12_PSK_TO_MS (alg)

Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.

#define
PSA_ALG_TLS12_PSK_TO_MS_GET_HASH (hkdf_alg)
#define
PSA_ALG_TLS12_ECJPAKE_TO_PMS ((psa_algorithm_t) 0x08000609)
#define
PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG ((psa_algorithm_t) 0x00800000)
#define
PSA_ALG_PBKDF2_HMAC_BASE ((psa_algorithm_t) 0x08800100)
#define
PSA_ALG_PBKDF2_HMAC (hash_alg)

Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm.

#define
PSA_ALG_IS_PBKDF2_HMAC (alg)

Whether the specified algorithm is a PBKDF2-HMAC algorithm.

#define
PSA_ALG_PBKDF2_HMAC_GET_HASH (pbkdf2_alg)
#define
PSA_ALG_PBKDF2_AES_CMAC_PRF_128 ((psa_algorithm_t) 0x08800200)

The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.

#define
PSA_ALG_IS_PBKDF2 (kdf_alg)
#define
PSA_ALG_KEY_DERIVATION_MASK ((psa_algorithm_t) 0xfe00ffff)
#define
PSA_ALG_KEY_AGREEMENT_MASK ((psa_algorithm_t) 0xffff0000)
#define
PSA_ALG_KEY_AGREEMENT (ka_alg, kdf_alg)

Macro to build a combined algorithm that chains a key agreement with a key derivation.

#define
PSA_ALG_KEY_AGREEMENT_GET_KDF (alg)
#define
PSA_ALG_KEY_AGREEMENT_GET_BASE (alg)
#define
PSA_ALG_IS_RAW_KEY_AGREEMENT (alg)

Whether the specified algorithm is a raw key agreement algorithm.

#define
PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENT (alg)
#define
PSA_ALG_FFDH ((psa_algorithm_t) 0x09010000)

The finite-field Diffie-Hellman (DH) key agreement algorithm.

#define
PSA_ALG_IS_FFDH (alg)

Whether the specified algorithm is a finite field Diffie-Hellman algorithm.

#define
PSA_ALG_ECDH ((psa_algorithm_t) 0x09020000)

The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.

#define
PSA_ALG_IS_ECDH (alg)

Whether the specified algorithm is an elliptic curve Diffie-Hellman algorithm.

#define
PSA_ALG_IS_WILDCARD (alg)

Whether the specified algorithm encoding is a wildcard.

#define
PSA_ALG_GET_HASH (alg)

Get the hash used by a composite algorithm.

#define
PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t) 0x4002)

DSA public key.

#define
PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t) 0x7002)

DSA key pair (private and public key).

#define
PSA_KEY_TYPE_IS_DSA (type)

Whether a key type is a DSA key (pair or public-only).

#define
PSA_ALG_DSA_BASE ((psa_algorithm_t) 0x06000400)
#define
PSA_ALG_DSA (hash_alg)

DSA signature with hashing.

#define
PSA_ALG_DETERMINISTIC_DSA_BASE ((psa_algorithm_t) 0x06000500)
#define
PSA_ALG_DSA_DETERMINISTIC_FLAG PSA_ALG_ECDSA_DETERMINISTIC_FLAG
#define
PSA_ALG_DETERMINISTIC_DSA (hash_alg)

Deterministic DSA signature with hashing.

#define
PSA_ALG_IS_DSA (alg)
#define
PSA_ALG_DSA_IS_DETERMINISTIC (alg)
#define
PSA_ALG_IS_DETERMINISTIC_DSA (alg)
#define
PSA_ALG_IS_RANDOMIZED_DSA (alg)
#define
PSA_ALG_IS_VENDOR_HASH_AND_SIGN (alg)
#define
PSA_ALG_CATEGORY_PAKE ((psa_algorithm_t) 0x0a000000)
#define
PSA_ALG_IS_PAKE (alg)

Whether the specified algorithm is a password-authenticated key exchange.

#define
PSA_ALG_JPAKE ((psa_algorithm_t) 0x0a000100)

The Password-authenticated key exchange by juggling (J-PAKE) algorithm.

#define
PSA_KEY_TYPE_DSA_PUBLIC_KEY ((psa_key_type_t)0x4002)

DSA public key.

#define
PSA_KEY_TYPE_DSA_KEY_PAIR ((psa_key_type_t)0x7002)

DSA key pair (private and public key).

#define
PSA_KEY_TYPE_IS_DSA (type)

Whether a key type is an DSA key (pair or public-only).

#define
PSA_ALG_DSA_BASE ((psa_algorithm_t)0x06000400)
#define
PSA_ALG_DSA (hash_alg)

DSA signature with hashing.

#define
PSA_ALG_DETERMINISTIC_DSA_BASE ((psa_algorithm_t)0x06000500)
#define
PSA_ALG_DSA_DETERMINISTIC_FLAG PSA_ALG_ECDSA_DETERMINISTIC_FLAG
#define
PSA_ALG_DETERMINISTIC_DSA (hash_alg)

Deterministic DSA signature with hashing.

#define
PSA_ALG_IS_DSA (alg)
#define
PSA_ALG_DSA_IS_DETERMINISTIC (alg)
#define
PSA_ALG_IS_DETERMINISTIC_DSA (alg)
#define
PSA_ALG_IS_RANDOMIZED_DSA (alg)
#define
PSA_ALG_IS_VENDOR_HASH_AND_SIGN (alg)
#define
PSA_ALG_CATEGORY_PAKE ((psa_algorithm_t) 0x0a000000)
#define
PSA_ALG_IS_PAKE (alg)

Whether the specified algorithm is a password-authenticated key exchange.

#define
PSA_ALG_JPAKE ((psa_algorithm_t) 0x0a000100)

The Password-authenticated key exchange by juggling (J-PAKE) algorithm.

#define
PSA_KEY_TYPE_NONE ((psa_key_type_t) 0x0000)

An invalid key type value.

#define
PSA_KEY_TYPE_VENDOR_FLAG ((psa_key_type_t) 0x8000)

Vendor-defined key type flag.

#define
PSA_KEY_TYPE_CATEGORY_MASK ((psa_key_type_t) 0x7000)
#define
PSA_KEY_TYPE_CATEGORY_RAW ((psa_key_type_t) 0x1000)
#define
PSA_KEY_TYPE_CATEGORY_SYMMETRIC ((psa_key_type_t) 0x2000)
#define
PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY ((psa_key_type_t) 0x4000)
#define
PSA_KEY_TYPE_CATEGORY_KEY_PAIR ((psa_key_type_t) 0x7000)
#define
PSA_KEY_TYPE_CATEGORY_FLAG_PAIR ((psa_key_type_t) 0x3000)
#define
PSA_KEY_TYPE_IS_VENDOR_DEFINED (type)

Whether a key type is vendor-defined.

#define
PSA_KEY_TYPE_IS_UNSTRUCTURED (type)

Whether a key type is an unstructured array of bytes.

#define
PSA_KEY_TYPE_IS_ASYMMETRIC (type)

Whether a key type is asymmetric: either a key pair or a public key.

#define
PSA_KEY_TYPE_IS_PUBLIC_KEY (type)

Whether a key type is the public part of a key pair.

#define
PSA_KEY_TYPE_IS_KEY_PAIR (type)

Whether a key type is a key pair containing a private part and a public part.

#define
PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEY (type)

The key pair type corresponding to a public key type.

#define
PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR (type)

The public key type corresponding to a key pair type.

#define
PSA_KEY_TYPE_RAW_DATA ((psa_key_type_t) 0x1001)

Raw data.

#define
PSA_KEY_TYPE_HMAC ((psa_key_type_t) 0x1100)

HMAC key.

#define
PSA_KEY_TYPE_DERIVE ((psa_key_type_t) 0x1200)

A secret for key derivation.

#define
PSA_KEY_TYPE_PASSWORD ((psa_key_type_t) 0x1203)

A low-entropy secret for password hashing or key derivation.

#define
PSA_KEY_TYPE_PASSWORD_HASH ((psa_key_type_t) 0x1205)

A secret value that can be used to verify a password hash.

#define
PSA_KEY_TYPE_PEPPER ((psa_key_type_t) 0x1206)

A secret value that can be used in when computing a password hash.

#define
PSA_KEY_TYPE_AES ((psa_key_type_t) 0x2400)

Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.

#define
PSA_KEY_TYPE_ARIA ((psa_key_type_t) 0x2406)

Key for a cipher, AEAD or MAC algorithm based on the ARIA block cipher.

#define
PSA_KEY_TYPE_DES ((psa_key_type_t) 0x2301)

Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).

#define
PSA_KEY_TYPE_CAMELLIA ((psa_key_type_t) 0x2403)

Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.

#define
PSA_KEY_TYPE_CHACHA20 ((psa_key_type_t) 0x2004)

Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.

#define
PSA_KEY_TYPE_RSA_PUBLIC_KEY ((psa_key_type_t) 0x4001)

RSA public key.

#define
PSA_KEY_TYPE_RSA_KEY_PAIR ((psa_key_type_t) 0x7001)

RSA key pair (private and public key).

#define
PSA_KEY_TYPE_IS_RSA (type)

Whether a key type is an RSA key (pair or public-only).

#define
PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4100)
#define
PSA_KEY_TYPE_ECC_KEY_PAIR_BASE ((psa_key_type_t) 0x7100)
#define
PSA_KEY_TYPE_ECC_CURVE_MASK ((psa_key_type_t) 0x00ff)
#define
PSA_KEY_TYPE_ECC_KEY_PAIR (curve)

Elliptic curve key pair.

#define
PSA_KEY_TYPE_ECC_PUBLIC_KEY (curve)

Elliptic curve public key.

#define
PSA_KEY_TYPE_IS_ECC (type)

Whether a key type is an elliptic curve key (pair or public-only).

#define
PSA_KEY_TYPE_IS_ECC_KEY_PAIR (type)

Whether a key type is an elliptic curve key pair.

#define
PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY (type)

Whether a key type is an elliptic curve public key.

#define
PSA_KEY_TYPE_ECC_GET_FAMILY (type)

Extract the curve from an elliptic curve key type.

#define
PSA_ECC_FAMILY_IS_WEIERSTRASS (family)

Check if the curve of given family is Weierstrass elliptic curve.

#define
PSA_ECC_FAMILY_SECP_K1 ((psa_ecc_family_t) 0x17)

SEC Koblitz curves over prime fields.

#define
PSA_ECC_FAMILY_SECP_R1 ((psa_ecc_family_t) 0x12)

SEC random curves over prime fields.

#define
PSA_ECC_FAMILY_SECP_R2 ((psa_ecc_family_t) 0x1b)
#define
PSA_ECC_FAMILY_SECT_K1 ((psa_ecc_family_t) 0x27)

SEC Koblitz curves over binary fields.

#define
PSA_ECC_FAMILY_SECT_R1 ((psa_ecc_family_t) 0x22)

SEC random curves over binary fields.

#define
PSA_ECC_FAMILY_SECT_R2 ((psa_ecc_family_t) 0x2b)

SEC additional random curves over binary fields.

#define
PSA_ECC_FAMILY_BRAINPOOL_P_R1 ((psa_ecc_family_t) 0x30)

Brainpool P random curves.

#define
PSA_ECC_FAMILY_MONTGOMERY ((psa_ecc_family_t) 0x41)

Curve25519 and Curve448.

#define
PSA_ECC_FAMILY_TWISTED_EDWARDS ((psa_ecc_family_t) 0x42)

The twisted Edwards curves Ed25519 and Ed448.

#define
PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ((psa_key_type_t) 0x4200)
#define
PSA_KEY_TYPE_DH_KEY_PAIR_BASE ((psa_key_type_t) 0x7200)
#define
PSA_KEY_TYPE_DH_GROUP_MASK ((psa_key_type_t) 0x00ff)
#define
PSA_KEY_TYPE_DH_KEY_PAIR (group)

Diffie-Hellman key pair.

#define
PSA_KEY_TYPE_DH_PUBLIC_KEY (group)

Diffie-Hellman public key.

#define
PSA_KEY_TYPE_IS_DH (type)

Whether a key type is a Diffie-Hellman key (pair or public-only).

#define
PSA_KEY_TYPE_IS_DH_KEY_PAIR (type)

Whether a key type is a Diffie-Hellman key pair.

#define
PSA_KEY_TYPE_IS_DH_PUBLIC_KEY (type)

Whether a key type is a Diffie-Hellman public key.

#define
PSA_KEY_TYPE_DH_GET_FAMILY (type)

Extract the group from a Diffie-Hellman key type.

#define
PSA_DH_FAMILY_RFC7919 ((psa_dh_family_t) 0x03)

Diffie-Hellman groups defined in RFC 7919 Appendix A.

#define
PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT (type)
#define
PSA_BLOCK_CIPHER_BLOCK_LENGTH (type)

The block size of a block cipher.

#define
PSA_ALG_VENDOR_FLAG ((psa_algorithm_t) 0x80000000)

Vendor-defined algorithm flag.

#define
PSA_ALG_CATEGORY_MASK ((psa_algorithm_t) 0x7f000000)
#define
PSA_ALG_CATEGORY_HASH ((psa_algorithm_t) 0x02000000)
#define
PSA_ALG_CATEGORY_MAC ((psa_algorithm_t) 0x03000000)
#define
PSA_ALG_CATEGORY_CIPHER ((psa_algorithm_t) 0x04000000)
#define
PSA_ALG_CATEGORY_AEAD ((psa_algorithm_t) 0x05000000)
#define
PSA_ALG_CATEGORY_SIGN ((psa_algorithm_t) 0x06000000)
#define
PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION ((psa_algorithm_t) 0x07000000)
#define
PSA_ALG_CATEGORY_KEY_DERIVATION ((psa_algorithm_t) 0x08000000)
#define
PSA_ALG_CATEGORY_KEY_AGREEMENT ((psa_algorithm_t) 0x09000000)
#define
PSA_ALG_IS_VENDOR_DEFINED (alg)

Whether an algorithm is vendor-defined.

#define
PSA_ALG_IS_HASH (alg)

Whether the specified algorithm is a hash algorithm.

#define
PSA_ALG_IS_MAC (alg)

Whether the specified algorithm is a MAC algorithm.

#define
PSA_ALG_IS_CIPHER (alg)

Whether the specified algorithm is a symmetric cipher algorithm.

#define
PSA_ALG_IS_AEAD (alg)

Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.

#define
PSA_ALG_IS_SIGN (alg)

Whether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.

#define
PSA_ALG_IS_ASYMMETRIC_ENCRYPTION (alg)

Whether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.

#define
PSA_ALG_IS_KEY_AGREEMENT (alg)

Whether the specified algorithm is a key agreement algorithm.

#define
PSA_ALG_IS_KEY_DERIVATION (alg)

Whether the specified algorithm is a key derivation algorithm.

#define
PSA_ALG_IS_KEY_DERIVATION_STRETCHING (alg)

Whether the specified algorithm is a key stretching / password hashing algorithm.

#define
PSA_ALG_NONE ((psa_algorithm_t)0)

An invalid algorithm identifier value.

#define
PSA_ALG_HASH_MASK ((psa_algorithm_t) 0x000000ff)
#define
PSA_ALG_MD5 ((psa_algorithm_t) 0x02000003)

MD5.

#define
PSA_ALG_RIPEMD160 ((psa_algorithm_t) 0x02000004)

PSA_ALG_RIPEMD160.

#define
PSA_ALG_SHA_1 ((psa_algorithm_t) 0x02000005)

SHA1.

#define
PSA_ALG_SHA_224 ((psa_algorithm_t) 0x02000008)

SHA2-224.

#define
PSA_ALG_SHA_256 ((psa_algorithm_t) 0x02000009)

SHA2-256.

#define
PSA_ALG_SHA_384 ((psa_algorithm_t) 0x0200000a)

SHA2-384.

#define
PSA_ALG_SHA_512 ((psa_algorithm_t) 0x0200000b)

SHA2-512.

#define
PSA_ALG_SHA_512_224 ((psa_algorithm_t) 0x0200000c)

SHA2-512/224.

#define
PSA_ALG_SHA_512_256 ((psa_algorithm_t) 0x0200000d)

SHA2-512/256.

#define
PSA_ALG_SHA3_224 ((psa_algorithm_t) 0x02000010)

SHA3-224.

#define
PSA_ALG_SHA3_256 ((psa_algorithm_t) 0x02000011)

SHA3-256.

#define
PSA_ALG_SHA3_384 ((psa_algorithm_t) 0x02000012)

SHA3-384.

#define
PSA_ALG_SHA3_512 ((psa_algorithm_t) 0x02000013)

SHA3-512.

#define
PSA_ALG_SHAKE256_512 ((psa_algorithm_t) 0x02000015)

The first 512 bits (64 bytes) of the SHAKE256 output.

#define
PSA_ALG_ANY_HASH ((psa_algorithm_t) 0x020000ff)

In a hash-and-sign algorithm policy, allow any hash algorithm.

#define
PSA_ALG_MAC_SUBCATEGORY_MASK ((psa_algorithm_t) 0x00c00000)
#define
PSA_ALG_HMAC_BASE ((psa_algorithm_t) 0x03800000)
#define
PSA_ALG_HMAC (hash_alg)

Macro to build an HMAC algorithm.

#define
PSA_ALG_HMAC_GET_HASH (hmac_alg)
#define
PSA_ALG_IS_HMAC (alg)

Whether the specified algorithm is an HMAC algorithm.

#define
PSA_ALG_MAC_TRUNCATION_MASK ((psa_algorithm_t) 0x003f0000)
#define
PSA_MAC_TRUNCATION_OFFSET 16
#define
PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ((psa_algorithm_t) 0x00008000)
#define
PSA_ALG_TRUNCATED_MAC (mac_alg, mac_length)

Macro to build a truncated MAC algorithm.

#define
PSA_ALG_FULL_LENGTH_MAC (mac_alg)

Macro to build the base MAC algorithm corresponding to a truncated MAC algorithm.

#define
PSA_MAC_TRUNCATED_LENGTH (mac_alg)

Length to which a MAC algorithm is truncated.

#define
PSA_ALG_AT_LEAST_THIS_LENGTH_MAC (mac_alg, min_mac_length)

Macro to build a MAC minimum-MAC-length wildcard algorithm.

#define
PSA_ALG_CIPHER_MAC_BASE ((psa_algorithm_t) 0x03c00000)
#define
PSA_ALG_CBC_MAC ((psa_algorithm_t) 0x03c00100)

The CBC-MAC construction over a block cipher.

#define
PSA_ALG_CMAC ((psa_algorithm_t) 0x03c00200)

The CMAC construction over a block cipher.

#define
PSA_ALG_IS_BLOCK_CIPHER_MAC (alg)

Whether the specified algorithm is a MAC algorithm based on a block cipher.

#define
PSA_ALG_CIPHER_STREAM_FLAG ((psa_algorithm_t) 0x00800000)
#define
PSA_ALG_CIPHER_FROM_BLOCK_FLAG ((psa_algorithm_t) 0x00400000)
#define
PSA_ALG_IS_STREAM_CIPHER (alg)

Whether the specified algorithm is a stream cipher.

#define
PSA_ALG_STREAM_CIPHER ((psa_algorithm_t) 0x04800100)

The stream cipher mode of a stream cipher algorithm.

#define
PSA_ALG_CTR ((psa_algorithm_t) 0x04c01000)

The CTR stream cipher mode.

#define
PSA_ALG_CFB ((psa_algorithm_t) 0x04c01100)

The CFB stream cipher mode.

#define
PSA_ALG_OFB ((psa_algorithm_t) 0x04c01200)

The OFB stream cipher mode.

#define
PSA_ALG_XTS ((psa_algorithm_t) 0x0440ff00)

The XTS cipher mode.

#define
PSA_ALG_ECB_NO_PADDING ((psa_algorithm_t) 0x04404400)

The Electronic Code Book (ECB) mode of a block cipher, with no padding.

#define
PSA_ALG_CBC_NO_PADDING ((psa_algorithm_t) 0x04404000)

The CBC block cipher chaining mode, with no padding.

#define
PSA_ALG_CBC_PKCS7 ((psa_algorithm_t) 0x04404100)

The CBC block cipher chaining mode with PKCS#7 padding.

#define
PSA_ALG_AEAD_FROM_BLOCK_FLAG ((psa_algorithm_t) 0x00400000)
#define
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER (alg)

Whether the specified algorithm is an AEAD mode on a block cipher.

#define
PSA_ALG_CCM ((psa_algorithm_t) 0x05500100)

The CCM authenticated encryption algorithm.

#define
PSA_ALG_CCM_STAR_NO_TAG ((psa_algorithm_t) 0x04c01300)

The CCM* cipher mode without authentication.

#define
PSA_ALG_GCM ((psa_algorithm_t) 0x05500200)

The GCM authenticated encryption algorithm.

#define
PSA_ALG_CHACHA20_POLY1305 ((psa_algorithm_t) 0x05100500)

The Chacha20-Poly1305 AEAD algorithm.

#define
PSA_ALG_AEAD_TAG_LENGTH_MASK ((psa_algorithm_t) 0x003f0000)
#define
PSA_AEAD_TAG_LENGTH_OFFSET 16
#define
PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG ((psa_algorithm_t) 0x00008000)
#define
PSA_ALG_AEAD_WITH_SHORTENED_TAG (aead_alg, tag_length)

Macro to build a shortened AEAD algorithm.

#define
PSA_ALG_AEAD_GET_TAG_LENGTH (aead_alg)

Retrieve the tag length of a specified AEAD algorithm.

#define
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG (aead_alg)

Calculate the corresponding AEAD algorithm with the default tag length.

#define
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE (aead_alg, ref)
#define
PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG (aead_alg, min_tag_length)

Macro to build an AEAD minimum-tag-length wildcard algorithm.

#define
PSA_ALG_RSA_PKCS1V15_SIGN_BASE ((psa_algorithm_t) 0x06000200)
#define
PSA_ALG_RSA_PKCS1V15_SIGN (hash_alg)

RSA PKCS#1 v1.5 signature with hashing.

#define
PSA_ALG_RSA_PKCS1V15_SIGN_RAW PSA_ALG_RSA_PKCS1V15_SIGN_BASE

Raw PKCS#1 v1.5 signature.

#define
PSA_ALG_IS_RSA_PKCS1V15_SIGN (alg)
#define
PSA_ALG_RSA_PSS_BASE ((psa_algorithm_t) 0x06000300)
#define
PSA_ALG_RSA_PSS_ANY_SALT_BASE ((psa_algorithm_t) 0x06001300)
#define
PSA_ALG_RSA_PSS (hash_alg)

RSA PSS signature with hashing.

#define
PSA_ALG_RSA_PSS_ANY_SALT (hash_alg)

RSA PSS signature with hashing with relaxed verification.

#define
PSA_ALG_IS_RSA_PSS_STANDARD_SALT (alg)

Whether the specified algorithm is RSA PSS with standard salt.

#define
PSA_ALG_IS_RSA_PSS_ANY_SALT (alg)

Whether the specified algorithm is RSA PSS with any salt.

#define
PSA_ALG_IS_RSA_PSS (alg)

Whether the specified algorithm is RSA PSS.

#define
PSA_ALG_ECDSA_BASE ((psa_algorithm_t) 0x06000600)
#define
PSA_ALG_ECDSA (hash_alg)

ECDSA signature with hashing.

#define
PSA_ALG_ECDSA_ANY PSA_ALG_ECDSA_BASE

ECDSA signature without hashing.

#define
PSA_ALG_DETERMINISTIC_ECDSA_BASE ((psa_algorithm_t) 0x06000700)
#define
PSA_ALG_DETERMINISTIC_ECDSA (hash_alg)

Deterministic ECDSA signature with hashing.

#define
PSA_ALG_ECDSA_DETERMINISTIC_FLAG ((psa_algorithm_t) 0x00000100)
#define
PSA_ALG_IS_ECDSA (alg)
#define
PSA_ALG_ECDSA_IS_DETERMINISTIC (alg)
#define
PSA_ALG_IS_DETERMINISTIC_ECDSA (alg)
#define
PSA_ALG_IS_RANDOMIZED_ECDSA (alg)
#define
PSA_ALG_PURE_EDDSA ((psa_algorithm_t) 0x06000800)

Edwards-curve digital signature algorithm without prehashing (PureEdDSA), using standard parameters.

#define
PSA_ALG_HASH_EDDSA_BASE ((psa_algorithm_t) 0x06000900)
#define
PSA_ALG_IS_HASH_EDDSA (alg)
#define
PSA_ALG_ED25519PH (PSA_ALG_HASH_EDDSA_BASE | (PSA_ALG_SHA_512 & PSA_ALG_HASH_MASK))

Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHA-512 and the Edwards25519 curve.

#define
PSA_ALG_ED448PH (PSA_ALG_HASH_EDDSA_BASE | (PSA_ALG_SHAKE256_512 & PSA_ALG_HASH_MASK))

Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHAKE256 and the Edwards448 curve.

#define
PSA_ALG_IS_VENDOR_HASH_AND_SIGN (alg)
#define
PSA_ALG_IS_SIGN_HASH (alg)

Whether the specified algorithm is a signature algorithm that can be used with psa_sign_hash() and psa_verify_hash().

#define
PSA_ALG_IS_SIGN_MESSAGE (alg)

Whether the specified algorithm is a signature algorithm that can be used with psa_sign_message() and psa_verify_message().

#define
PSA_ALG_IS_HASH_AND_SIGN (alg)

Whether the specified algorithm is a hash-and-sign algorithm.

#define
PSA_ALG_SIGN_GET_HASH (alg)

Get the hash used by a hash-and-sign signature algorithm.

#define
PSA_ALG_RSA_PKCS1V15_CRYPT ((psa_algorithm_t) 0x07000200)

RSA PKCS#1 v1.5 encryption.

#define
PSA_ALG_RSA_OAEP_BASE ((psa_algorithm_t) 0x07000300)
#define
PSA_ALG_RSA_OAEP (hash_alg)

RSA OAEP encryption.

#define
PSA_ALG_IS_RSA_OAEP (alg)
#define
PSA_ALG_RSA_OAEP_GET_HASH (alg)
#define
PSA_ALG_HKDF_BASE ((psa_algorithm_t) 0x08000100)
#define
PSA_ALG_HKDF (hash_alg)

Macro to build an HKDF algorithm.

#define
PSA_ALG_IS_HKDF (alg)

Whether the specified algorithm is an HKDF algorithm.

#define
PSA_ALG_HKDF_GET_HASH (hkdf_alg)
#define
PSA_ALG_HKDF_EXTRACT_BASE ((psa_algorithm_t) 0x08000400)
#define
PSA_ALG_HKDF_EXTRACT (hash_alg)

Macro to build an HKDF-Extract algorithm.

#define
PSA_ALG_IS_HKDF_EXTRACT (alg)

Whether the specified algorithm is an HKDF-Extract algorithm.

#define
PSA_ALG_HKDF_EXPAND_BASE ((psa_algorithm_t) 0x08000500)
#define
PSA_ALG_HKDF_EXPAND (hash_alg)

Macro to build an HKDF-Expand algorithm.

#define
PSA_ALG_IS_HKDF_EXPAND (alg)

Whether the specified algorithm is an HKDF-Expand algorithm.

#define
PSA_ALG_IS_ANY_HKDF (alg)

Whether the specified algorithm is an HKDF or HKDF-Extract or HKDF-Expand algorithm.

#define
PSA_ALG_TLS12_PRF_BASE ((psa_algorithm_t) 0x08000200)
#define
PSA_ALG_TLS12_PRF (hash_alg)

Macro to build a TLS-1.2 PRF algorithm.

#define
PSA_ALG_IS_TLS12_PRF (alg)

Whether the specified algorithm is a TLS-1.2 PRF algorithm.

#define
PSA_ALG_TLS12_PRF_GET_HASH (hkdf_alg)
#define
PSA_ALG_TLS12_PSK_TO_MS_BASE ((psa_algorithm_t) 0x08000300)
#define
PSA_ALG_TLS12_PSK_TO_MS (hash_alg)

Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm.

#define
PSA_ALG_IS_TLS12_PSK_TO_MS (alg)

Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.

#define
PSA_ALG_TLS12_PSK_TO_MS_GET_HASH (hkdf_alg)
#define
PSA_ALG_TLS12_ECJPAKE_TO_PMS ((psa_algorithm_t) 0x08000609)
#define
PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG ((psa_algorithm_t) 0x00800000)
#define
PSA_ALG_PBKDF2_HMAC_BASE ((psa_algorithm_t) 0x08800100)
#define
PSA_ALG_PBKDF2_HMAC (hash_alg)

Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm.

#define
PSA_ALG_IS_PBKDF2_HMAC (alg)

Whether the specified algorithm is a PBKDF2-HMAC algorithm.

#define
PSA_ALG_PBKDF2_HMAC_GET_HASH (pbkdf2_alg)
#define
PSA_ALG_PBKDF2_AES_CMAC_PRF_128 ((psa_algorithm_t) 0x08800200)

The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.

#define
PSA_ALG_IS_PBKDF2 (kdf_alg)
#define
PSA_ALG_KEY_DERIVATION_MASK ((psa_algorithm_t) 0xfe00ffff)
#define
PSA_ALG_KEY_AGREEMENT_MASK ((psa_algorithm_t) 0xffff0000)
#define
PSA_ALG_KEY_AGREEMENT (ka_alg, kdf_alg)

Macro to build a combined algorithm that chains a key agreement with a key derivation.

#define
PSA_ALG_KEY_AGREEMENT_GET_KDF (alg)
#define
PSA_ALG_KEY_AGREEMENT_GET_BASE (alg)
#define
PSA_ALG_IS_RAW_KEY_AGREEMENT (alg)

Whether the specified algorithm is a raw key agreement algorithm.

#define
PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENT (alg)
#define
PSA_ALG_FFDH ((psa_algorithm_t) 0x09010000)

The finite-field Diffie-Hellman (DH) key agreement algorithm.

#define
PSA_ALG_IS_FFDH (alg)

Whether the specified algorithm is a finite field Diffie-Hellman algorithm.

#define
PSA_ALG_ECDH ((psa_algorithm_t) 0x09020000)

The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.

#define
PSA_ALG_IS_ECDH (alg)

Whether the specified algorithm is an elliptic curve Diffie-Hellman algorithm.

#define
PSA_ALG_IS_WILDCARD (alg)

Whether the specified algorithm encoding is a wildcard.

#define
PSA_ALG_GET_HASH (alg)

Get the hash used by a composite algorithm.

Typedef Documentation#

psa_key_type_t#

typedef uint16_t psa_key_type_t

Encoding of a key type.

Values of this type are generally constructed by macros called PSA_KEY_TYPE_xxx.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 90 of file util/third_party/mbedtls/include/psa/crypto_types.h

psa_ecc_family_t#

typedef uint8_t psa_ecc_family_t

The type of PSA elliptic curve family identifiers.

Values of this type are generally constructed by macros called PSA_ECC_FAMILY_xxx.

The curve identifier is required to create an ECC key using the PSA_KEY_TYPE_ECC_KEY_PAIR() or PSA_KEY_TYPE_ECC_PUBLIC_KEY() macros.

Values defined by this standard will never be in the range 0x80-0xff. Vendors who define additional families must use an encoding in this range.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 109 of file util/third_party/mbedtls/include/psa/crypto_types.h

psa_dh_family_t#

typedef uint8_t psa_dh_family_t

The type of PSA Diffie-Hellman group family identifiers.

Values of this type are generally constructed by macros called PSA_DH_FAMILY_xxx.

The group identifier is required to create a Diffie-Hellman key using the PSA_KEY_TYPE_DH_KEY_PAIR() or PSA_KEY_TYPE_DH_PUBLIC_KEY() macros.

Values defined by this standard will never be in the range 0x80-0xff. Vendors who define additional families must use an encoding in this range.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 128 of file util/third_party/mbedtls/include/psa/crypto_types.h

psa_algorithm_t#

typedef uint32_t psa_algorithm_t

Encoding of a cryptographic algorithm.

Values of this type are generally constructed by macros called PSA_ALG_xxx.

For algorithms that can be applied to multiple key types, this type does not encode the key type. For example, for symmetric ciphers based on a block cipher, psa_algorithm_t encodes the block cipher mode and the padding mode while the block cipher itself is encoded via psa_key_type_t.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 146 of file util/third_party/mbedtls/include/psa/crypto_types.h

psa_key_type_t#

typedef uint16_t psa_key_type_t

Encoding of a key type.

Values of this type are generally constructed by macros called PSA_KEY_TYPE_xxx.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 75 of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_types.h

psa_ecc_family_t#

typedef uint8_t psa_ecc_family_t

The type of PSA elliptic curve family identifiers.

Values of this type are generally constructed by macros called PSA_ECC_FAMILY_xxx.

The curve identifier is required to create an ECC key using the PSA_KEY_TYPE_ECC_KEY_PAIR() or PSA_KEY_TYPE_ECC_PUBLIC_KEY() macros.

Values defined by this standard will never be in the range 0x80-0xff. Vendors who define additional families must use an encoding in this range.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 94 of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_types.h

psa_dh_family_t#

typedef uint8_t psa_dh_family_t

The type of PSA Diffie-Hellman group family identifiers.

Values of this type are generally constructed by macros called PSA_DH_FAMILY_xxx.

The group identifier is required to create a Diffie-Hellman key using the PSA_KEY_TYPE_DH_KEY_PAIR() or PSA_KEY_TYPE_DH_PUBLIC_KEY() macros.

Values defined by this standard will never be in the range 0x80-0xff. Vendors who define additional families must use an encoding in this range.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 113 of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_types.h

psa_algorithm_t#

typedef uint32_t psa_algorithm_t

Encoding of a cryptographic algorithm.

Values of this type are generally constructed by macros called PSA_ALG_xxx.

For algorithms that can be applied to multiple key types, this type does not encode the key type. For example, for symmetric ciphers based on a block cipher, psa_algorithm_t encodes the block cipher mode and the padding mode while the block cipher itself is encoded via psa_key_type_t.

Note

  • Values of this type are encoded in the persistent key store. Any changes to existing values will require bumping the storage format version and providing a translation when reading the old format.


Definition at line 131 of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_types.h