PSA_AEAD_TAG_LENGTH_OFFSET)
#define PSA_ALG_AEAD_TAG_LENGTH_MASK
Retrieve the tag length of a specified AEAD algorithm.
aead_alg
is not a supported AEAD algorithm.
Definition at line 1343 of file crypto_values.h.
◆ PSA_ALG_AEAD_TAG_LENGTH_MASK ◆ PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG #define PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG ( aead_alg, min_tag_length ) Value:PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG)
#define PSA_ALG_AEAD_WITH_SHORTENED_TAG(aead_alg, tag_length)
Macro to build a shortened AEAD algorithm.
Macro to build an AEAD minimum-tag-length wildcard algorithm.
A minimum-tag-length AEAD wildcard algorithm permits all AEAD algorithms sharing the same base algorithm, and where the tag length of the specific algorithm is equal to or larger then the minimum tag length specified by the wildcard algorithm.
aead_alg
) is true). min_tag_length Desired minimum length of the authentication tag in bytes. This must be at least 1 and at most the largest allowed tag length of the algorithm.
aead_alg
is not a supported AEAD algorithm or if min_tag_length
is less than 1 or too large for the specified AEAD algorithm.
Definition at line 1390 of file crypto_values.h.
◆ PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG #define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG ( aead_alg ) Value:( \
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE(aead_alg,
PSA_ALG_CCM) \
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE(aead_alg,
PSA_ALG_GCM) \
0)
#define PSA_ALG_GCM
The GCM authenticated encryption algorithm.
#define PSA_ALG_CHACHA20_POLY1305
The Chacha20-Poly1305 AEAD algorithm.
#define PSA_ALG_CCM
The CCM authenticated encryption algorithm.
Calculate the corresponding AEAD algorithm with the default tag length.
PSA_ALG_XXX
value such that PSA_ALG_IS_AEAD(aead_alg
) is true).
Definition at line 1355 of file crypto_values.h.
◆ PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE #define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE ( aead_alg, ref ) Value:PSA_ALG_AEAD_WITH_SHORTENED_TAG(ref, 0) ? \
ref :
Definition at line 1361 of file crypto_values.h.
◆ PSA_ALG_AEAD_WITH_SHORTENED_TAG #define PSA_ALG_AEAD_WITH_SHORTENED_TAG ( aead_alg, tag_length ) Value:PSA_ALG_AEAD_TAG_LENGTH_MASK))
#define PSA_AEAD_TAG_LENGTH_OFFSET
#define PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG
Macro to build a shortened AEAD algorithm.
A shortened AEAD algorithm is similar to the corresponding AEAD algorithm, but has an authentication tag that consists of fewer bytes. Depending on the algorithm, the tag length may affect the calculation of the ciphertext.
aead_alg
) is true). tag_length Desired length of the authentication tag in bytes.
aead_alg
is not a supported AEAD algorithm or if tag_length
is not valid for the specified AEAD algorithm.
Definition at line 1327 of file crypto_values.h.
◆ PSA_ALG_ANY_HASHIn a hash-and-sign algorithm policy, allow any hash algorithm.
This value may be used to form the algorithm usage field of a policy for a signature algorithm that is parametrized by a hash. The key may then be used to perform operations using the same signature algorithm parametrized with any supported hash.
That is, suppose that `PSA_xxx_SIGNATURE` is one of the following macros:
This value may not be used to build other algorithms that are parametrized over a hash. For any valid use of this macro to build an algorithm alg
, PSA_ALG_IS_HASH_AND_SIGN(alg
) is true.
This value may not be used to build an algorithm specification to perform an operation. It is only valid to build policies.
Definition at line 982 of file crypto_values.h.
◆ PSA_ALG_AT_LEAST_THIS_LENGTH_MAC #define PSA_ALG_AT_LEAST_THIS_LENGTH_MAC ( mac_alg, min_mac_length ) Value:PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG)
#define PSA_ALG_TRUNCATED_MAC(mac_alg, mac_length)
Macro to build a truncated MAC algorithm.
Macro to build a MAC minimum-MAC-length wildcard algorithm.
A minimum-MAC-length MAC wildcard algorithm permits all MAC algorithms sharing the same base algorithm, and where the (potentially truncated) MAC length of the specific algorithm is equal to or larger then the wildcard algorithm's minimum MAC length.
mac_alg
) is true). min_mac_length Desired minimum length of the message authentication code in bytes. This must be at most the untruncated length of the MAC and must be at least 1.
mac_alg
is not a supported MAC algorithm or if min_mac_length
is less than 1 or too large for the specified MAC algorithm.
Definition at line 1127 of file crypto_values.h.
◆ PSA_ALG_CATEGORY_AEAD ◆ PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION ◆ PSA_ALG_CATEGORY_CIPHER ◆ PSA_ALG_CATEGORY_HASH ◆ PSA_ALG_CATEGORY_KEY_AGREEMENT ◆ PSA_ALG_CATEGORY_KEY_DERIVATION ◆ PSA_ALG_CATEGORY_MAC ◆ PSA_ALG_CATEGORY_MASK ◆ PSA_ALG_CATEGORY_PAKE ◆ PSA_ALG_CATEGORY_SIGN ◆ PSA_ALG_CBC_MACThe CBC-MAC construction over a block cipher.
Definition at line 1137 of file crypto_values.h.
◆ PSA_ALG_CBC_NO_PADDINGThe CBC block cipher chaining mode, with no padding.
The underlying block cipher is determined by the key type.
This symmetric cipher mode can only be used with messages whose lengths are whole number of blocks for the chosen block cipher.
Definition at line 1235 of file crypto_values.h.
◆ PSA_ALG_CBC_PKCS7The CBC block cipher chaining mode with PKCS#7 padding.
The underlying block cipher is determined by the key type.
This is the padding method defined by PKCS#7 (RFC 2315) §10.3.
Definition at line 1243 of file crypto_values.h.
◆ PSA_ALG_CCMThe CCM authenticated encryption algorithm.
The underlying block cipher is determined by the key type.
Definition at line 1264 of file crypto_values.h.
◆ PSA_ALG_CCM_STAR_NO_TAGThe CCM* cipher mode without authentication.
This is CCM* as specified in IEEE 802.15.4 §7, with a tag length of 0. For CCM* with a nonzero tag length, use the AEAD algorithm PSA_ALG_CCM.
The underlying block cipher is determined by the key type.
Currently only 13-byte long IV's are supported.
Definition at line 1275 of file crypto_values.h.
◆ PSA_ALG_CFBThe CFB stream cipher mode.
The underlying block cipher is determined by the key type.
Definition at line 1192 of file crypto_values.h.
◆ PSA_ALG_CHACHA20_POLY1305The Chacha20-Poly1305 AEAD algorithm.
The ChaCha20_Poly1305 construction is defined in RFC 7539.
Implementations must support 12-byte nonces, may support 8-byte nonces, and should reject other sizes.
Implementations must support 16-byte tags and should reject other sizes.
Definition at line 1292 of file crypto_values.h.
◆ PSA_ALG_CIPHER_FROM_BLOCK_FLAG ◆ PSA_ALG_CIPHER_MAC_BASE ◆ PSA_ALG_CIPHER_STREAM_FLAG ◆ PSA_ALG_CMAC ◆ PSA_ALG_CTRThe CTR stream cipher mode.
CTR is a stream cipher which is built from a block cipher. The underlying block cipher is determined by the key type. For example, to use AES-128-CTR, use this algorithm with a key of type PSA_KEY_TYPE_AES and a length of 128 bits (16 bytes).
Definition at line 1186 of file crypto_values.h.
◆ PSA_ALG_DETERMINISTIC_DSADeterministic DSA signature with hashing.
This is the deterministic variant defined by RFC 6979 of the signature scheme defined by FIPS 186-4.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true). This includes PSA_ALG_ANY_HASH when specifying the algorithm in a usage policy.
hash_alg
is not a supported hash algorithm.
Definition at line 404 of file crypto_extra.h.
◆ PSA_ALG_DETERMINISTIC_DSA_BASE ◆ PSA_ALG_DETERMINISTIC_ECDSADeterministic ECDSA signature with hashing.
This is the deterministic ECDSA signature scheme defined by RFC 6979.
The representation of a signature is the same as with PSA_ALG_ECDSA().
Note that when this algorithm is used for verification, signatures made with randomized ECDSA (PSA_ALG_ECDSA(hash_alg
)) with the same private key are accepted. In other words, PSA_ALG_DETERMINISTIC_ECDSA(hash_alg
) differs from PSA_ALG_ECDSA(hash_alg
) only for signature, not for verification.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true). This includes PSA_ALG_ANY_HASH when specifying the algorithm in a usage policy.
hash_alg
is not a supported hash algorithm.
Definition at line 1568 of file crypto_values.h.
◆ PSA_ALG_DETERMINISTIC_ECDSA_BASE ◆ PSA_ALG_DSADSA signature with hashing.
This is the signature scheme defined by FIPS 186-4, with a random per-message secret number (*k*).
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true). This includes PSA_ALG_ANY_HASH when specifying the algorithm in a usage policy.
hash_alg
is not a supported hash algorithm.
Definition at line 386 of file crypto_extra.h.
◆ PSA_ALG_DSA_BASE ◆ PSA_ALG_DSA_DETERMINISTIC_FLAG ◆ PSA_ALG_DSA_IS_DETERMINISTIC ◆ PSA_ALG_ECB_NO_PADDINGThe Electronic Code Book (ECB) mode of a block cipher, with no padding.
The underlying block cipher is determined by the key type.
This symmetric cipher mode can only be used with messages whose lengths are a multiple of the block size of the chosen block cipher.
ECB mode does not accept an initialization vector (IV). When using a multi-part cipher operation with this algorithm, psa_cipher_generate_iv() and psa_cipher_set_iv() must not be called.
Definition at line 1226 of file crypto_values.h.
◆ PSA_ALG_ECDHThe elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.
The shared secret produced by key agreement is the x-coordinate of the shared secret point. It is always `ceiling(m / 8)` bytes long where `m` is the bit size associated with the curve, i.e. the bit size of the order of the curve's coordinate field. When `m` is not a multiple of 8, the byte containing the most significant bit of the shared secret is padded with zero bits. The byte order is either little-endian or big-endian depending on the curve type.
Definition at line 2233 of file crypto_values.h.
◆ PSA_ALG_ECDSAECDSA signature with hashing.
This is the ECDSA signature scheme defined by ANSI X9.62, with a random per-message secret number (*k*).
The representation of the signature as a byte string consists of the concatenation of the signature values *r* and *s*. Each of *r* and *s* is encoded as an *N*-octet string, where *N* is the length of the base point of the curve in octets. Each value is represented in big-endian order (most significant octet first).
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true). This includes PSA_ALG_ANY_HASH when specifying the algorithm in a usage policy.
hash_alg
is not a supported hash algorithm.
Definition at line 1533 of file crypto_values.h.
◆ PSA_ALG_ECDSA_ANYECDSA signature without hashing.
This is the same signature scheme as PSA_ALG_ECDSA(), but without specifying a hash algorithm. This algorithm may only be used to sign or verify a sequence of bytes that should be an already-calculated hash. Note that the input is padded with zeros on the left or truncated on the left as required to fit the curve size.
Definition at line 1544 of file crypto_values.h.
◆ PSA_ALG_ECDSA_BASE ◆ PSA_ALG_ECDSA_DETERMINISTIC_FLAG ◆ PSA_ALG_ECDSA_IS_DETERMINISTIC ◆ PSA_ALG_ED25519PHEdwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHA-512 and the Edwards25519 curve.
See PSA_ALG_PURE_EDDSA regarding context support and the signature format.
This algorithm is Ed25519 as specified in RFC 8032. The curve is Edwards25519. The prehash is SHA-512. The hash function used internally is SHA-512.
This is a hash-and-sign algorithm: to calculate a signature, you can either:
Definition at line 1636 of file crypto_values.h.
◆ PSA_ALG_ED448PHEdwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHAKE256 and the Edwards448 curve.
See PSA_ALG_PURE_EDDSA regarding context support and the signature format.
This algorithm is Ed448 as specified in RFC 8032. The curve is Edwards448. The prehash is the first 64 bytes of the SHAKE256 output. The hash function used internally is the first 114 bytes of the SHAKE256 output.
This is a hash-and-sign algorithm: to calculate a signature, you can either:
Definition at line 1661 of file crypto_values.h.
◆ PSA_ALG_FFDHThe finite-field Diffie-Hellman (DH) key agreement algorithm.
The shared secret produced by key agreement is `g^{ab}` in big-endian format. It is `ceiling(m / 8)` bytes long where `m` is the size of the prime `p` in bits.
Definition at line 2191 of file crypto_values.h.
◆ PSA_ALG_FULL_LENGTH_MAC #define PSA_ALG_FULL_LENGTH_MAC ( mac_alg ) Value:#define PSA_ALG_MAC_TRUNCATION_MASK
#define PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG
Macro to build the base MAC algorithm corresponding to a truncated MAC algorithm.
mac_alg
) is true). This may be a truncated or untruncated MAC algorithm.
mac_alg
is not a supported MAC algorithm.
Definition at line 1085 of file crypto_values.h.
◆ PSA_ALG_GCMThe GCM authenticated encryption algorithm.
The underlying block cipher is determined by the key type.
Definition at line 1281 of file crypto_values.h.
◆ PSA_ALG_GET_HASH #define PSA_ALG_GET_HASH ( alg ) (((alg) & 0x000000ff) == 0 ? ((psa_algorithm_t) 0) : 0x02000000 | ((alg) & 0x000000ff))Get the hash used by a composite algorithm.
0
if alg is not a composite algorithm that uses a hash.
Definition at line 2283 of file crypto_values.h.
◆ PSA_ALG_HASH_EDDSA_BASE ◆ PSA_ALG_HASH_MASK ◆ PSA_ALG_HKDFMacro to build an HKDF algorithm.
For example, `PSA_ALG_HKDF(PSA_ALG_SHA_256)` is HKDF using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_KEY_DERIVATION_INPUT_INFO is the info string used in the "expand" step. You must pass PSA_KEY_DERIVATION_INPUT_SALT before PSA_KEY_DERIVATION_INPUT_SECRET. You may pass PSA_KEY_DERIVATION_INPUT_INFO at any time after steup and before starting to generate output.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true).
hash_alg
is not a supported hash algorithm.
Definition at line 1820 of file crypto_values.h.
◆ PSA_ALG_HKDF_BASE ◆ PSA_ALG_HKDF_EXPANDMacro to build an HKDF-Expand algorithm.
For example, `PSA_ALG_HKDF_EXPAND(PSA_ALG_SHA_256)` is HKDF-Expand using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
The inputs are mandatory and must be passed in the order above. Each input may only be passed once.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true).
hash_alg
is not a supported hash algorithm.
Definition at line 1913 of file crypto_values.h.
◆ PSA_ALG_HKDF_EXPAND_BASE ◆ PSA_ALG_HKDF_EXTRACTMacro to build an HKDF-Extract algorithm.
For example, `PSA_ALG_HKDF_EXTRACT(PSA_ALG_SHA_256)` is HKDF-Extract using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true).
hash_alg
is not a supported hash algorithm.
Definition at line 1871 of file crypto_values.h.
◆ PSA_ALG_HKDF_EXTRACT_BASE ◆ PSA_ALG_HKDF_GET_HASH ◆ PSA_ALG_HMACMacro to build an HMAC algorithm.
For example, PSA_ALG_HMAC(PSA_ALG_SHA_256) is HMAC-SHA-256.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true).
hash_alg
is not a supported hash algorithm.
Definition at line 997 of file crypto_values.h.
◆ PSA_ALG_HMAC_BASE ◆ PSA_ALG_HMAC_GET_HASH ◆ PSA_ALG_IS_AEADWhether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.
alg
is an AEAD algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 842 of file crypto_values.h.
◆ PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER #define PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER ( alg ) Value:#define PSA_ALG_AEAD_FROM_BLOCK_FLAG
#define PSA_ALG_CATEGORY_MASK
#define PSA_ALG_CATEGORY_AEAD
Whether the specified algorithm is an AEAD mode on a block cipher.
alg
is an AEAD algorithm which is an AEAD mode based on a block cipher, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 1256 of file crypto_values.h.
◆ PSA_ALG_IS_ANY_HKDF #define PSA_ALG_IS_ANY_HKDF ( alg ) Value:#define PSA_ALG_HKDF_EXPAND_BASE
#define PSA_ALG_HKDF_BASE
#define PSA_ALG_HASH_MASK
#define PSA_ALG_HKDF_EXTRACT_BASE
Whether the specified algorithm is an HKDF or HKDF-Extract or HKDF-Expand algorithm.
alg
is any HKDF type algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key derivation algorithm identifier.
Definition at line 1939 of file crypto_values.h.
◆ PSA_ALG_IS_ASYMMETRIC_ENCRYPTIONWhether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.
alg
is an asymmetric encryption algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 866 of file crypto_values.h.
◆ PSA_ALG_IS_BLOCK_CIPHER_MAC #define PSA_ALG_IS_BLOCK_CIPHER_MAC ( alg ) Value:#define PSA_ALG_MAC_SUBCATEGORY_MASK
#define PSA_ALG_CIPHER_MAC_BASE
Whether the specified algorithm is a MAC algorithm based on a block cipher.
alg
is a MAC algorithm based on a block cipher, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 1149 of file crypto_values.h.
◆ PSA_ALG_IS_CIPHERWhether the specified algorithm is a symmetric cipher algorithm.
alg
is a symmetric cipher algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 830 of file crypto_values.h.
◆ PSA_ALG_IS_DETERMINISTIC_DSA ◆ PSA_ALG_IS_DETERMINISTIC_ECDSA ◆ PSA_ALG_IS_DSA #define PSA_ALG_IS_DSA ( alg ) Value:PSA_ALG_DSA_BASE)
#define PSA_ALG_DSA_DETERMINISTIC_FLAG
Definition at line 406 of file crypto_extra.h.
◆ PSA_ALG_IS_ECDHWhether the specified algorithm is an elliptic curve Diffie-Hellman algorithm.
This includes the raw elliptic curve Diffie-Hellman algorithm as well as elliptic curve Diffie-Hellman followed by any supporter key derivation algorithm.
alg
is an elliptic curve Diffie-Hellman algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key agreement algorithm identifier.
Definition at line 2249 of file crypto_values.h.
◆ PSA_ALG_IS_ECDSA #define PSA_ALG_IS_ECDSA ( alg ) Value:PSA_ALG_ECDSA_BASE)
#define PSA_ALG_ECDSA_DETERMINISTIC_FLAG
Definition at line 1571 of file crypto_values.h.
◆ PSA_ALG_IS_FFDHWhether the specified algorithm is a finite field Diffie-Hellman algorithm.
This includes the raw finite field Diffie-Hellman algorithm as well as finite-field Diffie-Hellman followed by any supporter key derivation algorithm.
alg
is a finite field Diffie-Hellman algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key agreement algorithm identifier.
Definition at line 2205 of file crypto_values.h.
◆ PSA_ALG_IS_HASHWhether the specified algorithm is a hash algorithm.
alg
is a hash algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 808 of file crypto_values.h.
◆ PSA_ALG_IS_HASH_AND_SIGN #define PSA_ALG_IS_HASH_AND_SIGN ( alg ) Value:#define PSA_ALG_IS_SIGN_HASH(alg)
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_hash() and ps...
Whether the specified algorithm is a hash-and-sign algorithm.
Hash-and-sign algorithms are asymmetric (public-key) signature algorithms structured in two parts: first the calculation of a hash in a way that does not depend on the key, then the calculation of a signature from the hash value and the key. Hash-and-sign algorithms encode the hash used for the hashing step, and you can call PSA_ALG_SIGN_GET_HASH to extract this algorithm.
Thus, for a hash-and-sign algorithm, `psa_sign_message(key, alg, input, ...)` is equivalent to ``` psa_hash_compute(PSA_ALG_SIGN_GET_HASH(alg), input, ..., hash, ...); psa_sign_hash(key, alg, hash, ..., signature, ...); ``` Most usefully, separating the hash from the signature allows the hash to be calculated in multiple steps with psa_hash_setup(), psa_hash_update() and psa_hash_finish(). Likewise psa_verify_message() is equivalent to calculating the hash and then calling psa_verify_hash().
alg
is a hash-and-sign algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 1731 of file crypto_values.h.
◆ PSA_ALG_IS_HASH_EDDSA ◆ PSA_ALG_IS_HKDFWhether the specified algorithm is an HKDF algorithm.
HKDF is a family of key derivation algorithms that are based on a hash function and the HMAC construction.
alg
is an HKDF algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key derivation algorithm identifier.
Definition at line 1833 of file crypto_values.h.
◆ PSA_ALG_IS_HKDF_EXPANDWhether the specified algorithm is an HKDF-Expand algorithm.
HKDF-Expand is a family of key derivation algorithms that are based on a hash function and the HMAC construction.
alg
is an HKDF-Expand algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key derivation algorithm identifier.
Definition at line 1926 of file crypto_values.h.
◆ PSA_ALG_IS_HKDF_EXTRACTWhether the specified algorithm is an HKDF-Extract algorithm.
HKDF-Extract is a family of key derivation algorithms that are based on a hash function and the HMAC construction.
alg
is an HKDF-Extract algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key derivation algorithm identifier.
Definition at line 1884 of file crypto_values.h.
◆ PSA_ALG_IS_HMAC #define PSA_ALG_IS_HMAC ( alg ) Value:#define PSA_ALG_HMAC_BASE
Whether the specified algorithm is an HMAC algorithm.
HMAC is a family of MAC algorithms that are based on a hash function.
alg
is an HMAC algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 1013 of file crypto_values.h.
◆ PSA_ALG_IS_KEY_AGREEMENTWhether the specified algorithm is a key agreement algorithm.
alg
is a key agreement algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 877 of file crypto_values.h.
◆ PSA_ALG_IS_KEY_DERIVATIONWhether the specified algorithm is a key derivation algorithm.
alg
is a key derivation algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 888 of file crypto_values.h.
◆ PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENT ◆ PSA_ALG_IS_KEY_DERIVATION_STRETCHING #define PSA_ALG_IS_KEY_DERIVATION_STRETCHING ( alg ) Value:#define PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG
#define PSA_ALG_IS_KEY_DERIVATION(alg)
Whether the specified algorithm is a key derivation algorithm.
Whether the specified algorithm is a key stretching / password hashing algorithm.
A key stretching / password hashing algorithm is a key derivation algorithm that is suitable for use with a low-entropy secret such as a password. Equivalently, it's a key derivation algorithm that uses a PSA_KEY_DERIVATION_INPUT_PASSWORD input step.
alg
is a key stretching / password hashing algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 905 of file crypto_values.h.
◆ PSA_ALG_IS_MACWhether the specified algorithm is a MAC algorithm.
alg
is a MAC algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 819 of file crypto_values.h.
◆ PSA_ALG_IS_PAKEWhether the specified algorithm is a password-authenticated key exchange.
alg
is a password-authenticated key exchange (PAKE) algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 630 of file crypto_extra.h.
◆ PSA_ALG_IS_PBKDF2 #define PSA_ALG_IS_PBKDF2 ( kdf_alg ) Value:#define PSA_ALG_IS_PBKDF2_HMAC(alg)
Whether the specified algorithm is a PBKDF2-HMAC algorithm.
#define PSA_ALG_PBKDF2_AES_CMAC_PRF_128
The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.
Definition at line 2133 of file crypto_values.h.
◆ PSA_ALG_IS_PBKDF2_HMACWhether the specified algorithm is a PBKDF2-HMAC algorithm.
alg
is a PBKDF2-HMAC algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key derivation algorithm identifier.
Definition at line 2118 of file crypto_values.h.
◆ PSA_ALG_IS_RANDOMIZED_DSA ◆ PSA_ALG_IS_RANDOMIZED_ECDSA ◆ PSA_ALG_IS_RAW_KEY_AGREEMENT #define PSA_ALG_IS_RAW_KEY_AGREEMENT ( alg ) Value:#define PSA_ALG_IS_KEY_AGREEMENT(alg)
Whether the specified algorithm is a key agreement algorithm.
#define PSA_ALG_CATEGORY_KEY_DERIVATION
Whether the specified algorithm is a raw key agreement algorithm.
A raw key agreement algorithm is one that does not specify a key derivation function. Usually, raw key agreement algorithms are constructed directly with a PSA_ALG_xxx
macro while non-raw key agreement algorithms are constructed with PSA_ALG_KEY_AGREEMENT().
alg
is a raw key agreement algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 2177 of file crypto_values.h.
◆ PSA_ALG_IS_RSA_OAEP ◆ PSA_ALG_IS_RSA_PKCS1V15_SIGN ◆ PSA_ALG_IS_RSA_PSS #define PSA_ALG_IS_RSA_PSS ( alg ) Value:PSA_ALG_IS_RSA_PSS_ANY_SALT(alg))
#define PSA_ALG_IS_RSA_PSS_STANDARD_SALT(alg)
Whether the specified algorithm is RSA PSS with standard salt.
Whether the specified algorithm is RSA PSS.
This includes any of the RSA PSS algorithm variants, regardless of the constraints on salt length.
alg
is of the form PSA_ALG_RSA_PSS(hash_alg
) or PSA_ALG_RSA_PSS_ANY_SALT_BASE(hash_alg
), where hash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier or policy.
Definition at line 1508 of file crypto_values.h.
◆ PSA_ALG_IS_RSA_PSS_ANY_SALTWhether the specified algorithm is RSA PSS with any salt.
alg
is of the form PSA_ALG_RSA_PSS_ANY_SALT_BASE(hash_alg
), where hash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier or policy.
Definition at line 1490 of file crypto_values.h.
◆ PSA_ALG_IS_RSA_PSS_STANDARD_SALTWhether the specified algorithm is RSA PSS with standard salt.
alg
is of the form PSA_ALG_RSA_PSS(hash_alg
), where hash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier or policy.
Definition at line 1476 of file crypto_values.h.
◆ PSA_ALG_IS_SIGNWhether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.
alg
is an asymmetric signature algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 854 of file crypto_values.h.
◆ PSA_ALG_IS_SIGN_HASH #define PSA_ALG_IS_SIGN_HASH ( alg ) Value:PSA_ALG_IS_VENDOR_HASH_AND_SIGN(alg))
#define PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg)
#define PSA_ALG_IS_HASH_EDDSA(alg)
#define PSA_ALG_IS_RSA_PSS(alg)
Whether the specified algorithm is RSA PSS.
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_hash() and psa_verify_hash().
This encompasses all strict hash-and-sign algorithms categorized by PSA_ALG_IS_HASH_AND_SIGN(), as well as algorithms that follow the paradigm more loosely:
Definition at line 1686 of file crypto_values.h.
◆ PSA_ALG_IS_SIGN_MESSAGEWhether the specified algorithm is a signature algorithm that can be used with psa_sign_message() and psa_verify_message().
alg
is a signature algorithm that can only be used to sign an already-calculated hash. 0 if alg
is not a signature algorithm. This macro can return either 0 or 1 if alg
is not a supported algorithm identifier.
Definition at line 1702 of file crypto_values.h.
◆ PSA_ALG_IS_STREAM_CIPHER #define PSA_ALG_IS_STREAM_CIPHER ( alg ) Value:#define PSA_ALG_CATEGORY_CIPHER
#define PSA_ALG_CIPHER_STREAM_FLAG
Whether the specified algorithm is a stream cipher.
A stream cipher is a symmetric cipher that encrypts or decrypts messages by applying a bitwise-xor with a stream of bytes that is generated from a key.
alg
is a stream cipher algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported algorithm identifier or if it is not a symmetric cipher algorithm.
Definition at line 1168 of file crypto_values.h.
◆ PSA_ALG_IS_TLS12_PRFWhether the specified algorithm is a TLS-1.2 PRF algorithm.
alg
is a TLS-1.2 PRF algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key derivation algorithm identifier.
Definition at line 1982 of file crypto_values.h.
◆ PSA_ALG_IS_TLS12_PSK_TO_MSWhether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
alg
is a TLS-1.2 PSK to MS algorithm, 0 otherwise. This macro may return either 0 or 1 if alg
is not a supported key derivation algorithm identifier.
Definition at line 2052 of file crypto_values.h.
◆ PSA_ALG_IS_VENDOR_DEFINED ◆ PSA_ALG_IS_VENDOR_HASH_AND_SIGN [1/2] ◆ PSA_ALG_IS_VENDOR_HASH_AND_SIGN [2/2] #define PSA_ALG_IS_VENDOR_HASH_AND_SIGN ( alg ) 0Definition at line 1667 of file crypto_values.h.
◆ PSA_ALG_IS_WILDCARD #define PSA_ALG_IS_WILDCARD ( alg ) Value:PSA_ALG_IS_MAC(alg) ? \
#define PSA_ALG_IS_AEAD(alg)
Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.
#define PSA_ALG_ANY_HASH
In a hash-and-sign algorithm policy, allow any hash algorithm.
#define PSA_ALG_IS_HASH_AND_SIGN(alg)
Whether the specified algorithm is a hash-and-sign algorithm.
Whether the specified algorithm encoding is a wildcard.
Wildcard values may only be used to set the usage algorithm field in a policy, not to perform an operation.
alg
is a wildcard algorithm encoding.
alg
is a non-wildcard algorithm encoding (suitable for an operation).
alg
is not a supported algorithm identifier.
Definition at line 2265 of file crypto_values.h.
◆ PSA_ALG_JPAKEThe Password-authenticated key exchange by juggling (J-PAKE) algorithm.
This is J-PAKE as defined by RFC 8236, instantiated with the following parameters:
To select these parameters and set up the cipher suite, call these functions in any order:
#define PSA_ALG_JPAKE
The Password-authenticated key exchange by juggling (J-PAKE) algorithm.
static void psa_pake_cs_set_hash(psa_pake_cipher_suite_t *cipher_suite, psa_algorithm_t hash)
Declare the hash algorithm for a PAKE cipher suite.
static void psa_pake_cs_set_primitive(psa_pake_cipher_suite_t *cipher_suite, psa_pake_primitive_t primitive)
Declare the primitive for a PAKE cipher suite.
static void psa_pake_cs_set_algorithm(psa_pake_cipher_suite_t *cipher_suite, psa_algorithm_t algorithm)
Declare the PAKE algorithm for the cipher suite.
#define PSA_PAKE_PRIMITIVE(pake_type, pake_family, pake_bits)
Construct a PAKE primitive from type, family and bit-size.
For more information on how to set a specific curve or field, refer to the documentation of the individual PSA_PAKE_PRIMITIVE_TYPE_XXX
constants.
After initializing a J-PAKE operation, call
operation
Bit operations.
psa_status_t psa_pake_set_password_key(psa_pake_operation_t *operation, mbedtls_svc_key_id_t password)
Set the password for a password-authenticated key exchange from key ID.
psa_status_t psa_pake_setup(psa_pake_operation_t *operation, const psa_pake_cipher_suite_t *cipher_suite)
Set the session information for a password-authenticated key exchange.
psa_status_t psa_pake_set_user(psa_pake_operation_t *operation, const uint8_t *user_id, size_t user_id_len)
Set the user ID for a password-authenticated key exchange.
psa_status_t psa_pake_set_peer(psa_pake_operation_t *operation, const uint8_t *peer_id, size_t peer_id_len)
Set the peer ID for a password-authenticated key exchange.
The password is provided as a key. This can be the password text itself, in an agreed character encoding, or some value derived from the password as required by a higher level protocol.
(The implementation converts the key material to a number as described in Section 2.3.8 of _SEC 1: Elliptic Curve Cryptography_ (https://www.secg.org/sec1-v2.pdf), before reducing it modulo q
. Here q
is order of the group defined by the primitive set in the cipher suite. The psa_pake_set_password_key()
function returns an error if the result of the reduction is 0.)
The key exchange flow for J-PAKE is as follows:
#define PSA_PAKE_STEP_KEY_SHARE
The key share being sent to or received from the peer.
psa_status_t psa_pake_output(psa_pake_operation_t *operation, psa_pake_step_t step, uint8_t *output, size_t output_size, size_t *output_length)
Get output for a step of a password-authenticated key exchange.
#define PSA_PAKE_STEP_ZK_PROOF
A Schnorr NIZKP proof.
#define PSA_PAKE_STEP_ZK_PUBLIC
A Schnorr NIZKP public key.
psa_status_t psa_pake_input(psa_pake_operation_t *operation, psa_pake_step_t step, const uint8_t *input, size_t input_length)
Provide input for a step of a password-authenticated key exchange.
psa_status_t psa_pake_get_implicit_key(psa_pake_operation_t *operation, psa_key_derivation_operation_t *output)
Get implicitly confirmed shared secret from a PAKE.
For more information consult the documentation of the individual PSA_PAKE_STEP_XXX
constants.
At this point there is a cryptographic guarantee that only the authenticated party who used the same password is able to compute the key. But there is no guarantee that the peer is the party it claims to be and was able to do so.
That is, the authentication is only implicit (the peer is not authenticated at this point, and no action should be taken that assume that they are - like for example accessing restricted files).
To make the authentication explicit there are various methods, see Section 5 of RFC 8236 for two examples.
Definition at line 748 of file crypto_extra.h.
◆ PSA_ALG_KEY_AGREEMENT #define PSA_ALG_KEY_AGREEMENT ( ka_alg, kdf_alg ) ((ka_alg) | (kdf_alg))Macro to build a combined algorithm that chains a key agreement with a key derivation.
ka_alg
is not a supported key agreement algorithm or kdf_alg
is not a supported key derivation algorithm.
Definition at line 2154 of file crypto_values.h.
◆ PSA_ALG_KEY_AGREEMENT_GET_BASE ◆ PSA_ALG_KEY_AGREEMENT_GET_KDF ◆ PSA_ALG_KEY_AGREEMENT_MASK ◆ PSA_ALG_KEY_DERIVATION_MASK ◆ PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG ◆ PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG ◆ PSA_ALG_MAC_SUBCATEGORY_MASK ◆ PSA_ALG_MAC_TRUNCATION_MASK ◆ PSA_ALG_MD5 ◆ PSA_ALG_NONE ◆ PSA_ALG_OFBThe OFB stream cipher mode.
The underlying block cipher is determined by the key type.
Definition at line 1198 of file crypto_values.h.
◆ PSA_ALG_PBKDF2_AES_CMAC_PRF_128The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.
PBKDF2 is defined by PKCS#5, republished as RFC 8018 (section 5.2). This macro specifies the PBKDF2 algorithm constructed using the AES-CMAC-PRF-128 PRF specified by RFC 4615.
This key derivation algorithm uses the same inputs as PSA_ALG_PBKDF2_HMAC() with the same constraints.
Definition at line 2131 of file crypto_values.h.
◆ PSA_ALG_PBKDF2_HMACMacro to build a PBKDF2-HMAC password hashing / key stretching algorithm.
PBKDF2 is defined by PKCS#5, republished as RFC 8018 (section 5.2). This macro specifies the PBKDF2 algorithm constructed using a PRF based on HMAC with the specified hash. For example, `PSA_ALG_PBKDF2_HMAC(PSA_ALG_SHA_256)` specifies PBKDF2 using the PRF HMAC-SHA-256.
This key derivation algorithm uses the following inputs, which must be provided in the following order:
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true).
hash_alg
is not a supported hash algorithm.
Definition at line 2107 of file crypto_values.h.
◆ PSA_ALG_PBKDF2_HMAC_BASE ◆ PSA_ALG_PBKDF2_HMAC_GET_HASH ◆ PSA_ALG_PURE_EDDSAEdwards-curve digital signature algorithm without prehashing (PureEdDSA), using standard parameters.
Contexts are not supported in the current version of this specification because there is no suitable signature interface that can take the context as a parameter. A future version of this specification may add suitable functions and extend this algorithm to support contexts.
PureEdDSA requires an elliptic curve key on a twisted Edwards curve. In this specification, the following curves are supported:
This algorithm can be used with psa_sign_message() and psa_verify_message(). Since there is no prehashing, it cannot be used with psa_sign_hash() or psa_verify_hash().
The signature format is the concatenation of R and S as defined by RFC 8032 §5.1.6 and §5.2.6 (a 64-byte string for Ed25519, a 114-byte string for Ed448).
Definition at line 1609 of file crypto_values.h.
◆ PSA_ALG_RIPEMD160 ◆ PSA_ALG_RSA_OAEPRSA OAEP encryption.
This is the encryption scheme defined by RFC 8017 (PKCS#1: RSA Cryptography Specifications) under the name RSAES-OAEP, with the message generation function MGF1.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true) to use for MGF1.
hash_alg
is not a supported hash algorithm.
Definition at line 1784 of file crypto_values.h.
◆ PSA_ALG_RSA_OAEP_BASE ◆ PSA_ALG_RSA_OAEP_GET_HASH #define PSA_ALG_RSA_OAEP_GET_HASH ( alg ) Value:0)
#define PSA_ALG_IS_RSA_OAEP(alg)
#define PSA_ALG_CATEGORY_HASH
Definition at line 1788 of file crypto_values.h.
◆ PSA_ALG_RSA_PKCS1V15_CRYPTRSA PKCS#1 v1.5 encryption.
Definition at line 1767 of file crypto_values.h.
◆ PSA_ALG_RSA_PKCS1V15_SIGNRSA PKCS#1 v1.5 signature with hashing.
This is the signature scheme defined by RFC 8017 (PKCS#1: RSA Cryptography Specifications) under the name RSASSA-PKCS1-v1_5.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true). This includes PSA_ALG_ANY_HASH when specifying the algorithm in a usage policy.
hash_alg
is not a supported hash algorithm.
Definition at line 1410 of file crypto_values.h.
◆ PSA_ALG_RSA_PKCS1V15_SIGN_BASE ◆ PSA_ALG_RSA_PKCS1V15_SIGN_RAWRaw PKCS#1 v1.5 signature.
The input to this algorithm is the DigestInfo structure used by RFC 8017 (PKCS#1: RSA Cryptography Specifications), §9.2 steps 3–6.
Definition at line 1418 of file crypto_values.h.
◆ PSA_ALG_RSA_PSSRSA PSS signature with hashing.
This is the signature scheme defined by RFC 8017 (PKCS#1: RSA Cryptography Specifications) under the name RSASSA-PSS, with the message generation function MGF1, and with a salt length equal to the length of the hash, or the largest possible salt length for the algorithm and key size if that is smaller than the hash length. The specified hash algorithm is used to hash the input message, to create the salted hash, and for the mask generation.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true). This includes PSA_ALG_ANY_HASH when specifying the algorithm in a usage policy.
hash_alg
is not a supported hash algorithm.
Definition at line 1444 of file crypto_values.h.
◆ PSA_ALG_RSA_PSS_ANY_SALTRSA PSS signature with hashing with relaxed verification.
This algorithm has the same behavior as PSA_ALG_RSA_PSS when signing, but allows an arbitrary salt length (including 0
) when verifying a signature.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true). This includes PSA_ALG_ANY_HASH when specifying the algorithm in a usage policy.
hash_alg
is not a supported hash algorithm.
Definition at line 1462 of file crypto_values.h.
◆ PSA_ALG_RSA_PSS_ANY_SALT_BASE ◆ PSA_ALG_RSA_PSS_BASE ◆ PSA_ALG_SHA3_224 ◆ PSA_ALG_SHA3_256 ◆ PSA_ALG_SHA3_384 ◆ PSA_ALG_SHA3_512 ◆ PSA_ALG_SHA_1 ◆ PSA_ALG_SHA_224 ◆ PSA_ALG_SHA_256 ◆ PSA_ALG_SHA_384 ◆ PSA_ALG_SHA_512 ◆ PSA_ALG_SHA_512_224 ◆ PSA_ALG_SHA_512_256 ◆ PSA_ALG_SHAKE256_512The first 512 bits (64 bytes) of the SHAKE256 output.
This is the prehashing for Ed448ph (see PSA_ALG_ED448PH). For other scenarios where a hash function based on SHA3/SHAKE is desired, SHA3-512 has the same output size and a (theoretically) higher security strength.
Definition at line 947 of file crypto_values.h.
◆ PSA_ALG_SIGN_GET_HASH #define PSA_ALG_SIGN_GET_HASH ( alg ) Value:Get the hash used by a hash-and-sign signature algorithm.
A hash-and-sign algorithm is a signature algorithm which is composed of two phases: first a hashing phase which does not use the key and produces a hash of the input message, then a signing phase which only uses the hash and the key and not the message itself.
PSA_ALG_XXX
value such that PSA_ALG_IS_SIGN(alg
) is true).
alg
is a hash-and-sign algorithm.
alg
is a signature algorithm that does not follow the hash-and-sign structure.
alg
is not a signature algorithm or if it is not supported by the implementation.
Definition at line 1753 of file crypto_values.h.
◆ PSA_ALG_STREAM_CIPHERThe stream cipher mode of a stream cipher algorithm.
The underlying stream cipher is determined by the key type.
Definition at line 1177 of file crypto_values.h.
◆ PSA_ALG_TLS12_ECJPAKE_TO_PMS ◆ PSA_ALG_TLS12_PRFMacro to build a TLS-1.2 PRF algorithm.
TLS 1.2 uses a custom pseudorandom function (PRF) for key schedule, specified in Section 5 of RFC 5246. It is based on HMAC and can be used with either SHA-256 or SHA-384.
This key derivation algorithm uses the following inputs, which must be passed in the order given here:
For the application to TLS-1.2 key expansion, the seed is the concatenation of ServerHello.Random + ClientHello.Random, and the label is "key expansion".
For example, `PSA_ALG_TLS12_PRF(PSA_ALG_SHA_256)` represents the TLS 1.2 PRF using HMAC-SHA-256.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true).
hash_alg
is not a supported hash algorithm.
Definition at line 1971 of file crypto_values.h.
◆ PSA_ALG_TLS12_PRF_BASE ◆ PSA_ALG_TLS12_PRF_GET_HASH ◆ PSA_ALG_TLS12_PSK_TO_MSMacro to build a TLS-1.2 PSK-to-MasterSecret algorithm.
In a pure-PSK handshake in TLS 1.2, the master secret is derived from the PreSharedKey (PSK) through the application of padding (RFC 4279, Section 2) and the TLS-1.2 PRF (RFC 5246, Section 5). The latter is based on HMAC and can be used with either SHA-256 or SHA-384.
This key derivation algorithm uses the following inputs, which must be passed in the order given here:
For the application to TLS-1.2, the seed (which is forwarded to the TLS-1.2 PRF) is the concatenation of the ClientHello.Random + ServerHello.Random, the label is "master secret" or "extended master secret" and the other secret depends on the key exchange specified in the cipher suite:
For example, `PSA_ALG_TLS12_PSK_TO_MS(PSA_ALG_SHA_256)` represents the TLS-1.2 PSK to MasterSecret derivation PRF using HMAC-SHA-256.
PSA_ALG_XXX
value such that PSA_ALG_IS_HASH(hash_alg
) is true).
hash_alg
is not a supported hash algorithm.
Definition at line 2041 of file crypto_values.h.
◆ PSA_ALG_TLS12_PSK_TO_MS_BASE ◆ PSA_ALG_TLS12_PSK_TO_MS_GET_HASH ◆ PSA_ALG_TRUNCATED_MAC #define PSA_ALG_TRUNCATED_MAC ( mac_alg, mac_length ) Value:#define PSA_MAC_TRUNCATION_OFFSET
Macro to build a truncated MAC algorithm.
A truncated MAC algorithm is identical to the corresponding MAC algorithm except that the MAC value for the truncated algorithm consists of only the first mac_length
bytes of the MAC value for the untruncated algorithm.
mac_alg
) is true). This may be a truncated or untruncated MAC algorithm. mac_length Desired length of the truncated MAC in bytes. This must be at most the full length of the MAC and must be at least an implementation-specified minimum. The implementation-specified minimum shall not be zero.
mac_alg
is not a supported MAC algorithm or if mac_length
is too small or too large for the specified MAC algorithm.
Definition at line 1068 of file crypto_values.h.
◆ PSA_ALG_VENDOR_FLAGVendor-defined algorithm flag.
Algorithms defined by this standard will never have the PSA_ALG_VENDOR_FLAG bit set. Vendors who define additional algorithms must use an encoding with the PSA_ALG_VENDOR_FLAG bit set and should respect the bitwise structure used by standard encodings whenever practical.
Definition at line 781 of file crypto_values.h.
◆ PSA_ALG_XTSThe XTS cipher mode.
XTS is a cipher mode which is built from a block cipher. It requires at least one full block of input, but beyond this minimum the input does not need to be a whole number of blocks.
Definition at line 1206 of file crypto_values.h.
◆ PSA_BLOCK_CIPHER_BLOCK_LENGTH #define PSA_BLOCK_CIPHER_BLOCK_LENGTH ( type ) Value:0u)
#define PSA_KEY_TYPE_CATEGORY_MASK
#define PSA_KEY_TYPE_CATEGORY_SYMMETRIC
#define PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT(type)
The block size of a block cipher.
type
is not a supported cipher key type.
Definition at line 764 of file crypto_values.h.
◆ PSA_DH_FAMILY_RFC7919Diffie-Hellman groups defined in RFC 7919 Appendix A.
This family includes groups with the following key sizes (in bits): 2048, 3072, 4096, 6144, 8192. A given implementation may support all of these sizes or only a subset.
Definition at line 742 of file crypto_values.h.
◆ PSA_ECC_FAMILY_BRAINPOOL_P_R1Brainpool P random curves.
This family comprises the following curves: brainpoolP160r1, brainpoolP192r1, brainpoolP224r1, brainpoolP256r1, brainpoolP320r1, brainpoolP384r1, brainpoolP512r1. It is defined in RFC 5639.
Definition at line 667 of file crypto_values.h.
◆ PSA_ECC_FAMILY_IS_WEIERSTRASS #define PSA_ECC_FAMILY_IS_WEIERSTRASS ( family ) ((family & 0xc0) == 0) ◆ PSA_ECC_FAMILY_MONTGOMERYCurve25519 and Curve448.
This family comprises the following Montgomery curves:
Definition at line 679 of file crypto_values.h.
◆ PSA_ECC_FAMILY_SECP_K1SEC Koblitz curves over prime fields.
This family comprises the following curves: secp192k1, secp224k1, secp256k1. They are defined in _Standards for Efficient Cryptography_, _SEC 2: Recommended Elliptic Curve Domain Parameters_. https://www.secg.org/sec2-v2.pdf
Definition at line 607 of file crypto_values.h.
◆ PSA_ECC_FAMILY_SECP_R1SEC random curves over prime fields.
This family comprises the following curves: secp192r1, secp224r1, secp256r1, secp384r1, secp521r1. They are defined in _Standards for Efficient Cryptography_, _SEC 2: Recommended Elliptic Curve Domain Parameters_. https://www.secg.org/sec2-v2.pdf
Definition at line 617 of file crypto_values.h.
◆ PSA_ECC_FAMILY_SECP_R2 ◆ PSA_ECC_FAMILY_SECT_K1SEC Koblitz curves over binary fields.
This family comprises the following curves: sect163k1, sect233k1, sect239k1, sect283k1, sect409k1, sect571k1. They are defined in _Standards for Efficient Cryptography_, _SEC 2: Recommended Elliptic Curve Domain Parameters_. https://www.secg.org/sec2-v2.pdf
Definition at line 631 of file crypto_values.h.
◆ PSA_ECC_FAMILY_SECT_R1SEC random curves over binary fields.
This family comprises the following curves: sect163r1, sect233r1, sect283r1, sect409r1, sect571r1. They are defined in _Standards for Efficient Cryptography_, _SEC 2: Recommended Elliptic Curve Domain Parameters_. https://www.secg.org/sec2-v2.pdf
Definition at line 643 of file crypto_values.h.
◆ PSA_ECC_FAMILY_SECT_R2SEC additional random curves over binary fields.
This family comprises the following curve: sect163r2. It is defined in _Standards for Efficient Cryptography_, _SEC 2: Recommended Elliptic Curve Domain Parameters_. https://www.secg.org/sec2-v2.pdf
Definition at line 655 of file crypto_values.h.
◆ PSA_ECC_FAMILY_TWISTED_EDWARDSThe twisted Edwards curves Ed25519 and Ed448.
These curves are suitable for EdDSA (PSA_ALG_PURE_EDDSA for both curves, PSA_ALG_ED25519PH for the 255-bit curve, PSA_ALG_ED448PH for the 448-bit curve).
This family comprises the following twisted Edwards curves:
Definition at line 697 of file crypto_values.h.
◆ PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT ◆ PSA_KEY_TYPE_AESKey for a cipher, AEAD or MAC algorithm based on the AES block cipher.
The size of the key can be 16 bytes (AES-128), 24 bytes (AES-192) or 32 bytes (AES-256).
Definition at line 499 of file crypto_values.h.
◆ PSA_KEY_TYPE_ARIAKey for a cipher, AEAD or MAC algorithm based on the ARIA block cipher.
Definition at line 503 of file crypto_values.h.
◆ PSA_KEY_TYPE_CAMELLIAKey for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.
Definition at line 518 of file crypto_values.h.
◆ PSA_KEY_TYPE_CATEGORY_FLAG_PAIR ◆ PSA_KEY_TYPE_CATEGORY_KEY_PAIR ◆ PSA_KEY_TYPE_CATEGORY_MASK ◆ PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY ◆ PSA_KEY_TYPE_CATEGORY_RAW ◆ PSA_KEY_TYPE_CATEGORY_SYMMETRIC ◆ PSA_KEY_TYPE_CHACHA20Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
ChaCha20 and the ChaCha20_Poly1305 construction are defined in RFC 7539.
Definition at line 531 of file crypto_values.h.
◆ PSA_KEY_TYPE_DERIVE ◆ PSA_KEY_TYPE_DESKey for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
The size of the key can be 64 bits (single DES), 128 bits (2-key 3DES) or 192 bits (3-key 3DES).
Note that single DES and 2-key 3DES are weak and strongly deprecated and should only be used to decrypt legacy data. 3-key 3DES is weak and deprecated and should only be used in legacy protocols.
Definition at line 514 of file crypto_values.h.
◆ PSA_KEY_TYPE_DH_GET_FAMILY #define PSA_KEY_TYPE_DH_GET_FAMILY ( type ) Value:0))
#define PSA_KEY_TYPE_DH_GROUP_MASK
#define PSA_KEY_TYPE_IS_DH(type)
Whether a key type is a Diffie-Hellman key (pair or public-only).
uint8_t psa_dh_family_t
The type of PSA Diffie-Hellman group family identifiers.
Extract the group from a Diffie-Hellman key type.
Definition at line 731 of file crypto_values.h.
◆ PSA_KEY_TYPE_DH_GROUP_MASK ◆ PSA_KEY_TYPE_DH_KEY_PAIRDiffie-Hellman key pair.
Definition at line 707 of file crypto_values.h.
◆ PSA_KEY_TYPE_DH_KEY_PAIR_BASE ◆ PSA_KEY_TYPE_DH_PUBLIC_KEYDiffie-Hellman public key.
Definition at line 714 of file crypto_values.h.
◆ PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE ◆ PSA_KEY_TYPE_DSA_KEY_PAIRDSA key pair (private and public key).
The import and export format is the representation of the private key `x` as a big-endian byte string. The length of the byte string is the private key size in bytes (leading zeroes are not stripped).
Deterministic DSA key derivation with psa_generate_derived_key follows FIPS 186-4 §B.1.2: interpret the byte string as integer in big-endian order. Discard it if it is not in the range [0, *N* - 2] where *N* is the boundary of the private key domain (the prime *p* for Diffie-Hellman, the subprime *q* for DSA, or the order of the curve's base point for ECC). Add 1 to the resulting integer and use this as the private key *x*.
Definition at line 365 of file crypto_extra.h.
◆ PSA_KEY_TYPE_DSA_PUBLIC_KEYDSA public key.
The import and export format is the representation of the public key `y = g^x mod p` as a big-endian byte string. The length of the byte string is the length of the base prime `p` in bytes.
Definition at line 347 of file crypto_extra.h.
◆ PSA_KEY_TYPE_ECC_CURVE_MASK ◆ PSA_KEY_TYPE_ECC_GET_FAMILY #define PSA_KEY_TYPE_ECC_GET_FAMILY ( type ) Value:0))
#define PSA_KEY_TYPE_IS_ECC(type)
Whether a key type is an elliptic curve key (pair or public-only).
#define PSA_KEY_TYPE_ECC_CURVE_MASK
uint8_t psa_ecc_family_t
The type of PSA elliptic curve family identifiers.
Extract the curve from an elliptic curve key type.
Definition at line 587 of file crypto_values.h.
◆ PSA_KEY_TYPE_ECC_KEY_PAIRElliptic curve key pair.
The size of an elliptic curve key is the bit size associated with the curve, i.e. the bit size of *q* for a curve over a field *Fq*. See the documentation of `PSA_ECC_FAMILY_xxx` curve families for details.
Definition at line 559 of file crypto_values.h.
◆ PSA_KEY_TYPE_ECC_KEY_PAIR_BASE ◆ PSA_KEY_TYPE_ECC_PUBLIC_KEYElliptic curve public key.
The size of an elliptic curve public key is the same as the corresponding private key (see PSA_KEY_TYPE_ECC_KEY_PAIR and the documentation of `PSA_ECC_FAMILY_xxx` curve families).
Definition at line 570 of file crypto_values.h.
◆ PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE ◆ PSA_KEY_TYPE_HMACHMAC key.
The key policy determines which underlying hash algorithm the key can be used for.
HMAC keys should generally have the same size as the underlying hash. This size can be calculated with PSA_HASH_LENGTH(alg
) where alg
is the HMAC algorithm or the underlying hash algorithm.
Definition at line 441 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_ASYMMETRIC #define PSA_KEY_TYPE_IS_ASYMMETRIC ( type ) Value:PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY)
#define PSA_KEY_TYPE_CATEGORY_FLAG_PAIR
Whether a key type is asymmetric: either a key pair or a public key.
Definition at line 391 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_DH #define PSA_KEY_TYPE_IS_DH ( type ) Value:#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE
#define PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR(type)
The public key type corresponding to a key pair type.
Whether a key type is a Diffie-Hellman key (pair or public-only).
Definition at line 718 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_DH_KEY_PAIR #define PSA_KEY_TYPE_IS_DH_KEY_PAIR ( type ) Value:PSA_KEY_TYPE_DH_KEY_PAIR_BASE)
Whether a key type is a Diffie-Hellman key pair.
Definition at line 722 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_DH_PUBLIC_KEY #define PSA_KEY_TYPE_IS_DH_PUBLIC_KEY ( type ) Value:PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE)
Whether a key type is a Diffie-Hellman public key.
Definition at line 726 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_DSAWhether a key type is a DSA key (pair or public-only).
Definition at line 368 of file crypto_extra.h.
◆ PSA_KEY_TYPE_IS_ECC #define PSA_KEY_TYPE_IS_ECC ( type ) Value:#define PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE
Whether a key type is an elliptic curve key (pair or public-only).
Definition at line 574 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_ECC_KEY_PAIR #define PSA_KEY_TYPE_IS_ECC_KEY_PAIR ( type ) Value:PSA_KEY_TYPE_ECC_KEY_PAIR_BASE)
Whether a key type is an elliptic curve key pair.
Definition at line 578 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY #define PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY ( type ) Value:PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE)
Whether a key type is an elliptic curve public key.
Definition at line 582 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_KEY_PAIRWhether a key type is a key pair containing a private part and a public part.
Definition at line 400 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_PUBLIC_KEYWhether a key type is the public part of a key pair.
Definition at line 396 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_RSAWhether a key type is an RSA key (pair or public-only).
Definition at line 544 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_UNSTRUCTURED #define PSA_KEY_TYPE_IS_UNSTRUCTURED ( type ) Value:#define PSA_KEY_TYPE_CATEGORY_RAW
Whether a key type is an unstructured array of bytes.
This encompasses both symmetric keys and non-key data.
Definition at line 386 of file crypto_values.h.
◆ PSA_KEY_TYPE_IS_VENDOR_DEFINED ◆ PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEYThe key pair type corresponding to a public key type.
You may also pass a key pair type as type
, it will be left unchanged.
type
is not a public key or a key pair, the return value is undefined.
Definition at line 412 of file crypto_values.h.
◆ PSA_KEY_TYPE_NONEAn invalid key type value.
Zero is not the encoding of any key type.
Definition at line 356 of file crypto_values.h.
◆ PSA_KEY_TYPE_PASSWORDA low-entropy secret for password hashing or key derivation.
This key type is suitable for passwords and passphrases which are typically intended to be memorizable by humans, and have a low entropy relative to their size. It can be used for randomly generated or derived keys with maximum or near-maximum entropy, but PSA_KEY_TYPE_DERIVE is more suitable for such keys. It is not suitable for passwords with extremely low entropy, such as numerical PINs.
These keys can be used as the PSA_KEY_DERIVATION_INPUT_PASSWORD input of key derivation algorithms. Algorithms that accept such an input were designed to accept low-entropy secret and are known as password hashing or key stretching algorithms.
These keys cannot be used as the PSA_KEY_DERIVATION_INPUT_SECRET input of key derivation algorithms, as the algorithms that take such an input expect it to be high-entropy.
The key policy determines which key derivation algorithm the key can be used for, among the permissible subset defined above.
Definition at line 477 of file crypto_values.h.
◆ PSA_KEY_TYPE_PASSWORD_HASHA secret value that can be used to verify a password hash.
The key policy determines which key derivation algorithm the key can be used for, among the same permissible subset as for PSA_KEY_TYPE_PASSWORD.
Definition at line 485 of file crypto_values.h.
◆ PSA_KEY_TYPE_PEPPERA secret value that can be used in when computing a password hash.
The key policy determines which key derivation algorithm the key can be used for, among the subset of algorithms that can use pepper.
Definition at line 492 of file crypto_values.h.
◆ PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIRThe public key type corresponding to a key pair type.
You may also pass a public key type as type
, it will be left unchanged.
type
is not a public key or a key pair, the return value is undefined.
Definition at line 424 of file crypto_values.h.
◆ PSA_KEY_TYPE_RAW_DATARaw data.
A "key" of this type cannot be used for any cryptographic operation. Applications may use this type to store arbitrary data in the keystore.
Definition at line 431 of file crypto_values.h.
◆ PSA_KEY_TYPE_RSA_KEY_PAIRRSA key pair (private and public key).
The size of an RSA key is the bit size of the modulus.
Definition at line 542 of file crypto_values.h.
◆ PSA_KEY_TYPE_RSA_PUBLIC_KEYRSA public key.
The size of an RSA key is the bit size of the modulus.
Definition at line 537 of file crypto_values.h.
◆ PSA_KEY_TYPE_VENDOR_FLAGVendor-defined key type flag.
Key types defined by this standard will never have the PSA_KEY_TYPE_VENDOR_FLAG bit set. Vendors who define additional key types must use an encoding with the PSA_KEY_TYPE_VENDOR_FLAG bit set and should respect the bitwise structure used by standard encodings whenever practical.
Definition at line 365 of file crypto_values.h.
◆ PSA_MAC_TRUNCATED_LENGTHLength to which a MAC algorithm is truncated.
mac_alg
is a non-truncated MAC algorithm.
mac_alg
is not a supported MAC algorithm.
Definition at line 1100 of file crypto_values.h.
◆ PSA_MAC_TRUNCATION_OFFSET ◆ psa_algorithm_tEncoding 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.
Definition at line 134 of file crypto_types.h.
◆ psa_dh_family_tThe 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.
Definition at line 116 of file crypto_types.h.
◆ psa_ecc_family_tThe 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.
Definition at line 97 of file crypto_types.h.
◆ psa_key_type_tEncoding of a key type.
Values of this type are generally constructed by macros called `PSA_KEY_TYPE_xxx`.
Definition at line 78 of file crypto_types.h.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4