Key and algorithm types#
Typedefs#
Encoding of a key type.
The type of PSA elliptic curve family identifiers.
The type of PSA Diffie-Hellman group family identifiers.
Encoding of a cryptographic algorithm.
Encoding of a key type.
The type of PSA elliptic curve family identifiers.
The type of PSA Diffie-Hellman group family identifiers.
Encoding of a cryptographic algorithm.
Macros#
DSA public key.
DSA key pair (private and public key).
Whether a key type is an DSA key (pair or public-only).
DSA signature with hashing.
Deterministic DSA signature with hashing.
Whether the specified algorithm is a password-authenticated key exchange.
The Password-authenticated key exchange by juggling (J-PAKE) algorithm.
An invalid key type value.
Vendor-defined key type flag.
Whether a key type is vendor-defined.
Whether a key type is an unstructured array of bytes.
Whether a key type is asymmetric: either a key pair or a public key.
Whether a key type is the public part of a key pair.
Whether a key type is a key pair containing a private part and a public part.
The key pair type corresponding to a public key type.
The public key type corresponding to a key pair type.
Raw data.
HMAC key.
A secret for key derivation.
A low-entropy secret for password hashing or key derivation.
A secret value that can be used to verify a password hash.
A secret value that can be used in when computing a password hash.
Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
Key for a cipher, AEAD or MAC algorithm based on the ARIA block cipher.
Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.
Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
RSA public key.
RSA key pair (private and public key).
Whether a key type is an RSA key (pair or public-only).
Elliptic curve key pair.
Elliptic curve public key.
Whether a key type is an elliptic curve key (pair or public-only).
Whether a key type is an elliptic curve key pair.
Whether a key type is an elliptic curve public key.
Extract the curve from an elliptic curve key type.
Check if the curve of given family is Weierstrass elliptic curve.
SEC Koblitz curves over prime fields.
SEC random curves over prime fields.
SEC Koblitz curves over binary fields.
SEC random curves over binary fields.
SEC additional random curves over binary fields.
Brainpool P random curves.
Curve25519 and Curve448.
The twisted Edwards curves Ed25519 and Ed448.
Diffie-Hellman key pair.
Diffie-Hellman public key.
Whether a key type is a Diffie-Hellman key (pair or public-only).
Whether a key type is a Diffie-Hellman key pair.
Whether a key type is a Diffie-Hellman public key.
Extract the group from a Diffie-Hellman key type.
Diffie-Hellman groups defined in RFC 7919 Appendix A.
The block size of a block cipher.
Vendor-defined algorithm flag.
Whether an algorithm is vendor-defined.
Whether the specified algorithm is a hash algorithm.
Whether the specified algorithm is a MAC algorithm.
Whether the specified algorithm is a symmetric cipher algorithm.
Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.
Whether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.
Whether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.
Whether the specified algorithm is a key agreement algorithm.
Whether the specified algorithm is a key derivation algorithm.
Whether the specified algorithm is a key stretching / password hashing algorithm.
An invalid algorithm identifier value.
MD5.
PSA_ALG_RIPEMD160.
SHA1.
SHA2-224.
SHA2-256.
SHA2-384.
SHA2-512.
SHA2-512/224.
SHA2-512/256.
SHA3-224.
SHA3-256.
SHA3-384.
SHA3-512.
The first 512 bits (64 bytes) of the SHAKE256 output.
In a hash-and-sign algorithm policy, allow any hash algorithm.
Macro to build an HMAC algorithm.
Whether the specified algorithm is an HMAC algorithm.
Macro to build a truncated MAC algorithm.
Macro to build the base MAC algorithm corresponding to a truncated MAC algorithm.
Length to which a MAC algorithm is truncated.
Macro to build a MAC minimum-MAC-length wildcard algorithm.
The CBC-MAC construction over a block cipher.
The CMAC construction over a block cipher.
Whether the specified algorithm is a MAC algorithm based on a block cipher.
Whether the specified algorithm is a stream cipher.
The stream cipher mode of a stream cipher algorithm.
The CTR stream cipher mode.
The CFB stream cipher mode.
The OFB stream cipher mode.
The XTS cipher mode.
The Electronic Code Book (ECB) mode of a block cipher, with no padding.
The CBC block cipher chaining mode, with no padding.
The CBC block cipher chaining mode with PKCS#7 padding.
Whether the specified algorithm is an AEAD mode on a block cipher.
The CCM authenticated encryption algorithm.
The CCM* cipher mode without authentication.
The GCM authenticated encryption algorithm.
The Chacha20-Poly1305 AEAD algorithm.
Macro to build a shortened AEAD algorithm.
Retrieve the tag length of a specified AEAD algorithm.
Calculate the corresponding AEAD algorithm with the default tag length.
Macro to build an AEAD minimum-tag-length wildcard algorithm.
RSA PKCS#1 v1.5 signature with hashing.
Raw PKCS#1 v1.5 signature.
RSA PSS signature with hashing.
RSA PSS signature with hashing with relaxed verification.
Whether the specified algorithm is RSA PSS with standard salt.
Whether the specified algorithm is RSA PSS with any salt.
Whether the specified algorithm is RSA PSS.
ECDSA signature with hashing.
ECDSA signature without hashing.
Deterministic ECDSA signature with hashing.
Edwards-curve digital signature algorithm without prehashing (PureEdDSA), using standard parameters.
Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHA-512 and the Edwards25519 curve.
Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHAKE256 and the Edwards448 curve.
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_hash() and psa_verify_hash().
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_message() and psa_verify_message().
Whether the specified algorithm is a hash-and-sign algorithm.
Get the hash used by a hash-and-sign signature algorithm.
RSA PKCS#1 v1.5 encryption.
RSA OAEP encryption.
Macro to build an HKDF algorithm.
Whether the specified algorithm is an HKDF algorithm.
Macro to build an HKDF-Extract algorithm.
Whether the specified algorithm is an HKDF-Extract algorithm.
Macro to build an HKDF-Expand algorithm.
Whether the specified algorithm is an HKDF-Expand algorithm.
Whether the specified algorithm is an HKDF or HKDF-Extract or HKDF-Expand algorithm.
Macro to build a TLS-1.2 PRF algorithm.
Whether the specified algorithm is a TLS-1.2 PRF algorithm.
Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm.
Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm.
Whether the specified algorithm is a PBKDF2-HMAC algorithm.
The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.
Macro to build a combined algorithm that chains a key agreement with a key derivation.
Whether the specified algorithm is a raw key agreement algorithm.
The finite-field Diffie-Hellman (DH) key agreement algorithm.
Whether the specified algorithm is a finite field Diffie-Hellman algorithm.
The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.
Whether the specified algorithm is an elliptic curve Diffie-Hellman algorithm.
Whether the specified algorithm encoding is a wildcard.
Get the hash used by a composite algorithm.
DSA public key.
DSA key pair (private and public key).
Whether a key type is an DSA key (pair or public-only).
DSA signature with hashing.
Deterministic DSA signature with hashing.
An invalid key type value.
Vendor-defined key type flag.
Whether a key type is vendor-defined.
Whether a key type is an unstructured array of bytes.
Whether a key type is asymmetric: either a key pair or a public key.
Whether a key type is the public part of a key pair.
Whether a key type is a key pair containing a private part and a public part.
The key pair type corresponding to a public key type.
The public key type corresponding to a key pair type.
Raw data.
HMAC key.
A secret for key derivation.
A low-entropy secret for password hashing or key derivation.
A secret value that can be used to verify a password hash.
A secret value that can be used in when computing a password hash.
Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
Key for a cipher, AEAD or MAC algorithm based on the ARIA block cipher.
Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.
Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
RSA public key.
RSA key pair (private and public key).
Whether a key type is an RSA key (pair or public-only).
Elliptic curve key pair.
Elliptic curve public key.
Whether a key type is an elliptic curve key (pair or public-only).
Whether a key type is an elliptic curve key pair.
Whether a key type is an elliptic curve public key.
Extract the curve from an elliptic curve key type.
Check if the curve of given family is Weierstrass elliptic curve.
SEC Koblitz curves over prime fields.
SEC random curves over prime fields.
SEC Koblitz curves over binary fields.
SEC random curves over binary fields.
SEC additional random curves over binary fields.
Brainpool P random curves.
Curve25519 and Curve448.
The twisted Edwards curves Ed25519 and Ed448.
Diffie-Hellman key pair.
Diffie-Hellman public key.
Whether a key type is a Diffie-Hellman key (pair or public-only).
Whether a key type is a Diffie-Hellman key pair.
Whether a key type is a Diffie-Hellman public key.
Extract the group from a Diffie-Hellman key type.
Diffie-Hellman groups defined in RFC 7919 Appendix A.
The block size of a block cipher.
Vendor-defined algorithm flag.
Whether an algorithm is vendor-defined.
Whether the specified algorithm is a hash algorithm.
Whether the specified algorithm is a MAC algorithm.
Whether the specified algorithm is a symmetric cipher algorithm.
Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.
Whether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.
Whether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.
Whether the specified algorithm is a key agreement algorithm.
Whether the specified algorithm is a key derivation algorithm.
Whether the specified algorithm is a key stretching / password hashing algorithm.
An invalid algorithm identifier value.
MD5.
PSA_ALG_RIPEMD160.
SHA1.
SHA2-224.
SHA2-256.
SHA2-384.
SHA2-512.
SHA2-512/224.
SHA2-512/256.
SHA3-224.
SHA3-256.
SHA3-384.
SHA3-512.
The first 512 bits (64 bytes) of the SHAKE256 output.
In a hash-and-sign algorithm policy, allow any hash algorithm.
Macro to build an HMAC algorithm.
Whether the specified algorithm is an HMAC algorithm.
Macro to build a truncated MAC algorithm.
Macro to build the base MAC algorithm corresponding to a truncated MAC algorithm.
Length to which a MAC algorithm is truncated.
Macro to build a MAC minimum-MAC-length wildcard algorithm.
The CBC-MAC construction over a block cipher.
The CMAC construction over a block cipher.
Whether the specified algorithm is a MAC algorithm based on a block cipher.
Whether the specified algorithm is a stream cipher.
The stream cipher mode of a stream cipher algorithm.
The CTR stream cipher mode.
The CFB stream cipher mode.
The OFB stream cipher mode.
The XTS cipher mode.
The Electronic Code Book (ECB) mode of a block cipher, with no padding.
The CBC block cipher chaining mode, with no padding.
The CBC block cipher chaining mode with PKCS#7 padding.
Whether the specified algorithm is an AEAD mode on a block cipher.
The CCM authenticated encryption algorithm.
The CCM* cipher mode without authentication.
The GCM authenticated encryption algorithm.
The Chacha20-Poly1305 AEAD algorithm.
Macro to build a shortened AEAD algorithm.
Retrieve the tag length of a specified AEAD algorithm.
Calculate the corresponding AEAD algorithm with the default tag length.
Macro to build an AEAD minimum-tag-length wildcard algorithm.
RSA PKCS#1 v1.5 signature with hashing.
Raw PKCS#1 v1.5 signature.
RSA PSS signature with hashing.
RSA PSS signature with hashing with relaxed verification.
Whether the specified algorithm is RSA PSS with standard salt.
Whether the specified algorithm is RSA PSS with any salt.
Whether the specified algorithm is RSA PSS.
ECDSA signature with hashing.
ECDSA signature without hashing.
Deterministic ECDSA signature with hashing.
Edwards-curve digital signature algorithm without prehashing (PureEdDSA), using standard parameters.
Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHA-512 and the Edwards25519 curve.
Edwards-curve digital signature algorithm with prehashing (HashEdDSA), using SHAKE256 and the Edwards448 curve.
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_hash() and psa_verify_hash().
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_message() and psa_verify_message().
Whether the specified algorithm is a hash-and-sign algorithm.
Get the hash used by a hash-and-sign signature algorithm.
RSA PKCS#1 v1.5 encryption.
RSA OAEP encryption.
Macro to build an HKDF algorithm.
Whether the specified algorithm is an HKDF algorithm.
Macro to build an HKDF-Extract algorithm.
Whether the specified algorithm is an HKDF-Extract algorithm.
Macro to build an HKDF-Expand algorithm.
Whether the specified algorithm is an HKDF-Expand algorithm.
Whether the specified algorithm is an HKDF or HKDF-Extract or HKDF-Expand algorithm.
Macro to build a TLS-1.2 PRF algorithm.
Whether the specified algorithm is a TLS-1.2 PRF algorithm.
Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm.
Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm.
Whether the specified algorithm is a PBKDF2-HMAC algorithm.
The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.
Macro to build a combined algorithm that chains a key agreement with a key derivation.
Whether the specified algorithm is a raw key agreement algorithm.
The finite-field Diffie-Hellman (DH) key agreement algorithm.
Whether the specified algorithm is a finite field Diffie-Hellman algorithm.
The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.
Whether the specified algorithm is an elliptic curve Diffie-Hellman algorithm.
Whether the specified algorithm encoding is a wildcard.
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.
89
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.
108
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 an 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.
127
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.
145
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.
61
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.
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.
72
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.
The group identifier is required to create an 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.
83
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.
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.
93
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_types.h
Macro Definition Documentation#
PSA_KEY_TYPE_DSA_PUBLIC_KEY#
#define PSA_KEY_TYPE_DSA_PUBLIC_KEYValue:
((psa_key_type_t)0x4002)
DSA 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.
349
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_KEY_TYPE_DSA_KEY_PAIR#
#define PSA_KEY_TYPE_DSA_KEY_PAIRValue:
((psa_key_type_t)0x7002)
DSA 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.
367
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_KEY_TYPE_IS_DSA#
#define PSA_KEY_TYPE_IS_DSAValue:
(type)
Whether a key type is an DSA key (pair or public-only).
370
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_DSA_BASE#
#define PSA_ALG_DSA_BASEValue:
((psa_algorithm_t)0x06000400)
373
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_DSA#
#define PSA_ALG_DSAValue:
(hash_alg)
DSA signature with hashing.
This is the signature scheme defined by FIPS 186-4, with a random per-message secret number (k).
Returns
The corresponding DSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
388
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_DETERMINISTIC_DSA_BASE#
#define PSA_ALG_DETERMINISTIC_DSA_BASEValue:
((psa_algorithm_t)0x06000500)
390
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_DSA_DETERMINISTIC_FLAG#
#define PSA_ALG_DSA_DETERMINISTIC_FLAGValue:
PSA_ALG_ECDSA_DETERMINISTIC_FLAG
391
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_DETERMINISTIC_DSA#
#define PSA_ALG_DETERMINISTIC_DSAValue:
(hash_alg)
Deterministic DSA signature with hashing.
This is the deterministic variant defined by RFC 6979 of the signature scheme defined by FIPS 186-4.
Returns
The corresponding DSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
406
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_IS_DSA#
#define PSA_ALG_IS_DSAValue:
408
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_DSA_IS_DETERMINISTIC#
#define PSA_ALG_DSA_IS_DETERMINISTICValue:
(alg)
411
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_IS_DETERMINISTIC_DSA#
#define PSA_ALG_IS_DETERMINISTIC_DSAValue:
(alg)
413
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_IS_RANDOMIZED_DSA#
#define PSA_ALG_IS_RANDOMIZED_DSAValue:
(alg)
415
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_IS_VENDOR_HASH_AND_SIGN#
#define PSA_ALG_IS_VENDOR_HASH_AND_SIGNValue:
(alg)
422
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_CATEGORY_PAKE#
#define PSA_ALG_CATEGORY_PAKEValue:
((psa_algorithm_t)0x0a000000)
763
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_IS_PAKE#
#define PSA_ALG_IS_PAKEValue:
(alg)
Whether the specified algorithm is a password-authenticated key exchange.
Returns
1 if
alg
is a password-authenticated key exchange (PAKE) algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
774
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_ALG_JPAKE#
#define PSA_ALG_JPAKEValue:
((psa_algorithm_t)0x0a000100)
The Password-authenticated key exchange by juggling (J-PAKE) algorithm.
This is J-PAKE as defined by RFC 8236, instantiated with the following parameters:
The group can be either an elliptic curve or defined over a finite field.
Schnorr NIZK proof as defined by RFC 8235 and using the same group as the J-PAKE algorithm.
A cryptographic hash function.
To select these parameters and set up the cipher suite, call these functions in any order:
psa_pake_cs_set_algorithm(cipher_suite, PSA_ALG_JPAKE);
psa_pake_cs_set_primitive(cipher_suite,
PSA_PAKE_PRIMITIVE(type, family, bits));
psa_pake_cs_set_hash(cipher_suite, hash);
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
psa_pake_setup(operation, cipher_suite);
psa_pake_set_user(operation, ...);
psa_pake_set_peer(operation, ...);
psa_pake_set_password_key(operation, ...);
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:
To get the first round data that needs to be sent to the peer, call
// Get g1 psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); // Get the ZKP public key for x1 psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); // Get the ZKP proof for x1 psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); // Get g2 psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); // Get the ZKP public key for x2 psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); // Get the ZKP proof for x2 psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PROOF, ...);
To provide the first round data received from the peer to the operation, call
// Set g3 psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); // Set the ZKP public key for x3 psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); // Set the ZKP proof for x3 psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PROOF, ...); // Set g4 psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); // Set the ZKP public key for x4 psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); // Set the ZKP proof for x4 psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PROOF, ...);
To get the second round data that needs to be sent to the peer, call
// Get A psa_pake_output(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); // Get ZKP public key for x2*s psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); // Get ZKP proof for x2*s psa_pake_output(operation, #PSA_PAKE_STEP_ZK_PROOF, ...);
To provide the second round data received from the peer to the operation, call
// Set B psa_pake_input(operation, #PSA_PAKE_STEP_KEY_SHARE, ...); // Set ZKP public key for x4*s psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PUBLIC, ...); // Set ZKP proof for x4*s psa_pake_input(operation, #PSA_PAKE_STEP_ZK_PROOF, ...);
To access the shared secret call
// Get Ka=Kb=K psa_pake_get_implicit_key()
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.
892
of file util/third_party/mbedtls/include/psa/crypto_extra.h
PSA_KEY_TYPE_NONE#
#define PSA_KEY_TYPE_NONEValue:
((psa_key_type_t)0x0000)
An invalid key type value.
Zero is not the encoding of any key type.
362
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_VENDOR_FLAG#
#define PSA_KEY_TYPE_VENDOR_FLAGValue:
((psa_key_type_t)0x8000)
Vendor-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.
371
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_MASK#
#define PSA_KEY_TYPE_CATEGORY_MASKValue:
((psa_key_type_t)0x7000)
373
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_RAW#
#define PSA_KEY_TYPE_CATEGORY_RAWValue:
((psa_key_type_t)0x1000)
374
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_SYMMETRIC#
#define PSA_KEY_TYPE_CATEGORY_SYMMETRICValue:
((psa_key_type_t)0x2000)
375
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY#
#define PSA_KEY_TYPE_CATEGORY_PUBLIC_KEYValue:
((psa_key_type_t)0x4000)
376
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_KEY_PAIR#
#define PSA_KEY_TYPE_CATEGORY_KEY_PAIRValue:
((psa_key_type_t)0x7000)
377
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_FLAG_PAIR#
#define PSA_KEY_TYPE_CATEGORY_FLAG_PAIRValue:
((psa_key_type_t)0x3000)
379
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_VENDOR_DEFINED#
#define PSA_KEY_TYPE_IS_VENDOR_DEFINEDValue:
(type)
Whether a key type is vendor-defined.
See also PSA_KEY_TYPE_VENDOR_FLAG.
385
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_UNSTRUCTURED#
#define PSA_KEY_TYPE_IS_UNSTRUCTUREDValue:
Whether a key type is an unstructured array of bytes.
This encompasses both symmetric keys and non-key data.
392
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ASYMMETRIC#
#define PSA_KEY_TYPE_IS_ASYMMETRICValue:
Whether a key type is asymmetric: either a key pair or a public key.
397
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_PUBLIC_KEY#
#define PSA_KEY_TYPE_IS_PUBLIC_KEYValue:
(type)
Whether a key type is the public part of a key pair.
402
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_KEY_PAIR#
#define PSA_KEY_TYPE_IS_KEY_PAIRValue:
(type)
Whether a key type is a key pair containing a private part and a public part.
406
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEY#
#define PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEYValue:
(type)
The key pair type corresponding to a public key type.
You may also pass a key pair type as type
, it will be left unchanged.
Returns
The corresponding key pair type. If
type
is not a public key or a key pair, the return value is undefined.
418
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR#
#define PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIRValue:
(type)
The public key type corresponding to a key pair type.
You may also pass a key pair type as type
, it will be left unchanged.
Returns
The corresponding public key type. If
type
is not a public key or a key pair, the return value is undefined.
430
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_RAW_DATA#
#define PSA_KEY_TYPE_RAW_DATAValue:
((psa_key_type_t)0x1001)
Raw 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.
437
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_HMAC#
#define PSA_KEY_TYPE_HMACValue:
((psa_key_type_t)0x1100)
HMAC 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.
447
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DERIVE#
#define PSA_KEY_TYPE_DERIVEValue:
((psa_key_type_t)0x1200)
A secret for key derivation.
This key type is for high-entropy secrets only. For low-entropy secrets, PSA_KEY_TYPE_PASSWORD should be used instead.
These keys can be used as the PSA_KEY_DERIVATION_INPUT_SECRET or PSA_KEY_DERIVATION_INPUT_PASSWORD input of key derivation algorithms.
The key policy determines which key derivation algorithm the key can be used for.
460
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_PASSWORD#
#define PSA_KEY_TYPE_PASSWORDValue:
((psa_key_type_t)0x1203)
A 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.
483
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_PASSWORD_HASH#
#define PSA_KEY_TYPE_PASSWORD_HASHValue:
((psa_key_type_t)0x1205)
A 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.
491
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_PEPPER#
#define PSA_KEY_TYPE_PEPPERValue:
((psa_key_type_t)0x1206)
A 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.
498
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_AES#
#define PSA_KEY_TYPE_AESValue:
((psa_key_type_t)0x2400)
Key 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).
505
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_ARIA#
#define PSA_KEY_TYPE_ARIAValue:
((psa_key_type_t)0x2406)
Key for a cipher, AEAD or MAC algorithm based on the ARIA block cipher.
509
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DES#
#define PSA_KEY_TYPE_DESValue:
((psa_key_type_t)0x2301)
Key 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.
520
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CAMELLIA#
#define PSA_KEY_TYPE_CAMELLIAValue:
((psa_key_type_t)0x2403)
Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.
524
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_CHACHA20#
#define PSA_KEY_TYPE_CHACHA20Value:
((psa_key_type_t)0x2004)
Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
ChaCha20 and the ChaCha20_Poly1305 construction are defined in RFC 7539.
Note
For ChaCha20 and ChaCha20_Poly1305, Mbed TLS only supports 12-byte nonces.
For ChaCha20, the initial counter value is 0. To encrypt or decrypt with the initial counter value 1, you can process and discard a 64-byte block before the real data.
537
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_RSA_PUBLIC_KEY#
#define PSA_KEY_TYPE_RSA_PUBLIC_KEYValue:
((psa_key_type_t)0x4001)
RSA public key.
The size of an RSA key is the bit size of the modulus.
543
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_RSA_KEY_PAIR#
#define PSA_KEY_TYPE_RSA_KEY_PAIRValue:
((psa_key_type_t)0x7001)
RSA key pair (private and public key).
The size of an RSA key is the bit size of the modulus.
548
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_RSA#
#define PSA_KEY_TYPE_IS_RSAValue:
(type)
Whether a key type is an RSA key (pair or public-only).
550
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE#
#define PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASEValue:
((psa_key_type_t)0x4100)
553
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_KEY_PAIR_BASE#
#define PSA_KEY_TYPE_ECC_KEY_PAIR_BASEValue:
((psa_key_type_t)0x7100)
554
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_CURVE_MASK#
#define PSA_KEY_TYPE_ECC_CURVE_MASKValue:
((psa_key_type_t)0x00ff)
555
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_KEY_PAIR#
#define PSA_KEY_TYPE_ECC_KEY_PAIRValue:
(curve)
Elliptic 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.
565
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_PUBLIC_KEY#
#define PSA_KEY_TYPE_ECC_PUBLIC_KEYValue:
(curve)
Elliptic 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).
576
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ECC#
#define PSA_KEY_TYPE_IS_ECCValue:
Whether a key type is an elliptic curve key (pair or public-only).
580
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ECC_KEY_PAIR#
#define PSA_KEY_TYPE_IS_ECC_KEY_PAIRValue:
Whether a key type is an elliptic curve key pair.
584
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY#
#define PSA_KEY_TYPE_IS_ECC_PUBLIC_KEYValue:
Whether a key type is an elliptic curve public key.
588
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_GET_FAMILY#
#define PSA_KEY_TYPE_ECC_GET_FAMILYValue:
Extract the curve from an elliptic curve key type.
593
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_IS_WEIERSTRASS#
#define PSA_ECC_FAMILY_IS_WEIERSTRASSValue:
(family)
Check if the curve of given family is Weierstrass elliptic curve.
599
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECP_K1#
#define PSA_ECC_FAMILY_SECP_K1Value:
((psa_ecc_family_t) 0x17)
SEC 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
609
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECP_R1#
#define PSA_ECC_FAMILY_SECP_R1Value:
((psa_ecc_family_t) 0x12)
SEC random curves over prime fields.
This family comprises the following curves: secp192k1, 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
619
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECP_R2#
#define PSA_ECC_FAMILY_SECP_R2Value:
((psa_ecc_family_t) 0x1b)
621
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECT_K1#
#define PSA_ECC_FAMILY_SECT_K1Value:
((psa_ecc_family_t) 0x27)
SEC 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
631
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECT_R1#
#define PSA_ECC_FAMILY_SECT_R1Value:
((psa_ecc_family_t) 0x22)
SEC 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
641
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECT_R2#
#define PSA_ECC_FAMILY_SECT_R2Value:
((psa_ecc_family_t) 0x2b)
SEC 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
651
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_BRAINPOOL_P_R1#
#define PSA_ECC_FAMILY_BRAINPOOL_P_R1Value:
((psa_ecc_family_t) 0x30)
Brainpool P random curves.
This family comprises the following curves: brainpoolP160r1, brainpoolP192r1, brainpoolP224r1, brainpoolP256r1, brainpoolP320r1, brainpoolP384r1, brainpoolP512r1. It is defined in RFC 5639.
660
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_MONTGOMERY#
#define PSA_ECC_FAMILY_MONTGOMERYValue:
((psa_ecc_family_t) 0x41)
Curve25519 and Curve448.
This family comprises the following Montgomery curves:
255-bit: Bernstein et al., Curve25519: new Diffie-Hellman speed records, LNCS 3958, 2006. The algorithm PSA_ALG_ECDH performs X25519 when used with this curve.
448-bit: Hamburg, Ed448-Goldilocks, a new elliptic curve, NIST ECC Workshop, 2015. The algorithm PSA_ALG_ECDH performs X448 when used with this curve.
672
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ECC_FAMILY_TWISTED_EDWARDS#
#define PSA_ECC_FAMILY_TWISTED_EDWARDSValue:
((psa_ecc_family_t) 0x42)
The 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:
255-bit: Edwards25519, the twisted Edwards curve birationally equivalent to Curve25519. Bernstein et al., Twisted Edwards curves, Africacrypt 2008.
448-bit: Edwards448, the twisted Edwards curve birationally equivalent to Curve448. Hamburg, Ed448-Goldilocks, a new elliptic curve, NIST ECC Workshop, 2015.
688
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE#
#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASEValue:
((psa_key_type_t)0x4200)
690
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_KEY_PAIR_BASE#
#define PSA_KEY_TYPE_DH_KEY_PAIR_BASEValue:
((psa_key_type_t)0x7200)
691
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_GROUP_MASK#
#define PSA_KEY_TYPE_DH_GROUP_MASKValue:
((psa_key_type_t)0x00ff)
692
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_KEY_PAIR#
#define PSA_KEY_TYPE_DH_KEY_PAIRValue:
(group)
Diffie-Hellman key pair.
698
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_PUBLIC_KEY#
#define PSA_KEY_TYPE_DH_PUBLIC_KEYValue:
(group)
Diffie-Hellman public key.
705
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_DH#
#define PSA_KEY_TYPE_IS_DHValue:
Whether a key type is a Diffie-Hellman key (pair or public-only).
709
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_DH_KEY_PAIR#
#define PSA_KEY_TYPE_IS_DH_KEY_PAIRValue:
Whether a key type is a Diffie-Hellman key pair.
713
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_DH_PUBLIC_KEY#
#define PSA_KEY_TYPE_IS_DH_PUBLIC_KEYValue:
Whether a key type is a Diffie-Hellman public key.
717
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_GET_FAMILY#
#define PSA_KEY_TYPE_DH_GET_FAMILYValue:
Extract the group from a Diffie-Hellman key type.
722
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_DH_FAMILY_RFC7919#
#define PSA_DH_FAMILY_RFC7919Value:
((psa_dh_family_t) 0x03)
Diffie-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.
733
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT#
#define PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENTValue:
(type)
735
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_BLOCK_CIPHER_BLOCK_LENGTH#
#define PSA_BLOCK_CIPHER_BLOCK_LENGTHValue:
The block size of a block cipher.
Returns
The block size for a block cipher, or 1 for a stream cipher. The return value is undefined if
type
is not a supported cipher key type.
Note
It is possible to build stream cipher algorithms on top of a block cipher, for example CTR mode (PSA_ALG_CTR). This macro only takes the key type into account, so it cannot be used to determine the size of the data that psa_cipher_update() might buffer for future processing in general.
This macro returns a compile-time constant if its argument is one.
Warnings
This macro may evaluate its argument multiple times.
755
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_VENDOR_FLAG#
#define PSA_ALG_VENDOR_FLAGValue:
((psa_algorithm_t)0x80000000)
Vendor-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.
772
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_MASK#
#define PSA_ALG_CATEGORY_MASKValue:
((psa_algorithm_t)0x7f000000)
774
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_HASH#
#define PSA_ALG_CATEGORY_HASHValue:
((psa_algorithm_t)0x02000000)
775
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_MAC#
#define PSA_ALG_CATEGORY_MACValue:
((psa_algorithm_t)0x03000000)
776
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_CIPHER#
#define PSA_ALG_CATEGORY_CIPHERValue:
((psa_algorithm_t)0x04000000)
777
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_AEAD#
#define PSA_ALG_CATEGORY_AEADValue:
((psa_algorithm_t)0x05000000)
778
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_SIGN#
#define PSA_ALG_CATEGORY_SIGNValue:
((psa_algorithm_t)0x06000000)
779
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION#
#define PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTIONValue:
((psa_algorithm_t)0x07000000)
780
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_KEY_DERIVATION#
#define PSA_ALG_CATEGORY_KEY_DERIVATIONValue:
((psa_algorithm_t)0x08000000)
781
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CATEGORY_KEY_AGREEMENT#
#define PSA_ALG_CATEGORY_KEY_AGREEMENTValue:
((psa_algorithm_t)0x09000000)
782
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_VENDOR_DEFINED#
#define PSA_ALG_IS_VENDOR_DEFINEDValue:
(alg)
Whether an algorithm is vendor-defined.
See also PSA_ALG_VENDOR_FLAG.
788
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_HASH#
#define PSA_ALG_IS_HASHValue:
(alg)
Whether the specified algorithm is a hash algorithm.
Returns
1 if
alg
is a hash algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
799
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_MAC#
#define PSA_ALG_IS_MACValue:
(alg)
Whether the specified algorithm is a MAC algorithm.
Returns
1 if
alg
is a MAC algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
810
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_CIPHER#
#define PSA_ALG_IS_CIPHERValue:
(alg)
Whether the specified algorithm is a symmetric cipher algorithm.
Returns
1 if
alg
is a symmetric cipher algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
821
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_AEAD#
#define PSA_ALG_IS_AEADValue:
(alg)
Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.
Returns
1 if
alg
is an AEAD algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
833
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_SIGN#
#define PSA_ALG_IS_SIGNValue:
(alg)
Whether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.
Returns
1 if
alg
is an asymmetric signature algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
845
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_ASYMMETRIC_ENCRYPTION#
#define PSA_ALG_IS_ASYMMETRIC_ENCRYPTIONValue:
(alg)
Whether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.
Returns
1 if
alg
is an asymmetric encryption algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
857
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_KEY_AGREEMENT#
#define PSA_ALG_IS_KEY_AGREEMENTValue:
(alg)
Whether the specified algorithm is a key agreement algorithm.
Returns
1 if
alg
is a key agreement algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
868
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_KEY_DERIVATION#
#define PSA_ALG_IS_KEY_DERIVATIONValue:
(alg)
Whether the specified algorithm is a key derivation algorithm.
Returns
1 if
alg
is a key derivation algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
879
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_KEY_DERIVATION_STRETCHING#
#define PSA_ALG_IS_KEY_DERIVATION_STRETCHINGValue:
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.
Returns
1 if
alg
is a key stretching / password hashing algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
896
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_NONE#
#define PSA_ALG_NONEValue:
((psa_algorithm_t)0)
An invalid algorithm identifier value.
901
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HASH_MASK#
#define PSA_ALG_HASH_MASKValue:
((psa_algorithm_t)0x000000ff)
903
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_MD5#
#define PSA_ALG_MD5Value:
((psa_algorithm_t)0x02000003)
MD5.
905
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RIPEMD160#
#define PSA_ALG_RIPEMD160Value:
((psa_algorithm_t)0x02000004)
PSA_ALG_RIPEMD160.
907
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA_1#
#define PSA_ALG_SHA_1Value:
((psa_algorithm_t)0x02000005)
SHA1.
909
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA_224#
#define PSA_ALG_SHA_224Value:
((psa_algorithm_t)0x02000008)
SHA2-224.
911
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA_256#
#define PSA_ALG_SHA_256Value:
((psa_algorithm_t)0x02000009)
SHA2-256.
913
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA_384#
#define PSA_ALG_SHA_384Value:
((psa_algorithm_t)0x0200000a)
SHA2-384.
915
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA_512#
#define PSA_ALG_SHA_512Value:
((psa_algorithm_t)0x0200000b)
SHA2-512.
917
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA_512_224#
#define PSA_ALG_SHA_512_224Value:
((psa_algorithm_t)0x0200000c)
SHA2-512/224.
919
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA_512_256#
#define PSA_ALG_SHA_512_256Value:
((psa_algorithm_t)0x0200000d)
SHA2-512/256.
921
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA3_224#
#define PSA_ALG_SHA3_224Value:
((psa_algorithm_t)0x02000010)
SHA3-224.
923
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA3_256#
#define PSA_ALG_SHA3_256Value:
((psa_algorithm_t)0x02000011)
SHA3-256.
925
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA3_384#
#define PSA_ALG_SHA3_384Value:
((psa_algorithm_t)0x02000012)
SHA3-384.
927
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHA3_512#
#define PSA_ALG_SHA3_512Value:
((psa_algorithm_t)0x02000013)
SHA3-512.
929
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SHAKE256_512#
#define PSA_ALG_SHAKE256_512Value:
((psa_algorithm_t)0x02000015)
The 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.
936
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ANY_HASH#
#define PSA_ALG_ANY_HASHValue:
((psa_algorithm_t)0x020000ff)
In 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:
PSA_ALG_RSA_PKCS1V15_SIGN, PSA_ALG_RSA_PSS, PSA_ALG_RSA_PSS_ANY_SALT,
PSA_ALG_ECDSA, PSA_ALG_DETERMINISTIC_ECDSA. Then you may create and use a key as follows:
Set the key usage field using PSA_ALG_ANY_HASH, for example:
psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_HASH); // or VERIFY psa_set_key_algorithm(&attributes, PSA_xxx_SIGNATURE(PSA_ALG_ANY_HASH));
Import or generate key material.
Call psa_sign_hash() or psa_verify_hash(), passing an algorithm built from
PSA_xxx_SIGNATURE
and a specific hash. Each call to sign or verify a message may use a different hash.psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA_256), ...); psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA_512), ...); psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA3_256), ...);
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.
971
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_MAC_SUBCATEGORY_MASK#
#define PSA_ALG_MAC_SUBCATEGORY_MASKValue:
((psa_algorithm_t)0x00c00000)
973
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HMAC_BASE#
#define PSA_ALG_HMAC_BASEValue:
((psa_algorithm_t)0x03800000)
974
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HMAC#
#define PSA_ALG_HMACValue:
(hash_alg)
Macro to build an HMAC algorithm.
For example, PSA_ALG_HMAC(PSA_ALG_SHA_256) is HMAC-SHA-256.
Returns
The corresponding HMAC algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
986
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HMAC_GET_HASH#
#define PSA_ALG_HMAC_GET_HASHValue:
(hmac_alg)
989
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_HMAC#
#define PSA_ALG_IS_HMACValue:
Whether the specified algorithm is an HMAC algorithm.
HMAC is a family of MAC algorithms that are based on a hash function.
Returns
1 if
alg
is an HMAC algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
1002
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_MAC_TRUNCATION_MASK#
#define PSA_ALG_MAC_TRUNCATION_MASKValue:
((psa_algorithm_t)0x003f0000)
1013
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_MAC_TRUNCATION_OFFSET#
#define PSA_MAC_TRUNCATION_OFFSETValue:
16
1014
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG#
#define PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAGValue:
((psa_algorithm_t)0x00008000)
1022
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_TRUNCATED_MAC#
#define PSA_ALG_TRUNCATED_MACValue:
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.
Note
This macro may allow constructing algorithm identifiers that are not valid, either because the specified length is larger than the untruncated MAC or because the specified length is smaller than permitted by the implementation.
It is implementation-defined whether a truncated MAC that is truncated to the same length as the MAC of the untruncated algorithm is considered identical to the untruncated algorithm for policy comparison purposes.
Returns
The corresponding MAC algorithm with the specified length.
Unspecified if
mac_alg
is not a supported MAC algorithm or ifmac_length
is too small or too large for the specified MAC algorithm.
1057
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_FULL_LENGTH_MAC#
#define PSA_ALG_FULL_LENGTH_MACValue:
Macro to build the base MAC algorithm corresponding to a truncated MAC algorithm.
Returns
The corresponding base MAC algorithm.
Unspecified if
mac_alg
is not a supported MAC algorithm.
1074
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_MAC_TRUNCATED_LENGTH#
#define PSA_MAC_TRUNCATED_LENGTHValue:
(mac_alg)
Length to which a MAC algorithm is truncated.
Returns
Length of the truncated MAC in bytes.
0 if
mac_alg
is a non-truncated MAC algorithm.Unspecified if
mac_alg
is not a supported MAC algorithm.
1089
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AT_LEAST_THIS_LENGTH_MAC#
#define PSA_ALG_AT_LEAST_THIS_LENGTH_MACValue:
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.
Note
When setting the minimum required MAC length to less than the smallest MAC length allowed by the base algorithm, this effectively becomes an 'any-MAC-length-allowed' policy for that base algorithm.
Returns
The corresponding MAC wildcard algorithm with the specified minimum length.
Unspecified if
mac_alg
is not a supported MAC algorithm or ifmin_mac_length
is less than 1 or too large for the specified MAC algorithm.
1116
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CIPHER_MAC_BASE#
#define PSA_ALG_CIPHER_MAC_BASEValue:
((psa_algorithm_t)0x03c00000)
1120
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CBC_MAC#
#define PSA_ALG_CBC_MACValue:
((psa_algorithm_t)0x03c00100)
The CBC-MAC construction over a block cipher.
Warnings
CBC-MAC is insecure in many cases. A more secure mode, such as PSA_ALG_CMAC, is recommended.
1126
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CMAC#
#define PSA_ALG_CMACValue:
((psa_algorithm_t)0x03c00200)
The CMAC construction over a block cipher.
1128
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_BLOCK_CIPHER_MAC#
#define PSA_ALG_IS_BLOCK_CIPHER_MACValue:
Whether the specified algorithm is a MAC algorithm based on a block cipher.
Returns
1 if
alg
is a MAC algorithm based on a block cipher, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
1138
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CIPHER_STREAM_FLAG#
#define PSA_ALG_CIPHER_STREAM_FLAGValue:
((psa_algorithm_t)0x00800000)
1142
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CIPHER_FROM_BLOCK_FLAG#
#define PSA_ALG_CIPHER_FROM_BLOCK_FLAGValue:
((psa_algorithm_t)0x00400000)
1143
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_STREAM_CIPHER#
#define PSA_ALG_IS_STREAM_CIPHERValue:
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.
Returns
1 if
alg
is a stream cipher algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or if it is not a symmetric cipher algorithm.
1157
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_STREAM_CIPHER#
#define PSA_ALG_STREAM_CIPHERValue:
((psa_algorithm_t)0x04800100)
The stream cipher mode of a stream cipher algorithm.
The underlying stream cipher is determined by the key type.
To use ChaCha20, use a key type of PSA_KEY_TYPE_CHACHA20.
1166
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CTR#
#define PSA_ALG_CTRValue:
((psa_algorithm_t)0x04c01000)
The 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).
1175
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CFB#
#define PSA_ALG_CFBValue:
((psa_algorithm_t)0x04c01100)
The CFB stream cipher mode.
The underlying block cipher is determined by the key type.
1181
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_OFB#
#define PSA_ALG_OFBValue:
((psa_algorithm_t)0x04c01200)
The OFB stream cipher mode.
The underlying block cipher is determined by the key type.
1187
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_XTS#
#define PSA_ALG_XTSValue:
((psa_algorithm_t)0x0440ff00)
The 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.
1195
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ECB_NO_PADDING#
#define PSA_ALG_ECB_NO_PADDINGValue:
((psa_algorithm_t)0x04404400)
The Electronic Code Book (ECB) mode of a block cipher, with no padding.
Warnings
ECB mode does not protect the confidentiality of the encrypted data except in extremely narrow circumstances. It is recommended that applications only use ECB if they need to construct an operating mode that the implementation does not provide. Implementations are encouraged to provide the modes that applications need in preference to supporting direct access to ECB.
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.
1215
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CBC_NO_PADDING#
#define PSA_ALG_CBC_NO_PADDINGValue:
((psa_algorithm_t)0x04404000)
The 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.
1224
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CBC_PKCS7#
#define PSA_ALG_CBC_PKCS7Value:
((psa_algorithm_t)0x04404100)
The 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.
1232
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_FROM_BLOCK_FLAG#
#define PSA_ALG_AEAD_FROM_BLOCK_FLAGValue:
((psa_algorithm_t)0x00400000)
1234
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER#
#define PSA_ALG_IS_AEAD_ON_BLOCK_CIPHERValue:
Whether the specified algorithm is an AEAD mode on a block cipher.
Returns
1 if
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 ifalg
is not a supported algorithm identifier.
1245
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CCM#
#define PSA_ALG_CCMValue:
((psa_algorithm_t)0x05500100)
The CCM authenticated encryption algorithm.
The underlying block cipher is determined by the key type.
1253
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CCM_STAR_NO_TAG#
#define PSA_ALG_CCM_STAR_NO_TAGValue:
((psa_algorithm_t)0x04c01300)
The 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.
1264
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_GCM#
#define PSA_ALG_GCMValue:
((psa_algorithm_t)0x05500200)
The GCM authenticated encryption algorithm.
The underlying block cipher is determined by the key type.
1270
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_CHACHA20_POLY1305#
#define PSA_ALG_CHACHA20_POLY1305Value:
((psa_algorithm_t)0x05100500)
The 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.
1281
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_TAG_LENGTH_MASK#
#define PSA_ALG_AEAD_TAG_LENGTH_MASKValue:
((psa_algorithm_t)0x003f0000)
1287
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_AEAD_TAG_LENGTH_OFFSET#
#define PSA_AEAD_TAG_LENGTH_OFFSETValue:
16
1288
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG#
#define PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAGValue:
((psa_algorithm_t)0x00008000)
1296
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_SHORTENED_TAG#
#define PSA_ALG_AEAD_WITH_SHORTENED_TAGValue:
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.
Returns
The corresponding AEAD algorithm with the specified length.
Unspecified if
aead_alg
is not a supported AEAD algorithm or iftag_length
is not valid for the specified AEAD algorithm.
1316
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_GET_TAG_LENGTH#
#define PSA_ALG_AEAD_GET_TAG_LENGTHValue:
Retrieve the tag length of a specified AEAD algorithm.
Returns
The tag length specified by the input algorithm.
Unspecified if
aead_alg
is not a supported AEAD algorithm.
1332
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG#
#define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAGValue:
Calculate the corresponding AEAD algorithm with the default tag length.
Returns
The corresponding AEAD algorithm with the default tag length for that algorithm.
1344
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE#
#define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASEValue:
1350
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG#
#define PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAGValue:
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.
Note
When setting the minimum required tag length to less than the smallest tag length allowed by the base algorithm, this effectively becomes an 'any-tag-length-allowed' policy for that base algorithm.
Returns
The corresponding AEAD wildcard algorithm with the specified minimum length.
Unspecified if
aead_alg
is not a supported AEAD algorithm or ifmin_tag_length
is less than 1 or too large for the specified AEAD algorithm.
1379
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_SIGN_BASE#
#define PSA_ALG_RSA_PKCS1V15_SIGN_BASEValue:
((psa_algorithm_t)0x06000200)
1383
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_SIGN#
#define PSA_ALG_RSA_PKCS1V15_SIGNValue:
(hash_alg)
RSA 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.
Returns
The corresponding RSA PKCS#1 v1.5 signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1399
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_SIGN_RAW#
#define PSA_ALG_RSA_PKCS1V15_SIGN_RAWValue:
PSA_ALG_RSA_PKCS1V15_SIGN_BASE
Raw 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.
1407
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PKCS1V15_SIGN#
#define PSA_ALG_IS_RSA_PKCS1V15_SIGNValue:
(alg)
1408
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PSS_BASE#
#define PSA_ALG_RSA_PSS_BASEValue:
((psa_algorithm_t)0x06000300)
1411
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PSS_ANY_SALT_BASE#
#define PSA_ALG_RSA_PSS_ANY_SALT_BASEValue:
((psa_algorithm_t)0x06001300)
1412
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PSS#
#define PSA_ALG_RSA_PSSValue:
(hash_alg)
RSA 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. The specified hash algorithm is used to hash the input message, to create the salted hash, and for the mask generation.
Returns
The corresponding RSA PSS signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1431
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PSS_ANY_SALT#
#define PSA_ALG_RSA_PSS_ANY_SALTValue:
(hash_alg)
RSA 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.
Returns
The corresponding RSA PSS signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1449
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PSS_STANDARD_SALT#
#define PSA_ALG_IS_RSA_PSS_STANDARD_SALTValue:
(alg)
Whether the specified algorithm is RSA PSS with standard salt.
Returns
1 if
alg
is of the form PSA_ALG_RSA_PSS(hash_alg
), wherehash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or policy.
1463
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PSS_ANY_SALT#
#define PSA_ALG_IS_RSA_PSS_ANY_SALTValue:
(alg)
Whether the specified algorithm is RSA PSS with any salt.
Returns
1 if
alg
is of the form #PSA_ALG_RSA_PSS_ANY_SALT_BASE(hash_alg
), wherehash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or policy.
1477
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PSS#
#define PSA_ALG_IS_RSA_PSSValue:
Whether the specified algorithm is RSA PSS.
This includes any of the RSA PSS algorithm variants, regardless of the constraints on salt length.
Returns
1 if
alg
is of the form PSA_ALG_RSA_PSS(hash_alg
) or #PSA_ALG_RSA_PSS_ANY_SALT_BASE(hash_alg
), wherehash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or policy.
1495
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ECDSA_BASE#
#define PSA_ALG_ECDSA_BASEValue:
((psa_algorithm_t)0x06000600)
1499
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ECDSA#
#define PSA_ALG_ECDSAValue:
(hash_alg)
ECDSA 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).
Returns
The corresponding ECDSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1520
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ECDSA_ANY#
#define PSA_ALG_ECDSA_ANYValue:
PSA_ALG_ECDSA_BASE
ECDSA 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.
1531
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_DETERMINISTIC_ECDSA_BASE#
#define PSA_ALG_DETERMINISTIC_ECDSA_BASEValue:
((psa_algorithm_t)0x06000700)
1532
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_DETERMINISTIC_ECDSA#
#define PSA_ALG_DETERMINISTIC_ECDSAValue:
(hash_alg)
Deterministic 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.
Returns
The corresponding deterministic ECDSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1555
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ECDSA_DETERMINISTIC_FLAG#
#define PSA_ALG_ECDSA_DETERMINISTIC_FLAGValue:
((psa_algorithm_t)0x00000100)
1557
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_ECDSA#
#define PSA_ALG_IS_ECDSAValue:
1558
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ECDSA_IS_DETERMINISTIC#
#define PSA_ALG_ECDSA_IS_DETERMINISTICValue:
(alg)
1561
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_DETERMINISTIC_ECDSA#
#define PSA_ALG_IS_DETERMINISTIC_ECDSAValue:
(alg)
1563
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_RANDOMIZED_ECDSA#
#define PSA_ALG_IS_RANDOMIZED_ECDSAValue:
(alg)
1565
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_PURE_EDDSA#
#define PSA_ALG_PURE_EDDSAValue:
((psa_algorithm_t)0x06000800)
Edwards-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:
PSA_ECC_FAMILY_TWISTED_EDWARDS, 255-bit: Ed25519 as specified in RFC 8032. The curve is Edwards25519. The hash function used internally is SHA-512.
PSA_ECC_FAMILY_TWISTED_EDWARDS, 448-bit: Ed448 as specified in RFC 8032. The curve is Edwards448. The hash function used internally is the first 114 bytes of the SHAKE256 output.
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).
1596
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HASH_EDDSA_BASE#
#define PSA_ALG_HASH_EDDSA_BASEValue:
((psa_algorithm_t)0x06000900)
1598
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_HASH_EDDSA#
#define PSA_ALG_IS_HASH_EDDSAValue:
(alg)
1599
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ED25519PH#
#define PSA_ALG_ED25519PHValue:
(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.
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:
call psa_sign_message() on the message;
or calculate the SHA-512 hash of the message with psa_hash_compute() or with a multi-part hash operation started with psa_hash_setup(), using the hash algorithm PSA_ALG_SHA_512, then sign the calculated hash with psa_sign_hash(). Verifying a signature is similar, using psa_verify_message() or psa_verify_hash() instead of the signature function.
1623
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ED448PH#
#define PSA_ALG_ED448PHValue:
(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.
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:
call psa_sign_message() on the message;
or calculate the first 64 bytes of the SHAKE256 output of the message with psa_hash_compute() or with a multi-part hash operation started with psa_hash_setup(), using the hash algorithm PSA_ALG_SHAKE256_512, then sign the calculated hash with psa_sign_hash(). Verifying a signature is similar, using psa_verify_message() or psa_verify_hash() instead of the signature function.
1648
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_VENDOR_HASH_AND_SIGN#
#define PSA_ALG_IS_VENDOR_HASH_AND_SIGNValue:
(alg)
1654
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_SIGN_HASH#
#define PSA_ALG_IS_SIGN_HASHValue:
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:
PSA_ALG_RSA_PKCS1V15_SIGN_RAW (expects its input to be an encoded hash)
PSA_ALG_ECDSA_ANY (doesn't specify what kind of hash the input is)
Returns
1 if alg is a signature algorithm that can be used to sign a hash. 0 if alg is a signature algorithm that can only be used to sign a message. 0 if alg is not a signature algorithm. This macro can return either 0 or 1 if alg is not a supported algorithm identifier.
1673
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_SIGN_MESSAGE#
#define PSA_ALG_IS_SIGN_MESSAGEValue:
(alg)
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_message() and psa_verify_message().
Returns
1 if alg is a signature algorithm that can be used to sign a message. 0 if
alg
is a signature algorithm that can only be used to sign an already-calculated hash. 0 ifalg
is not a signature algorithm. This macro can return either 0 or 1 ifalg
is not a supported algorithm identifier.
1689
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_HASH_AND_SIGN#
#define PSA_ALG_IS_HASH_AND_SIGNValue:
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().
Returns
1 if
alg
is a hash-and-sign algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
1718
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_SIGN_GET_HASH#
#define PSA_ALG_SIGN_GET_HASHValue:
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.
Returns
The underlying hash algorithm if
alg
is a hash-and-sign algorithm.0 if
alg
is a signature algorithm that does not follow the hash-and-sign structure.Unspecified if
alg
is not a signature algorithm or if it is not supported by the implementation.
1740
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_CRYPT#
#define PSA_ALG_RSA_PKCS1V15_CRYPTValue:
((psa_algorithm_t)0x07000200)
RSA PKCS#1 v1.5 encryption.
1747
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_OAEP_BASE#
#define PSA_ALG_RSA_OAEP_BASEValue:
((psa_algorithm_t)0x07000300)
1749
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_OAEP#
#define PSA_ALG_RSA_OAEPValue:
(hash_alg)
RSA 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.
Returns
The corresponding RSA OAEP encryption algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1764
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_RSA_OAEP#
#define PSA_ALG_IS_RSA_OAEPValue:
(alg)
1766
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_RSA_OAEP_GET_HASH#
#define PSA_ALG_RSA_OAEP_GET_HASHValue:
1768
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HKDF_BASE#
#define PSA_ALG_HKDF_BASEValue:
((psa_algorithm_t)0x08000100)
1773
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HKDF#
#define PSA_ALG_HKDFValue:
(hash_alg)
Macro to build an HKDF algorithm.
For example, PSA_ALG_HKDF(PSA_ALG_SHA256)
is HKDF using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_KEY_DERIVATION_INPUT_SALT is the salt used in the "extract" step. It is optional; if omitted, the derivation uses an empty salt.
PSA_KEY_DERIVATION_INPUT_SECRET is the secret key used in the "extract" step.
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.
Warnings
HKDF processes the salt as follows: first hash it with hash_alg if the salt is longer than the block size of the hash algorithm; then pad with null bytes up to the block size. As a result, it is possible for distinct salt inputs to result in the same outputs. To ensure unique outputs, it is recommended to use a fixed length for salt values.
Returns
The corresponding HKDF algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1800
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_HKDF#
#define PSA_ALG_IS_HKDFValue:
(alg)
Whether 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.
Returns
1 if
alg
is an HKDF algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1813
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HKDF_GET_HASH#
#define PSA_ALG_HKDF_GET_HASHValue:
(hkdf_alg)
1815
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HKDF_EXTRACT_BASE#
#define PSA_ALG_HKDF_EXTRACT_BASEValue:
((psa_algorithm_t)0x08000400)
1818
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HKDF_EXTRACT#
#define PSA_ALG_HKDF_EXTRACTValue:
(hash_alg)
Macro to build an HKDF-Extract algorithm.
For example, PSA_ALG_HKDF_EXTRACT(PSA_ALG_SHA256)
is HKDF-Extract using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_KEY_DERIVATION_INPUT_SALT is the salt.
PSA_KEY_DERIVATION_INPUT_SECRET is the input keying material used in the "extract" step. The inputs are mandatory and must be passed in the order above. Each input may only be passed once.
Warnings
HKDF-Extract is not meant to be used on its own. PSA_ALG_HKDF should be used instead if possible. PSA_ALG_HKDF_EXTRACT is provided as a separate algorithm for the sake of protocols that use it as a building block. It may also be a slight performance optimization in applications that use HKDF with the same salt and key but many different info strings.
HKDF processes the salt as follows: first hash it with hash_alg if the salt is longer than the block size of the hash algorithm; then pad with null bytes up to the block size. As a result, it is possible for distinct salt inputs to result in the same outputs. To ensure unique outputs, it is recommended to use a fixed length for salt values.
Returns
The corresponding HKDF-Extract algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1851
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_HKDF_EXTRACT#
#define PSA_ALG_IS_HKDF_EXTRACTValue:
(alg)
Whether 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.
Returns
1 if
alg
is an HKDF-Extract algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1864
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HKDF_EXPAND_BASE#
#define PSA_ALG_HKDF_EXPAND_BASEValue:
((psa_algorithm_t)0x08000500)
1867
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_HKDF_EXPAND#
#define PSA_ALG_HKDF_EXPANDValue:
(hash_alg)
Macro to build an HKDF-Expand algorithm.
For example, PSA_ALG_HKDF_EXPAND(PSA_ALG_SHA256)
is HKDF-Expand using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_KEY_DERIVATION_INPUT_SECRET is the pseudorandom key (PRK).
PSA_KEY_DERIVATION_INPUT_INFO is the info string.
The inputs are mandatory and must be passed in the order above. Each input may only be passed once.
Warnings
HKDF-Expand is not meant to be used on its own.
PSA_ALG_HKDF
should be used instead if possible.PSA_ALG_HKDF_EXPAND
is provided as a separate algorithm for the sake of protocols that use it as a building block. It may also be a slight performance optimization in applications that use HKDF with the same salt and key but many different info strings.
Returns
The corresponding HKDF-Expand algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1893
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_HKDF_EXPAND#
#define PSA_ALG_IS_HKDF_EXPANDValue:
(alg)
Whether 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.
Returns
1 if
alg
is an HKDF-Expand algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1906
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_ANY_HKDF#
#define PSA_ALG_IS_ANY_HKDFValue:
Whether the specified algorithm is an HKDF or HKDF-Extract or HKDF-Expand algorithm.
Returns
1 if
alg
is any HKDF type algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1919
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_TLS12_PRF_BASE#
#define PSA_ALG_TLS12_PRF_BASEValue:
((psa_algorithm_t)0x08000200)
1924
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_TLS12_PRF#
#define PSA_ALG_TLS12_PRFValue:
(hash_alg)
Macro 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:
PSA_KEY_DERIVATION_INPUT_SEED is the seed.
PSA_KEY_DERIVATION_INPUT_SECRET is the secret key.
PSA_KEY_DERIVATION_INPUT_LABEL is the label.
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_SHA256)
represents the TLS 1.2 PRF using HMAC-SHA-256.
Returns
The corresponding TLS-1.2 PRF algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1951
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_TLS12_PRF#
#define PSA_ALG_IS_TLS12_PRFValue:
(alg)
Whether the specified algorithm is a TLS-1.2 PRF algorithm.
Returns
1 if
alg
is a TLS-1.2 PRF algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1962
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_TLS12_PRF_GET_HASH#
#define PSA_ALG_TLS12_PRF_GET_HASHValue:
(hkdf_alg)
1964
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_TLS12_PSK_TO_MS_BASE#
#define PSA_ALG_TLS12_PSK_TO_MS_BASEValue:
((psa_algorithm_t)0x08000300)
1967
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_TLS12_PSK_TO_MS#
#define PSA_ALG_TLS12_PSK_TO_MSValue:
(hash_alg)
Macro 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:
PSA_KEY_DERIVATION_INPUT_SEED is the seed.
PSA_KEY_DERIVATION_INPUT_OTHER_SECRET is the other secret for the computation of the premaster secret. This input is optional; if omitted, it defaults to a string of null bytes with the same length as the secret (PSK) input.
PSA_KEY_DERIVATION_INPUT_SECRET is the secret key.
PSA_KEY_DERIVATION_INPUT_LABEL is the label.
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 a plain PSK cipher suite (RFC 4279, Section 2), omit PSA_KEY_DERIVATION_INPUT_OTHER_SECRET
for a DHE-PSK (RFC 4279, Section 3) or ECDHE-PSK cipher suite (RFC 5489, Section 2), the other secret should be the output of the PSA_ALG_FFDH or PSA_ALG_ECDH key agreement performed with the peer. The recommended way to pass this input is to use a key derivation algorithm constructed as PSA_ALG_KEY_AGREEMENT(ka_alg, PSA_ALG_TLS12_PSK_TO_MS(hash_alg)) and to call psa_key_derivation_key_agreement(). Alternatively, this input may be an output of
psa_raw_key_agreement()
passed with psa_key_derivation_input_bytes(), or an equivalent input passed with psa_key_derivation_input_bytes() or psa_key_derivation_input_key().for a RSA-PSK cipher suite (RFC 4279, Section 4), the other secret should be the 48-byte client challenge (the PreMasterSecret of (RFC 5246, Section 7.4.7.1)) concatenation of the TLS version and a 46-byte random string chosen by the client. On the server, this is typically an output of psa_asymmetric_decrypt() using PSA_ALG_RSA_PKCS1V15_CRYPT, passed to the key derivation operation with
psa_key_derivation_input_bytes()
.
For example, PSA_ALG_TLS12_PSK_TO_MS(PSA_ALG_SHA256)
represents the TLS-1.2 PSK to MasterSecret derivation PRF using HMAC-SHA-256.
Returns
The corresponding TLS-1.2 PSK to MS algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
2021
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_TLS12_PSK_TO_MS#
#define PSA_ALG_IS_TLS12_PSK_TO_MSValue:
(alg)
Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
Returns
1 if
alg
is a TLS-1.2 PSK to MS algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
2032
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_TLS12_PSK_TO_MS_GET_HASH#
#define PSA_ALG_TLS12_PSK_TO_MS_GET_HASHValue:
(hkdf_alg)
2034
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG#
#define PSA_ALG_KEY_DERIVATION_STRETCHING_FLAGValue:
((psa_algorithm_t)0x00800000)
2044
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_PBKDF2_HMAC_BASE#
#define PSA_ALG_PBKDF2_HMAC_BASEValue:
((psa_algorithm_t)0x08800100)
2046
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_PBKDF2_HMAC#
#define PSA_ALG_PBKDF2_HMACValue:
(hash_alg)
Macro 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_SHA256)
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_KEY_DERIVATION_INPUT_COST is the iteration count. This input step must be used exactly once.
PSA_KEY_DERIVATION_INPUT_SALT is the salt. This input step must be used one or more times; if used several times, the inputs will be concatenated. This can be used to build the final salt from multiple sources, both public and secret (also known as pepper).
PSA_KEY_DERIVATION_INPUT_PASSWORD is the password to be hashed. This input step must be used exactly once.
Returns
The corresponding PBKDF2-HMAC-XXX algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
2073
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_PBKDF2_HMAC#
#define PSA_ALG_IS_PBKDF2_HMACValue:
(alg)
Whether the specified algorithm is a PBKDF2-HMAC algorithm.
Returns
1 if
alg
is a PBKDF2-HMAC algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
2084
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_PBKDF2_AES_CMAC_PRF_128#
#define PSA_ALG_PBKDF2_AES_CMAC_PRF_128Value:
((psa_algorithm_t)0x08800200)
The 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.
2096
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_KEY_DERIVATION_MASK#
#define PSA_ALG_KEY_DERIVATION_MASKValue:
((psa_algorithm_t)0xfe00ffff)
2098
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT_MASK#
#define PSA_ALG_KEY_AGREEMENT_MASKValue:
((psa_algorithm_t)0xffff0000)
2099
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT#
#define PSA_ALG_KEY_AGREEMENTValue:
(ka_alg, kdf_alg)
Macro to build a combined algorithm that chains a key agreement with a key derivation.
Returns
The corresponding key agreement and derivation algorithm.
Unspecified if
ka_alg
is not a supported key agreement algorithm orkdf_alg
is not a supported key derivation algorithm.
2115
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT_GET_KDF#
#define PSA_ALG_KEY_AGREEMENT_GET_KDFValue:
(alg)
2118
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT_GET_BASE#
#define PSA_ALG_KEY_AGREEMENT_GET_BASEValue:
(alg)
2121
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_RAW_KEY_AGREEMENT#
#define PSA_ALG_IS_RAW_KEY_AGREEMENTValue:
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().
Returns
1 if
alg
is a raw key agreement algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
2138
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENT#
#define PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENTValue:
(alg)
2142
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_FFDH#
#define PSA_ALG_FFDHValue:
((psa_algorithm_t)0x09010000)
The 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.
2152
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_FFDH#
#define PSA_ALG_IS_FFDHValue:
(alg)
Whether 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.
Returns
1 if
alg
is a finite field Diffie-Hellman algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key agreement algorithm identifier.
2166
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_ECDH#
#define PSA_ALG_ECDHValue:
((psa_algorithm_t)0x09020000)
The 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.
For Montgomery curves (curve types
PSA_ECC_FAMILY_CURVEXXX
), the shared secret is the x-coordinate ofd_A Q_B = d_B Q_A
in little-endian byte order. The bit size is 448 for Curve448 and 255 for Curve25519.For Weierstrass curves over prime fields (curve types
PSA_ECC_FAMILY_SECPXXX
andPSA_ECC_FAMILY_BRAINPOOL_PXXX
), the shared secret is the x-coordinate ofd_A Q_B = d_B Q_A
in big-endian byte order. The bit size ism = ceiling(log_2(p))
for the fieldF_p
.For Weierstrass curves over binary fields (curve types
PSA_ECC_FAMILY_SECTXXX
), the shared secret is the x-coordinate ofd_A Q_B = d_B Q_A
in big-endian byte order. The bit size ism
for the fieldF_{2^m}
.
2194
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_ECDH#
#define PSA_ALG_IS_ECDHValue:
(alg)
Whether 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.
Returns
1 if
alg
is an elliptic curve Diffie-Hellman algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key agreement algorithm identifier.
2210
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_IS_WILDCARD#
#define PSA_ALG_IS_WILDCARDValue:
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.
Returns
1 if
alg
is a wildcard algorithm encoding.0 if
alg
is a non-wildcard algorithm encoding (suitable for an operation).This macro may return either 0 or 1 if
alg
is not a supported algorithm identifier.
2226
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_ALG_GET_HASH#
#define PSA_ALG_GET_HASHValue:
(alg)
Get the hash used by a composite algorithm.
Returns
The underlying hash algorithm if alg is a composite algorithm that uses a hash algorithm.
0
if alg is not a composite algorithm that uses a hash.
2244
of file util/third_party/mbedtls/include/psa/crypto_values.h
PSA_KEY_TYPE_DSA_PUBLIC_KEY#
#define PSA_KEY_TYPE_DSA_PUBLIC_KEYValue:
((psa_key_type_t)0x4002)
DSA 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.
140
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_KEY_TYPE_DSA_KEY_PAIR#
#define PSA_KEY_TYPE_DSA_KEY_PAIRValue:
((psa_key_type_t)0x7002)
DSA 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).
Determinstic 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.
158
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_KEY_TYPE_IS_DSA#
#define PSA_KEY_TYPE_IS_DSAValue:
(type)
Whether a key type is an DSA key (pair or public-only).
161
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_DSA_BASE#
#define PSA_ALG_DSA_BASEValue:
((psa_algorithm_t)0x06000400)
164
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_DSA#
#define PSA_ALG_DSAValue:
(hash_alg)
DSA signature with hashing.
This is the signature scheme defined by FIPS 186-4, with a random per-message secret number (k).
Returns
The corresponding DSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
179
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_DETERMINISTIC_DSA_BASE#
#define PSA_ALG_DETERMINISTIC_DSA_BASEValue:
((psa_algorithm_t)0x06000500)
181
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_DSA_DETERMINISTIC_FLAG#
#define PSA_ALG_DSA_DETERMINISTIC_FLAGValue:
PSA_ALG_ECDSA_DETERMINISTIC_FLAG
182
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_DETERMINISTIC_DSA#
#define PSA_ALG_DETERMINISTIC_DSAValue:
(hash_alg)
Deterministic DSA signature with hashing.
This is the deterministic variant defined by RFC 6979 of the signature scheme defined by FIPS 186-4.
Returns
The corresponding DSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
197
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_IS_DSA#
#define PSA_ALG_IS_DSAValue:
199
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_DSA_IS_DETERMINISTIC#
#define PSA_ALG_DSA_IS_DETERMINISTICValue:
(alg)
202
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_IS_DETERMINISTIC_DSA#
#define PSA_ALG_IS_DETERMINISTIC_DSAValue:
(alg)
204
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_IS_RANDOMIZED_DSA#
#define PSA_ALG_IS_RANDOMIZED_DSAValue:
(alg)
206
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_ALG_IS_VENDOR_HASH_AND_SIGN#
#define PSA_ALG_IS_VENDOR_HASH_AND_SIGNValue:
(alg)
213
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_extra.h
PSA_KEY_TYPE_NONE#
#define PSA_KEY_TYPE_NONEValue:
((psa_key_type_t)0x0000)
An invalid key type value.
Zero is not the encoding of any key type.
338
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_VENDOR_FLAG#
#define PSA_KEY_TYPE_VENDOR_FLAGValue:
((psa_key_type_t)0x8000)
Vendor-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.
347
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_MASK#
#define PSA_KEY_TYPE_CATEGORY_MASKValue:
((psa_key_type_t)0x7000)
349
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_RAW#
#define PSA_KEY_TYPE_CATEGORY_RAWValue:
((psa_key_type_t)0x1000)
350
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_SYMMETRIC#
#define PSA_KEY_TYPE_CATEGORY_SYMMETRICValue:
((psa_key_type_t)0x2000)
351
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_PUBLIC_KEY#
#define PSA_KEY_TYPE_CATEGORY_PUBLIC_KEYValue:
((psa_key_type_t)0x4000)
352
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_KEY_PAIR#
#define PSA_KEY_TYPE_CATEGORY_KEY_PAIRValue:
((psa_key_type_t)0x7000)
353
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CATEGORY_FLAG_PAIR#
#define PSA_KEY_TYPE_CATEGORY_FLAG_PAIRValue:
((psa_key_type_t)0x3000)
355
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_VENDOR_DEFINED#
#define PSA_KEY_TYPE_IS_VENDOR_DEFINEDValue:
(type)
Whether a key type is vendor-defined.
See also PSA_KEY_TYPE_VENDOR_FLAG.
361
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_UNSTRUCTURED#
#define PSA_KEY_TYPE_IS_UNSTRUCTUREDValue:
Whether a key type is an unstructured array of bytes.
This encompasses both symmetric keys and non-key data.
368
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ASYMMETRIC#
#define PSA_KEY_TYPE_IS_ASYMMETRICValue:
Whether a key type is asymmetric: either a key pair or a public key.
373
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_PUBLIC_KEY#
#define PSA_KEY_TYPE_IS_PUBLIC_KEYValue:
(type)
Whether a key type is the public part of a key pair.
378
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_KEY_PAIR#
#define PSA_KEY_TYPE_IS_KEY_PAIRValue:
(type)
Whether a key type is a key pair containing a private part and a public part.
382
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEY#
#define PSA_KEY_TYPE_KEY_PAIR_OF_PUBLIC_KEYValue:
(type)
The key pair type corresponding to a public key type.
You may also pass a key pair type as type
, it will be left unchanged.
Returns
The corresponding key pair type. If
type
is not a public key or a key pair, the return value is undefined.
394
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIR#
#define PSA_KEY_TYPE_PUBLIC_KEY_OF_KEY_PAIRValue:
(type)
The public key type corresponding to a key pair type.
You may also pass a key pair type as type
, it will be left unchanged.
Returns
The corresponding public key type. If
type
is not a public key or a key pair, the return value is undefined.
406
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_RAW_DATA#
#define PSA_KEY_TYPE_RAW_DATAValue:
((psa_key_type_t)0x1001)
Raw 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.
413
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_HMAC#
#define PSA_KEY_TYPE_HMACValue:
((psa_key_type_t)0x1100)
HMAC 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.
423
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DERIVE#
#define PSA_KEY_TYPE_DERIVEValue:
((psa_key_type_t)0x1200)
A secret for key derivation.
This key type is for high-entropy secrets only. For low-entropy secrets, PSA_KEY_TYPE_PASSWORD should be used instead.
These keys can be used as the PSA_KEY_DERIVATION_INPUT_SECRET or PSA_KEY_DERIVATION_INPUT_PASSWORD input of key derivation algorithms.
The key policy determines which key derivation algorithm the key can be used for.
436
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_PASSWORD#
#define PSA_KEY_TYPE_PASSWORDValue:
((psa_key_type_t)0x1203)
A 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.
459
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_PASSWORD_HASH#
#define PSA_KEY_TYPE_PASSWORD_HASHValue:
((psa_key_type_t)0x1205)
A 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.
467
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_PEPPER#
#define PSA_KEY_TYPE_PEPPERValue:
((psa_key_type_t)0x1206)
A 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.
474
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_AES#
#define PSA_KEY_TYPE_AESValue:
((psa_key_type_t)0x2400)
Key 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).
481
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_ARIA#
#define PSA_KEY_TYPE_ARIAValue:
((psa_key_type_t)0x2406)
Key for a cipher, AEAD or MAC algorithm based on the ARIA block cipher.
485
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DES#
#define PSA_KEY_TYPE_DESValue:
((psa_key_type_t)0x2301)
Key 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.
496
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CAMELLIA#
#define PSA_KEY_TYPE_CAMELLIAValue:
((psa_key_type_t)0x2403)
Key for a cipher, AEAD or MAC algorithm based on the Camellia block cipher.
500
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_CHACHA20#
#define PSA_KEY_TYPE_CHACHA20Value:
((psa_key_type_t)0x2004)
Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
ChaCha20 and the ChaCha20_Poly1305 construction are defined in RFC 7539.
Note
For ChaCha20 and ChaCha20_Poly1305, Mbed TLS only supports 12-byte nonces.
For ChaCha20, the initial counter value is 0. To encrypt or decrypt with the initial counter value 1, you can process and discard a 64-byte block before the real data.
513
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_RSA_PUBLIC_KEY#
#define PSA_KEY_TYPE_RSA_PUBLIC_KEYValue:
((psa_key_type_t)0x4001)
RSA public key.
The size of an RSA key is the bit size of the modulus.
519
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_RSA_KEY_PAIR#
#define PSA_KEY_TYPE_RSA_KEY_PAIRValue:
((psa_key_type_t)0x7001)
RSA key pair (private and public key).
The size of an RSA key is the bit size of the modulus.
524
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_RSA#
#define PSA_KEY_TYPE_IS_RSAValue:
(type)
Whether a key type is an RSA key (pair or public-only).
526
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASE#
#define PSA_KEY_TYPE_ECC_PUBLIC_KEY_BASEValue:
((psa_key_type_t)0x4100)
529
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_KEY_PAIR_BASE#
#define PSA_KEY_TYPE_ECC_KEY_PAIR_BASEValue:
((psa_key_type_t)0x7100)
530
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_CURVE_MASK#
#define PSA_KEY_TYPE_ECC_CURVE_MASKValue:
((psa_key_type_t)0x00ff)
531
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_KEY_PAIR#
#define PSA_KEY_TYPE_ECC_KEY_PAIRValue:
(curve)
Elliptic 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.
541
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_PUBLIC_KEY#
#define PSA_KEY_TYPE_ECC_PUBLIC_KEYValue:
(curve)
Elliptic 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).
552
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ECC#
#define PSA_KEY_TYPE_IS_ECCValue:
Whether a key type is an elliptic curve key (pair or public-only).
556
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ECC_KEY_PAIR#
#define PSA_KEY_TYPE_IS_ECC_KEY_PAIRValue:
Whether a key type is an elliptic curve key pair.
560
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY#
#define PSA_KEY_TYPE_IS_ECC_PUBLIC_KEYValue:
Whether a key type is an elliptic curve public key.
564
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_ECC_GET_FAMILY#
#define PSA_KEY_TYPE_ECC_GET_FAMILYValue:
Extract the curve from an elliptic curve key type.
569
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_IS_WEIERSTRASS#
#define PSA_ECC_FAMILY_IS_WEIERSTRASSValue:
(family)
Check if the curve of given family is Weierstrass elliptic curve.
575
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECP_K1#
#define PSA_ECC_FAMILY_SECP_K1Value:
((psa_ecc_family_t) 0x17)
SEC 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
585
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECP_R1#
#define PSA_ECC_FAMILY_SECP_R1Value:
((psa_ecc_family_t) 0x12)
SEC random curves over prime fields.
This family comprises the following curves: secp192k1, 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
595
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECP_R2#
#define PSA_ECC_FAMILY_SECP_R2Value:
((psa_ecc_family_t) 0x1b)
597
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECT_K1#
#define PSA_ECC_FAMILY_SECT_K1Value:
((psa_ecc_family_t) 0x27)
SEC 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
607
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECT_R1#
#define PSA_ECC_FAMILY_SECT_R1Value:
((psa_ecc_family_t) 0x22)
SEC 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
617
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_SECT_R2#
#define PSA_ECC_FAMILY_SECT_R2Value:
((psa_ecc_family_t) 0x2b)
SEC 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
627
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_BRAINPOOL_P_R1#
#define PSA_ECC_FAMILY_BRAINPOOL_P_R1Value:
((psa_ecc_family_t) 0x30)
Brainpool P random curves.
This family comprises the following curves: brainpoolP160r1, brainpoolP192r1, brainpoolP224r1, brainpoolP256r1, brainpoolP320r1, brainpoolP384r1, brainpoolP512r1. It is defined in RFC 5639.
636
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_MONTGOMERY#
#define PSA_ECC_FAMILY_MONTGOMERYValue:
((psa_ecc_family_t) 0x41)
Curve25519 and Curve448.
This family comprises the following Montgomery curves:
255-bit: Bernstein et al., Curve25519: new Diffie-Hellman speed records, LNCS 3958, 2006. The algorithm PSA_ALG_ECDH performs X25519 when used with this curve.
448-bit: Hamburg, Ed448-Goldilocks, a new elliptic curve, NIST ECC Workshop, 2015. The algorithm PSA_ALG_ECDH performs X448 when used with this curve.
648
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ECC_FAMILY_TWISTED_EDWARDS#
#define PSA_ECC_FAMILY_TWISTED_EDWARDSValue:
((psa_ecc_family_t) 0x42)
The 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:
255-bit: Edwards25519, the twisted Edwards curve birationally equivalent to Curve25519. Bernstein et al., Twisted Edwards curves, Africacrypt 2008.
448-bit: Edwards448, the twisted Edwards curve birationally equivalent to Curve448. Hamburg, Ed448-Goldilocks, a new elliptic curve, NIST ECC Workshop, 2015.
664
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_PUBLIC_KEY_BASE#
#define PSA_KEY_TYPE_DH_PUBLIC_KEY_BASEValue:
((psa_key_type_t)0x4200)
666
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_KEY_PAIR_BASE#
#define PSA_KEY_TYPE_DH_KEY_PAIR_BASEValue:
((psa_key_type_t)0x7200)
667
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_GROUP_MASK#
#define PSA_KEY_TYPE_DH_GROUP_MASKValue:
((psa_key_type_t)0x00ff)
668
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_KEY_PAIR#
#define PSA_KEY_TYPE_DH_KEY_PAIRValue:
(group)
Diffie-Hellman key pair.
674
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_PUBLIC_KEY#
#define PSA_KEY_TYPE_DH_PUBLIC_KEYValue:
(group)
Diffie-Hellman public key.
681
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_DH#
#define PSA_KEY_TYPE_IS_DHValue:
Whether a key type is a Diffie-Hellman key (pair or public-only).
685
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_DH_KEY_PAIR#
#define PSA_KEY_TYPE_IS_DH_KEY_PAIRValue:
Whether a key type is a Diffie-Hellman key pair.
689
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_IS_DH_PUBLIC_KEY#
#define PSA_KEY_TYPE_IS_DH_PUBLIC_KEYValue:
Whether a key type is a Diffie-Hellman public key.
693
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_KEY_TYPE_DH_GET_FAMILY#
#define PSA_KEY_TYPE_DH_GET_FAMILYValue:
Extract the group from a Diffie-Hellman key type.
698
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_DH_FAMILY_RFC7919#
#define PSA_DH_FAMILY_RFC7919Value:
((psa_dh_family_t) 0x03)
Diffie-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.
709
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENT#
#define PSA_GET_KEY_TYPE_BLOCK_SIZE_EXPONENTValue:
(type)
711
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_BLOCK_CIPHER_BLOCK_LENGTH#
#define PSA_BLOCK_CIPHER_BLOCK_LENGTHValue:
The block size of a block cipher.
Returns
The block size for a block cipher, or 1 for a stream cipher. The return value is undefined if
type
is not a supported cipher key type.
Note
It is possible to build stream cipher algorithms on top of a block cipher, for example CTR mode (PSA_ALG_CTR). This macro only takes the key type into account, so it cannot be used to determine the size of the data that psa_cipher_update() might buffer for future processing in general.
This macro returns a compile-time constant if its argument is one.
Warnings
This macro may evaluate its argument multiple times.
731
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_VENDOR_FLAG#
#define PSA_ALG_VENDOR_FLAGValue:
((psa_algorithm_t)0x80000000)
Vendor-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.
748
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_MASK#
#define PSA_ALG_CATEGORY_MASKValue:
((psa_algorithm_t)0x7f000000)
750
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_HASH#
#define PSA_ALG_CATEGORY_HASHValue:
((psa_algorithm_t)0x02000000)
751
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_MAC#
#define PSA_ALG_CATEGORY_MACValue:
((psa_algorithm_t)0x03000000)
752
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_CIPHER#
#define PSA_ALG_CATEGORY_CIPHERValue:
((psa_algorithm_t)0x04000000)
753
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_AEAD#
#define PSA_ALG_CATEGORY_AEADValue:
((psa_algorithm_t)0x05000000)
754
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_SIGN#
#define PSA_ALG_CATEGORY_SIGNValue:
((psa_algorithm_t)0x06000000)
755
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION#
#define PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTIONValue:
((psa_algorithm_t)0x07000000)
756
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_KEY_DERIVATION#
#define PSA_ALG_CATEGORY_KEY_DERIVATIONValue:
((psa_algorithm_t)0x08000000)
757
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CATEGORY_KEY_AGREEMENT#
#define PSA_ALG_CATEGORY_KEY_AGREEMENTValue:
((psa_algorithm_t)0x09000000)
758
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_VENDOR_DEFINED#
#define PSA_ALG_IS_VENDOR_DEFINEDValue:
(alg)
Whether an algorithm is vendor-defined.
See also PSA_ALG_VENDOR_FLAG.
764
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_HASH#
#define PSA_ALG_IS_HASHValue:
(alg)
Whether the specified algorithm is a hash algorithm.
Returns
1 if
alg
is a hash algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
775
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_MAC#
#define PSA_ALG_IS_MACValue:
(alg)
Whether the specified algorithm is a MAC algorithm.
Returns
1 if
alg
is a MAC algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
786
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_CIPHER#
#define PSA_ALG_IS_CIPHERValue:
(alg)
Whether the specified algorithm is a symmetric cipher algorithm.
Returns
1 if
alg
is a symmetric cipher algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
797
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_AEAD#
#define PSA_ALG_IS_AEADValue:
(alg)
Whether the specified algorithm is an authenticated encryption with associated data (AEAD) algorithm.
Returns
1 if
alg
is an AEAD algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
809
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_SIGN#
#define PSA_ALG_IS_SIGNValue:
(alg)
Whether the specified algorithm is an asymmetric signature algorithm, also known as public-key signature algorithm.
Returns
1 if
alg
is an asymmetric signature algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
821
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_ASYMMETRIC_ENCRYPTION#
#define PSA_ALG_IS_ASYMMETRIC_ENCRYPTIONValue:
(alg)
Whether the specified algorithm is an asymmetric encryption algorithm, also known as public-key encryption algorithm.
Returns
1 if
alg
is an asymmetric encryption algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
833
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_KEY_AGREEMENT#
#define PSA_ALG_IS_KEY_AGREEMENTValue:
(alg)
Whether the specified algorithm is a key agreement algorithm.
Returns
1 if
alg
is a key agreement algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
844
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_KEY_DERIVATION#
#define PSA_ALG_IS_KEY_DERIVATIONValue:
(alg)
Whether the specified algorithm is a key derivation algorithm.
Returns
1 if
alg
is a key derivation algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
855
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_KEY_DERIVATION_STRETCHING#
#define PSA_ALG_IS_KEY_DERIVATION_STRETCHINGValue:
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.
Returns
1 if
alg
is a key stretching / password hashing algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
872
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_NONE#
#define PSA_ALG_NONEValue:
((psa_algorithm_t)0)
An invalid algorithm identifier value.
877
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HASH_MASK#
#define PSA_ALG_HASH_MASKValue:
((psa_algorithm_t)0x000000ff)
879
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_MD5#
#define PSA_ALG_MD5Value:
((psa_algorithm_t)0x02000003)
MD5.
881
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RIPEMD160#
#define PSA_ALG_RIPEMD160Value:
((psa_algorithm_t)0x02000004)
PSA_ALG_RIPEMD160.
883
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA_1#
#define PSA_ALG_SHA_1Value:
((psa_algorithm_t)0x02000005)
SHA1.
885
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA_224#
#define PSA_ALG_SHA_224Value:
((psa_algorithm_t)0x02000008)
SHA2-224.
887
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA_256#
#define PSA_ALG_SHA_256Value:
((psa_algorithm_t)0x02000009)
SHA2-256.
889
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA_384#
#define PSA_ALG_SHA_384Value:
((psa_algorithm_t)0x0200000a)
SHA2-384.
891
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA_512#
#define PSA_ALG_SHA_512Value:
((psa_algorithm_t)0x0200000b)
SHA2-512.
893
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA_512_224#
#define PSA_ALG_SHA_512_224Value:
((psa_algorithm_t)0x0200000c)
SHA2-512/224.
895
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA_512_256#
#define PSA_ALG_SHA_512_256Value:
((psa_algorithm_t)0x0200000d)
SHA2-512/256.
897
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA3_224#
#define PSA_ALG_SHA3_224Value:
((psa_algorithm_t)0x02000010)
SHA3-224.
899
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA3_256#
#define PSA_ALG_SHA3_256Value:
((psa_algorithm_t)0x02000011)
SHA3-256.
901
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA3_384#
#define PSA_ALG_SHA3_384Value:
((psa_algorithm_t)0x02000012)
SHA3-384.
903
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHA3_512#
#define PSA_ALG_SHA3_512Value:
((psa_algorithm_t)0x02000013)
SHA3-512.
905
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SHAKE256_512#
#define PSA_ALG_SHAKE256_512Value:
((psa_algorithm_t)0x02000015)
The 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.
912
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ANY_HASH#
#define PSA_ALG_ANY_HASHValue:
((psa_algorithm_t)0x020000ff)
In 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:
PSA_ALG_RSA_PKCS1V15_SIGN, PSA_ALG_RSA_PSS, PSA_ALG_RSA_PSS_ANY_SALT,
PSA_ALG_ECDSA, PSA_ALG_DETERMINISTIC_ECDSA. Then you may create and use a key as follows:
Set the key usage field using PSA_ALG_ANY_HASH, for example:
psa_set_key_usage_flags(&attributes, PSA_KEY_USAGE_SIGN_HASH); // or VERIFY psa_set_key_algorithm(&attributes, PSA_xxx_SIGNATURE(PSA_ALG_ANY_HASH));
Import or generate key material.
Call psa_sign_hash() or psa_verify_hash(), passing an algorithm built from
PSA_xxx_SIGNATURE
and a specific hash. Each call to sign or verify a message may use a different hash.psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA_256), ...); psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA_512), ...); psa_sign_hash(key, PSA_xxx_SIGNATURE(PSA_ALG_SHA3_256), ...);
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.
947
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_MAC_SUBCATEGORY_MASK#
#define PSA_ALG_MAC_SUBCATEGORY_MASKValue:
((psa_algorithm_t)0x00c00000)
949
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HMAC_BASE#
#define PSA_ALG_HMAC_BASEValue:
((psa_algorithm_t)0x03800000)
950
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HMAC#
#define PSA_ALG_HMACValue:
(hash_alg)
Macro to build an HMAC algorithm.
For example, PSA_ALG_HMAC(PSA_ALG_SHA_256) is HMAC-SHA-256.
Returns
The corresponding HMAC algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
962
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HMAC_GET_HASH#
#define PSA_ALG_HMAC_GET_HASHValue:
(hmac_alg)
965
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_HMAC#
#define PSA_ALG_IS_HMACValue:
Whether the specified algorithm is an HMAC algorithm.
HMAC is a family of MAC algorithms that are based on a hash function.
Returns
1 if
alg
is an HMAC algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
978
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_MAC_TRUNCATION_MASK#
#define PSA_ALG_MAC_TRUNCATION_MASKValue:
((psa_algorithm_t)0x003f0000)
989
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_MAC_TRUNCATION_OFFSET#
#define PSA_MAC_TRUNCATION_OFFSETValue:
16
990
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG#
#define PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAGValue:
((psa_algorithm_t)0x00008000)
998
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_TRUNCATED_MAC#
#define PSA_ALG_TRUNCATED_MACValue:
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.
Note
This macro may allow constructing algorithm identifiers that are not valid, either because the specified length is larger than the untruncated MAC or because the specified length is smaller than permitted by the implementation.
It is implementation-defined whether a truncated MAC that is truncated to the same length as the MAC of the untruncated algorithm is considered identical to the untruncated algorithm for policy comparison purposes.
Returns
The corresponding MAC algorithm with the specified length.
Unspecified if
mac_alg
is not a supported MAC algorithm or ifmac_length
is too small or too large for the specified MAC algorithm.
1033
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_FULL_LENGTH_MAC#
#define PSA_ALG_FULL_LENGTH_MACValue:
Macro to build the base MAC algorithm corresponding to a truncated MAC algorithm.
Returns
The corresponding base MAC algorithm.
Unspecified if
mac_alg
is not a supported MAC algorithm.
1050
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_MAC_TRUNCATED_LENGTH#
#define PSA_MAC_TRUNCATED_LENGTHValue:
(mac_alg)
Length to which a MAC algorithm is truncated.
Returns
Length of the truncated MAC in bytes.
0 if
mac_alg
is a non-truncated MAC algorithm.Unspecified if
mac_alg
is not a supported MAC algorithm.
1065
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AT_LEAST_THIS_LENGTH_MAC#
#define PSA_ALG_AT_LEAST_THIS_LENGTH_MACValue:
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.
Note
When setting the minimum required MAC length to less than the smallest MAC length allowed by the base algorithm, this effectively becomes an 'any-MAC-length-allowed' policy for that base algorithm.
Returns
The corresponding MAC wildcard algorithm with the specified minimum length.
Unspecified if
mac_alg
is not a supported MAC algorithm or ifmin_mac_length
is less than 1 or too large for the specified MAC algorithm.
1092
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CIPHER_MAC_BASE#
#define PSA_ALG_CIPHER_MAC_BASEValue:
((psa_algorithm_t)0x03c00000)
1096
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CBC_MAC#
#define PSA_ALG_CBC_MACValue:
((psa_algorithm_t)0x03c00100)
The CBC-MAC construction over a block cipher.
Warnings
CBC-MAC is insecure in many cases. A more secure mode, such as PSA_ALG_CMAC, is recommended.
1102
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CMAC#
#define PSA_ALG_CMACValue:
((psa_algorithm_t)0x03c00200)
The CMAC construction over a block cipher.
1104
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_BLOCK_CIPHER_MAC#
#define PSA_ALG_IS_BLOCK_CIPHER_MACValue:
Whether the specified algorithm is a MAC algorithm based on a block cipher.
Returns
1 if
alg
is a MAC algorithm based on a block cipher, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
1114
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CIPHER_STREAM_FLAG#
#define PSA_ALG_CIPHER_STREAM_FLAGValue:
((psa_algorithm_t)0x00800000)
1118
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CIPHER_FROM_BLOCK_FLAG#
#define PSA_ALG_CIPHER_FROM_BLOCK_FLAGValue:
((psa_algorithm_t)0x00400000)
1119
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_STREAM_CIPHER#
#define PSA_ALG_IS_STREAM_CIPHERValue:
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.
Returns
1 if
alg
is a stream cipher algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or if it is not a symmetric cipher algorithm.
1133
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_STREAM_CIPHER#
#define PSA_ALG_STREAM_CIPHERValue:
((psa_algorithm_t)0x04800100)
The stream cipher mode of a stream cipher algorithm.
The underlying stream cipher is determined by the key type.
To use ChaCha20, use a key type of PSA_KEY_TYPE_CHACHA20.
1142
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CTR#
#define PSA_ALG_CTRValue:
((psa_algorithm_t)0x04c01000)
The 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).
1151
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CFB#
#define PSA_ALG_CFBValue:
((psa_algorithm_t)0x04c01100)
The CFB stream cipher mode.
The underlying block cipher is determined by the key type.
1157
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_OFB#
#define PSA_ALG_OFBValue:
((psa_algorithm_t)0x04c01200)
The OFB stream cipher mode.
The underlying block cipher is determined by the key type.
1163
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_XTS#
#define PSA_ALG_XTSValue:
((psa_algorithm_t)0x0440ff00)
The 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.
1171
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ECB_NO_PADDING#
#define PSA_ALG_ECB_NO_PADDINGValue:
((psa_algorithm_t)0x04404400)
The Electronic Code Book (ECB) mode of a block cipher, with no padding.
Warnings
ECB mode does not protect the confidentiality of the encrypted data except in extremely narrow circumstances. It is recommended that applications only use ECB if they need to construct an operating mode that the implementation does not provide. Implementations are encouraged to provide the modes that applications need in preference to supporting direct access to ECB.
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.
1191
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CBC_NO_PADDING#
#define PSA_ALG_CBC_NO_PADDINGValue:
((psa_algorithm_t)0x04404000)
The 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.
1200
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CBC_PKCS7#
#define PSA_ALG_CBC_PKCS7Value:
((psa_algorithm_t)0x04404100)
The 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.
1208
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_FROM_BLOCK_FLAG#
#define PSA_ALG_AEAD_FROM_BLOCK_FLAGValue:
((psa_algorithm_t)0x00400000)
1210
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_AEAD_ON_BLOCK_CIPHER#
#define PSA_ALG_IS_AEAD_ON_BLOCK_CIPHERValue:
Whether the specified algorithm is an AEAD mode on a block cipher.
Returns
1 if
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 ifalg
is not a supported algorithm identifier.
1221
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CCM#
#define PSA_ALG_CCMValue:
((psa_algorithm_t)0x05500100)
The CCM authenticated encryption algorithm.
The underlying block cipher is determined by the key type.
1229
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CCM_STAR_NO_TAG#
#define PSA_ALG_CCM_STAR_NO_TAGValue:
((psa_algorithm_t)0x04c01300)
The 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.
1240
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_GCM#
#define PSA_ALG_GCMValue:
((psa_algorithm_t)0x05500200)
The GCM authenticated encryption algorithm.
The underlying block cipher is determined by the key type.
1246
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_CHACHA20_POLY1305#
#define PSA_ALG_CHACHA20_POLY1305Value:
((psa_algorithm_t)0x05100500)
The 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.
1257
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_TAG_LENGTH_MASK#
#define PSA_ALG_AEAD_TAG_LENGTH_MASKValue:
((psa_algorithm_t)0x003f0000)
1263
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_AEAD_TAG_LENGTH_OFFSET#
#define PSA_AEAD_TAG_LENGTH_OFFSETValue:
16
1264
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG#
#define PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAGValue:
((psa_algorithm_t)0x00008000)
1272
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_SHORTENED_TAG#
#define PSA_ALG_AEAD_WITH_SHORTENED_TAGValue:
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.
Returns
The corresponding AEAD algorithm with the specified length.
Unspecified if
aead_alg
is not a supported AEAD algorithm or iftag_length
is not valid for the specified AEAD algorithm.
1292
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_GET_TAG_LENGTH#
#define PSA_ALG_AEAD_GET_TAG_LENGTHValue:
Retrieve the tag length of a specified AEAD algorithm.
Returns
The tag length specified by the input algorithm.
Unspecified if
aead_alg
is not a supported AEAD algorithm.
1308
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG#
#define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAGValue:
Calculate the corresponding AEAD algorithm with the default tag length.
Returns
The corresponding AEAD algorithm with the default tag length for that algorithm.
1320
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASE#
#define PSA_ALG_AEAD_WITH_DEFAULT_LENGTH_TAG_CASEValue:
1326
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAG#
#define PSA_ALG_AEAD_WITH_AT_LEAST_THIS_LENGTH_TAGValue:
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.
Note
When setting the minimum required tag length to less than the smallest tag length allowed by the base algorithm, this effectively becomes an 'any-tag-length-allowed' policy for that base algorithm.
Returns
The corresponding AEAD wildcard algorithm with the specified minimum length.
Unspecified if
aead_alg
is not a supported AEAD algorithm or ifmin_tag_length
is less than 1 or too large for the specified AEAD algorithm.
1355
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_SIGN_BASE#
#define PSA_ALG_RSA_PKCS1V15_SIGN_BASEValue:
((psa_algorithm_t)0x06000200)
1359
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_SIGN#
#define PSA_ALG_RSA_PKCS1V15_SIGNValue:
(hash_alg)
RSA 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.
Returns
The corresponding RSA PKCS#1 v1.5 signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1375
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_SIGN_RAW#
#define PSA_ALG_RSA_PKCS1V15_SIGN_RAWValue:
PSA_ALG_RSA_PKCS1V15_SIGN_BASE
Raw 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.
1383
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PKCS1V15_SIGN#
#define PSA_ALG_IS_RSA_PKCS1V15_SIGNValue:
(alg)
1384
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PSS_BASE#
#define PSA_ALG_RSA_PSS_BASEValue:
((psa_algorithm_t)0x06000300)
1387
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PSS_ANY_SALT_BASE#
#define PSA_ALG_RSA_PSS_ANY_SALT_BASEValue:
((psa_algorithm_t)0x06001300)
1388
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PSS#
#define PSA_ALG_RSA_PSSValue:
(hash_alg)
RSA 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. The specified hash algorithm is used to hash the input message, to create the salted hash, and for the mask generation.
Returns
The corresponding RSA PSS signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1407
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PSS_ANY_SALT#
#define PSA_ALG_RSA_PSS_ANY_SALTValue:
(hash_alg)
RSA 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.
Returns
The corresponding RSA PSS signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1425
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PSS_STANDARD_SALT#
#define PSA_ALG_IS_RSA_PSS_STANDARD_SALTValue:
(alg)
Whether the specified algorithm is RSA PSS with standard salt.
Returns
1 if
alg
is of the form PSA_ALG_RSA_PSS(hash_alg
), wherehash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or policy.
1439
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PSS_ANY_SALT#
#define PSA_ALG_IS_RSA_PSS_ANY_SALTValue:
(alg)
Whether the specified algorithm is RSA PSS with any salt.
Returns
1 if
alg
is of the form #PSA_ALG_RSA_PSS_ANY_SALT_BASE(hash_alg
), wherehash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or policy.
1453
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_RSA_PSS#
#define PSA_ALG_IS_RSA_PSSValue:
Whether the specified algorithm is RSA PSS.
This includes any of the RSA PSS algorithm variants, regardless of the constraints on salt length.
Returns
1 if
alg
is of the form PSA_ALG_RSA_PSS(hash_alg
) or #PSA_ALG_RSA_PSS_ANY_SALT_BASE(hash_alg
), wherehash_alg
is a hash algorithm or PSA_ALG_ANY_HASH. 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier or policy.
1471
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ECDSA_BASE#
#define PSA_ALG_ECDSA_BASEValue:
((psa_algorithm_t)0x06000600)
1475
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ECDSA#
#define PSA_ALG_ECDSAValue:
(hash_alg)
ECDSA 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).
Returns
The corresponding ECDSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1496
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ECDSA_ANY#
#define PSA_ALG_ECDSA_ANYValue:
PSA_ALG_ECDSA_BASE
ECDSA 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.
1507
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_DETERMINISTIC_ECDSA_BASE#
#define PSA_ALG_DETERMINISTIC_ECDSA_BASEValue:
((psa_algorithm_t)0x06000700)
1508
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_DETERMINISTIC_ECDSA#
#define PSA_ALG_DETERMINISTIC_ECDSAValue:
(hash_alg)
Deterministic 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.
Returns
The corresponding deterministic ECDSA signature algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1531
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ECDSA_DETERMINISTIC_FLAG#
#define PSA_ALG_ECDSA_DETERMINISTIC_FLAGValue:
((psa_algorithm_t)0x00000100)
1533
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_ECDSA#
#define PSA_ALG_IS_ECDSAValue:
1534
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ECDSA_IS_DETERMINISTIC#
#define PSA_ALG_ECDSA_IS_DETERMINISTICValue:
(alg)
1537
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_DETERMINISTIC_ECDSA#
#define PSA_ALG_IS_DETERMINISTIC_ECDSAValue:
(alg)
1539
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_RANDOMIZED_ECDSA#
#define PSA_ALG_IS_RANDOMIZED_ECDSAValue:
(alg)
1541
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_PURE_EDDSA#
#define PSA_ALG_PURE_EDDSAValue:
((psa_algorithm_t)0x06000800)
Edwards-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:
PSA_ECC_FAMILY_TWISTED_EDWARDS, 255-bit: Ed25519 as specified in RFC 8032. The curve is Edwards25519. The hash function used internally is SHA-512.
PSA_ECC_FAMILY_TWISTED_EDWARDS, 448-bit: Ed448 as specified in RFC 8032. The curve is Edwards448. The hash function used internally is the first 114 bytes of the SHAKE256 output.
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).
1572
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HASH_EDDSA_BASE#
#define PSA_ALG_HASH_EDDSA_BASEValue:
((psa_algorithm_t)0x06000900)
1574
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_HASH_EDDSA#
#define PSA_ALG_IS_HASH_EDDSAValue:
(alg)
1575
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ED25519PH#
#define PSA_ALG_ED25519PHValue:
(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.
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:
call psa_sign_message() on the message;
or calculate the SHA-512 hash of the message with psa_hash_compute() or with a multi-part hash operation started with psa_hash_setup(), using the hash algorithm PSA_ALG_SHA_512, then sign the calculated hash with psa_sign_hash(). Verifying a signature is similar, using psa_verify_message() or psa_verify_hash() instead of the signature function.
1599
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ED448PH#
#define PSA_ALG_ED448PHValue:
(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.
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:
call psa_sign_message() on the message;
or calculate the first 64 bytes of the SHAKE256 output of the message with psa_hash_compute() or with a multi-part hash operation started with psa_hash_setup(), using the hash algorithm PSA_ALG_SHAKE256_512, then sign the calculated hash with psa_sign_hash(). Verifying a signature is similar, using psa_verify_message() or psa_verify_hash() instead of the signature function.
1624
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_VENDOR_HASH_AND_SIGN#
#define PSA_ALG_IS_VENDOR_HASH_AND_SIGNValue:
(alg)
1630
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_SIGN_HASH#
#define PSA_ALG_IS_SIGN_HASHValue:
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:
PSA_ALG_RSA_PKCS1V15_SIGN_RAW (expects its input to be an encoded hash)
PSA_ALG_ECDSA_ANY (doesn't specify what kind of hash the input is)
Returns
1 if alg is a signature algorithm that can be used to sign a hash. 0 if alg is a signature algorithm that can only be used to sign a message. 0 if alg is not a signature algorithm. This macro can return either 0 or 1 if alg is not a supported algorithm identifier.
1649
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_SIGN_MESSAGE#
#define PSA_ALG_IS_SIGN_MESSAGEValue:
(alg)
Whether the specified algorithm is a signature algorithm that can be used with psa_sign_message() and psa_verify_message().
Returns
1 if alg is a signature algorithm that can be used to sign a message. 0 if
alg
is a signature algorithm that can only be used to sign an already-calculated hash. 0 ifalg
is not a signature algorithm. This macro can return either 0 or 1 ifalg
is not a supported algorithm identifier.
1665
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_HASH_AND_SIGN#
#define PSA_ALG_IS_HASH_AND_SIGNValue:
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().
Returns
1 if
alg
is a hash-and-sign algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
1694
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_SIGN_GET_HASH#
#define PSA_ALG_SIGN_GET_HASHValue:
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.
Returns
The underlying hash algorithm if
alg
is a hash-and-sign algorithm.0 if
alg
is a signature algorithm that does not follow the hash-and-sign structure.Unspecified if
alg
is not a signature algorithm or if it is not supported by the implementation.
1716
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_PKCS1V15_CRYPT#
#define PSA_ALG_RSA_PKCS1V15_CRYPTValue:
((psa_algorithm_t)0x07000200)
RSA PKCS#1 v1.5 encryption.
1723
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_OAEP_BASE#
#define PSA_ALG_RSA_OAEP_BASEValue:
((psa_algorithm_t)0x07000300)
1725
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_OAEP#
#define PSA_ALG_RSA_OAEPValue:
(hash_alg)
RSA 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.
Returns
The corresponding RSA OAEP encryption algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1740
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_RSA_OAEP#
#define PSA_ALG_IS_RSA_OAEPValue:
(alg)
1742
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_RSA_OAEP_GET_HASH#
#define PSA_ALG_RSA_OAEP_GET_HASHValue:
1744
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HKDF_BASE#
#define PSA_ALG_HKDF_BASEValue:
((psa_algorithm_t)0x08000100)
1749
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HKDF#
#define PSA_ALG_HKDFValue:
(hash_alg)
Macro to build an HKDF algorithm.
For example, PSA_ALG_HKDF(PSA_ALG_SHA256)
is HKDF using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_KEY_DERIVATION_INPUT_SALT is the salt used in the "extract" step. It is optional; if omitted, the derivation uses an empty salt.
PSA_KEY_DERIVATION_INPUT_SECRET is the secret key used in the "extract" step.
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.
Warnings
HKDF processes the salt as follows: first hash it with hash_alg if the salt is longer than the block size of the hash algorithm; then pad with null bytes up to the block size. As a result, it is possible for distinct salt inputs to result in the same outputs. To ensure unique outputs, it is recommended to use a fixed length for salt values.
Returns
The corresponding HKDF algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1776
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_HKDF#
#define PSA_ALG_IS_HKDFValue:
(alg)
Whether 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.
Returns
1 if
alg
is an HKDF algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1789
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HKDF_GET_HASH#
#define PSA_ALG_HKDF_GET_HASHValue:
(hkdf_alg)
1791
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HKDF_EXTRACT_BASE#
#define PSA_ALG_HKDF_EXTRACT_BASEValue:
((psa_algorithm_t)0x08000400)
1794
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HKDF_EXTRACT#
#define PSA_ALG_HKDF_EXTRACTValue:
(hash_alg)
Macro to build an HKDF-Extract algorithm.
For example, PSA_ALG_HKDF_EXTRACT(PSA_ALG_SHA256)
is HKDF-Extract using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_KEY_DERIVATION_INPUT_SALT is the salt.
PSA_KEY_DERIVATION_INPUT_SECRET is the input keying material used in the "extract" step. The inputs are mandatory and must be passed in the order above. Each input may only be passed once.
Warnings
HKDF-Extract is not meant to be used on its own. PSA_ALG_HKDF should be used instead if possible. PSA_ALG_HKDF_EXTRACT is provided as a separate algorithm for the sake of protocols that use it as a building block. It may also be a slight performance optimization in applications that use HKDF with the same salt and key but many different info strings.
HKDF processes the salt as follows: first hash it with hash_alg if the salt is longer than the block size of the hash algorithm; then pad with null bytes up to the block size. As a result, it is possible for distinct salt inputs to result in the same outputs. To ensure unique outputs, it is recommended to use a fixed length for salt values.
Returns
The corresponding HKDF-Extract algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1827
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_HKDF_EXTRACT#
#define PSA_ALG_IS_HKDF_EXTRACTValue:
(alg)
Whether 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.
Returns
1 if
alg
is an HKDF-Extract algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1840
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HKDF_EXPAND_BASE#
#define PSA_ALG_HKDF_EXPAND_BASEValue:
((psa_algorithm_t)0x08000500)
1843
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_HKDF_EXPAND#
#define PSA_ALG_HKDF_EXPANDValue:
(hash_alg)
Macro to build an HKDF-Expand algorithm.
For example, PSA_ALG_HKDF_EXPAND(PSA_ALG_SHA256)
is HKDF-Expand using HMAC-SHA-256.
This key derivation algorithm uses the following inputs:
PSA_KEY_DERIVATION_INPUT_SECRET is the pseudorandom key (PRK).
PSA_KEY_DERIVATION_INPUT_INFO is the info string.
The inputs are mandatory and must be passed in the order above. Each input may only be passed once.
Warnings
HKDF-Expand is not meant to be used on its own.
PSA_ALG_HKDF
should be used instead if possible.PSA_ALG_HKDF_EXPAND
is provided as a separate algorithm for the sake of protocols that use it as a building block. It may also be a slight performance optimization in applications that use HKDF with the same salt and key but many different info strings.
Returns
The corresponding HKDF-Expand algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1869
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_HKDF_EXPAND#
#define PSA_ALG_IS_HKDF_EXPANDValue:
(alg)
Whether 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.
Returns
1 if
alg
is an HKDF-Expand algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1882
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_ANY_HKDF#
#define PSA_ALG_IS_ANY_HKDFValue:
Whether the specified algorithm is an HKDF or HKDF-Extract or HKDF-Expand algorithm.
Returns
1 if
alg
is any HKDF type algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1895
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_TLS12_PRF_BASE#
#define PSA_ALG_TLS12_PRF_BASEValue:
((psa_algorithm_t)0x08000200)
1900
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_TLS12_PRF#
#define PSA_ALG_TLS12_PRFValue:
(hash_alg)
Macro 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:
PSA_KEY_DERIVATION_INPUT_SEED is the seed.
PSA_KEY_DERIVATION_INPUT_SECRET is the secret key.
PSA_KEY_DERIVATION_INPUT_LABEL is the label.
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_SHA256)
represents the TLS 1.2 PRF using HMAC-SHA-256.
Returns
The corresponding TLS-1.2 PRF algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1927
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_TLS12_PRF#
#define PSA_ALG_IS_TLS12_PRFValue:
(alg)
Whether the specified algorithm is a TLS-1.2 PRF algorithm.
Returns
1 if
alg
is a TLS-1.2 PRF algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
1938
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_TLS12_PRF_GET_HASH#
#define PSA_ALG_TLS12_PRF_GET_HASHValue:
(hkdf_alg)
1940
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_TLS12_PSK_TO_MS_BASE#
#define PSA_ALG_TLS12_PSK_TO_MS_BASEValue:
((psa_algorithm_t)0x08000300)
1943
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_TLS12_PSK_TO_MS#
#define PSA_ALG_TLS12_PSK_TO_MSValue:
(hash_alg)
Macro 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:
PSA_KEY_DERIVATION_INPUT_SEED is the seed.
PSA_KEY_DERIVATION_INPUT_OTHER_SECRET is the other secret for the computation of the premaster secret. This input is optional; if omitted, it defaults to a string of null bytes with the same length as the secret (PSK) input.
PSA_KEY_DERIVATION_INPUT_SECRET is the secret key.
PSA_KEY_DERIVATION_INPUT_LABEL is the label.
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 a plain PSK cipher suite (RFC 4279, Section 2), omit PSA_KEY_DERIVATION_INPUT_OTHER_SECRET
for a DHE-PSK (RFC 4279, Section 3) or ECDHE-PSK cipher suite (RFC 5489, Section 2), the other secret should be the output of the PSA_ALG_FFDH or PSA_ALG_ECDH key agreement performed with the peer. The recommended way to pass this input is to use a key derivation algorithm constructed as PSA_ALG_KEY_AGREEMENT(ka_alg, PSA_ALG_TLS12_PSK_TO_MS(hash_alg)) and to call psa_key_derivation_key_agreement(). Alternatively, this input may be an output of
psa_raw_key_agreement()
passed with psa_key_derivation_input_bytes(), or an equivalent input passed with psa_key_derivation_input_bytes() or psa_key_derivation_input_key().for a RSA-PSK cipher suite (RFC 4279, Section 4), the other secret should be the 48-byte client challenge (the PreMasterSecret of (RFC 5246, Section 7.4.7.1)) concatenation of the TLS version and a 46-byte random string chosen by the client. On the server, this is typically an output of psa_asymmetric_decrypt() using PSA_ALG_RSA_PKCS1V15_CRYPT, passed to the key derivation operation with
psa_key_derivation_input_bytes()
.
For example, PSA_ALG_TLS12_PSK_TO_MS(PSA_ALG_SHA256)
represents the TLS-1.2 PSK to MasterSecret derivation PRF using HMAC-SHA-256.
Returns
The corresponding TLS-1.2 PSK to MS algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
1997
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_TLS12_PSK_TO_MS#
#define PSA_ALG_IS_TLS12_PSK_TO_MSValue:
(alg)
Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
Returns
1 if
alg
is a TLS-1.2 PSK to MS algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
2008
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_TLS12_PSK_TO_MS_GET_HASH#
#define PSA_ALG_TLS12_PSK_TO_MS_GET_HASHValue:
(hkdf_alg)
2010
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_KEY_DERIVATION_STRETCHING_FLAG#
#define PSA_ALG_KEY_DERIVATION_STRETCHING_FLAGValue:
((psa_algorithm_t)0x00800000)
2020
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_PBKDF2_HMAC_BASE#
#define PSA_ALG_PBKDF2_HMAC_BASEValue:
((psa_algorithm_t)0x08800100)
2022
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_PBKDF2_HMAC#
#define PSA_ALG_PBKDF2_HMACValue:
(hash_alg)
Macro 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_SHA256)
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_KEY_DERIVATION_INPUT_COST is the iteration count. This input step must be used exactly once.
PSA_KEY_DERIVATION_INPUT_SALT is the salt. This input step must be used one or more times; if used several times, the inputs will be concatenated. This can be used to build the final salt from multiple sources, both public and secret (also known as pepper).
PSA_KEY_DERIVATION_INPUT_PASSWORD is the password to be hashed. This input step must be used exactly once.
Returns
The corresponding PBKDF2-HMAC-XXX algorithm.
Unspecified if
hash_alg
is not a supported hash algorithm.
2049
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_PBKDF2_HMAC#
#define PSA_ALG_IS_PBKDF2_HMACValue:
(alg)
Whether the specified algorithm is a PBKDF2-HMAC algorithm.
Returns
1 if
alg
is a PBKDF2-HMAC algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key derivation algorithm identifier.
2060
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_PBKDF2_AES_CMAC_PRF_128#
#define PSA_ALG_PBKDF2_AES_CMAC_PRF_128Value:
((psa_algorithm_t)0x08800200)
The 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.
2072
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_KEY_DERIVATION_MASK#
#define PSA_ALG_KEY_DERIVATION_MASKValue:
((psa_algorithm_t)0xfe00ffff)
2074
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT_MASK#
#define PSA_ALG_KEY_AGREEMENT_MASKValue:
((psa_algorithm_t)0xffff0000)
2075
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT#
#define PSA_ALG_KEY_AGREEMENTValue:
(ka_alg, kdf_alg)
Macro to build a combined algorithm that chains a key agreement with a key derivation.
Returns
The corresponding key agreement and derivation algorithm.
Unspecified if
ka_alg
is not a supported key agreement algorithm orkdf_alg
is not a supported key derivation algorithm.
2091
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT_GET_KDF#
#define PSA_ALG_KEY_AGREEMENT_GET_KDFValue:
(alg)
2094
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_KEY_AGREEMENT_GET_BASE#
#define PSA_ALG_KEY_AGREEMENT_GET_BASEValue:
(alg)
2097
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_RAW_KEY_AGREEMENT#
#define PSA_ALG_IS_RAW_KEY_AGREEMENTValue:
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().
Returns
1 if
alg
is a raw key agreement algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported algorithm identifier.
2114
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENT#
#define PSA_ALG_IS_KEY_DERIVATION_OR_AGREEMENTValue:
(alg)
2118
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_FFDH#
#define PSA_ALG_FFDHValue:
((psa_algorithm_t)0x09010000)
The 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.
2128
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_FFDH#
#define PSA_ALG_IS_FFDHValue:
(alg)
Whether 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.
Returns
1 if
alg
is a finite field Diffie-Hellman algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key agreement algorithm identifier.
2142
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_ECDH#
#define PSA_ALG_ECDHValue:
((psa_algorithm_t)0x09020000)
The 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.
For Montgomery curves (curve types
PSA_ECC_FAMILY_CURVEXXX
), the shared secret is the x-coordinate ofd_A Q_B = d_B Q_A
in little-endian byte order. The bit size is 448 for Curve448 and 255 for Curve25519.For Weierstrass curves over prime fields (curve types
PSA_ECC_FAMILY_SECPXXX
andPSA_ECC_FAMILY_BRAINPOOL_PXXX
), the shared secret is the x-coordinate ofd_A Q_B = d_B Q_A
in big-endian byte order. The bit size ism = ceiling(log_2(p))
for the fieldF_p
.For Weierstrass curves over binary fields (curve types
PSA_ECC_FAMILY_SECTXXX
), the shared secret is the x-coordinate ofd_A Q_B = d_B Q_A
in big-endian byte order. The bit size ism
for the fieldF_{2^m}
.
2170
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_ECDH#
#define PSA_ALG_IS_ECDHValue:
(alg)
Whether 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.
Returns
1 if
alg
is an elliptic curve Diffie-Hellman algorithm, 0 otherwise. This macro may return either 0 or 1 ifalg
is not a supported key agreement algorithm identifier.
2186
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_IS_WILDCARD#
#define PSA_ALG_IS_WILDCARDValue:
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.
Returns
1 if
alg
is a wildcard algorithm encoding.0 if
alg
is a non-wildcard algorithm encoding (suitable for an operation).This macro may return either 0 or 1 if
alg
is not a supported algorithm identifier.
2202
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h
PSA_ALG_GET_HASH#
#define PSA_ALG_GET_HASHValue:
(alg)
Get the hash used by a composite algorithm.
Returns
The underlying hash algorithm if alg is a composite algorithm that uses a hash algorithm.
0
if alg is not a composite algorithm that uses a hash.
2220
of file util/third_party/trusted-firmware-m/interface/include/psa/crypto_values.h