Lines Matching full:algorithm
70 * parameter such as a key type, algorithm, etc. is not recognized.
240 * an algorithm with a randomized result, as well as functions that
337 /** \defgroup crypto_types Key and algorithm types
430 * The key policy determines which underlying hash algorithm the key can be
435 * \c alg is the HMAC algorithm or the underlying hash algorithm. */
446 * The key policy determines which key derivation algorithm the key
469 * The key policy determines which key derivation algorithm the key can be
476 * The key policy determines which key derivation algorithm the key
484 * The key policy determines which key derivation algorithm the key
489 /** Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
496 /** Key for a cipher, AEAD or MAC algorithm based on the
500 /** Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
511 /** Key for a cipher, AEAD or MAC algorithm based on the
515 /** Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
656 * The algorithm #PSA_ALG_ECDH performs X25519 when used with this curve.
659 * The algorithm #PSA_ALG_ECDH performs X448 when used with this curve.
749 /* Note that algorithm values are embedded in the persistent key store,
754 /** Vendor-defined algorithm flag.
773 /** Whether an algorithm is vendor-defined.
780 /** Whether the specified algorithm is a hash algorithm.
782 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
784 * \return 1 if \p alg is a hash algorithm, 0 otherwise.
786 * algorithm identifier.
791 /** Whether the specified algorithm is a MAC algorithm.
793 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
795 * \return 1 if \p alg is a MAC algorithm, 0 otherwise.
797 * algorithm identifier.
802 /** Whether the specified algorithm is a symmetric cipher algorithm.
804 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
806 * \return 1 if \p alg is a symmetric cipher algorithm, 0 otherwise.
808 * algorithm identifier.
813 /** Whether the specified algorithm is an authenticated encryption
814 * with associated data (AEAD) algorithm.
816 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
818 * \return 1 if \p alg is an AEAD algorithm, 0 otherwise.
820 * algorithm identifier.
825 /** Whether the specified algorithm is an asymmetric signature algorithm,
826 * also known as public-key signature algorithm.
828 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
830 * \return 1 if \p alg is an asymmetric signature algorithm, 0 otherwise.
832 * algorithm identifier.
837 /** Whether the specified algorithm is an asymmetric encryption algorithm,
838 * also known as public-key encryption algorithm.
840 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
842 * \return 1 if \p alg is an asymmetric encryption algorithm, 0 otherwise.
844 * algorithm identifier.
849 /** Whether the specified algorithm is a key agreement algorithm.
851 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
853 * \return 1 if \p alg is a key agreement algorithm, 0 otherwise.
855 * algorithm identifier.
860 /** Whether the specified algorithm is a key derivation algorithm.
862 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
864 * \return 1 if \p alg is a key derivation algorithm, 0 otherwise.
866 * algorithm identifier.
871 /** Whether the specified algorithm is a key stretching / password hashing
872 * algorithm.
874 * A key stretching / password hashing algorithm is a key derivation algorithm
876 * Equivalently, it's a key derivation algorithm that uses a
879 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
881 * \return 1 if \p alg is a key stretching / password hashing algorithm, 0
883 * supported algorithm identifier.
889 /** An invalid algorithm identifier value. */
929 /** In a hash-and-sign algorithm policy, allow any hash algorithm.
931 * This value may be used to form the algorithm usage field of a policy
932 * for a signature algorithm that is parametrized by a hash. The key
934 * algorithm parametrized with any supported hash.
947 * an algorithm built from `PSA_xxx_SIGNATURE` and a specific hash. Each
957 * an algorithm \c alg, #PSA_ALG_IS_HASH_AND_SIGN(\c alg) is true.
959 * This value may not be used to build an algorithm specification to
966 /** Macro to build an HMAC algorithm.
970 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
973 * \return The corresponding HMAC algorithm.
975 * hash algorithm.
983 /** Whether the specified algorithm is an HMAC algorithm.
987 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
989 * \return 1 if \p alg is an HMAC algorithm, 0 otherwise.
991 * algorithm identifier.
997 /* In the encoding of a MAC algorithm, the bits corresponding to
999 * truncated. As an exception, the value 0 means the untruncated algorithm,
1007 /* In the encoding of a MAC algorithm, the bit corresponding to
1008 * #PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm
1009 * is a wildcard algorithm. A key with such wildcard algorithm as permitted
1010 * algorithm policy can be used with any algorithm corresponding to the
1015 /** Macro to build a truncated MAC algorithm.
1017 * A truncated MAC algorithm is identical to the corresponding MAC
1018 * algorithm except that the MAC value for the truncated algorithm
1020 * for the untruncated algorithm.
1022 * \note This macro may allow constructing algorithm identifiers that
1029 * algorithm is considered identical to the untruncated algorithm
1032 * \param mac_alg A MAC algorithm identifier (value of type
1035 * MAC algorithm.
1042 * \return The corresponding MAC algorithm with the specified
1045 * MAC algorithm or if \p mac_length is too small or
1046 * too large for the specified MAC algorithm.
1053 /** Macro to build the base MAC algorithm corresponding to a truncated
1054 * MAC algorithm.
1056 * \param mac_alg A MAC algorithm identifier (value of type
1059 * MAC algorithm.
1061 * \return The corresponding base MAC algorithm.
1063 * MAC algorithm.
1069 /** Length to which a MAC algorithm is truncated.
1071 * \param mac_alg A MAC algorithm identifier (value of type
1076 * \return 0 if \p mac_alg is a non-truncated MAC algorithm.
1078 * MAC algorithm.
1083 /** Macro to build a MAC minimum-MAC-length wildcard algorithm.
1085 * A minimum-MAC-length MAC wildcard algorithm permits all MAC algorithms
1086 * sharing the same base algorithm, and where the (potentially truncated) MAC
1087 * length of the specific algorithm is equal to or larger then the wildcard
1088 * algorithm's minimum MAC length.
1091 * smallest MAC length allowed by the base algorithm, this effectively
1092 * becomes an 'any-MAC-length-allowed' policy for that base algorithm.
1094 * \param mac_alg A MAC algorithm identifier (value of type
1101 * \return The corresponding MAC wildcard algorithm with the
1104 * algorithm or if \p min_mac_length is less than 1 or
1105 * too large for the specified MAC algorithm.
1121 /** Whether the specified algorithm is a MAC algorithm based on a block cipher.
1123 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1125 * \return 1 if \p alg is a MAC algorithm based on a block cipher, 0 otherwise.
1127 * algorithm identifier.
1136 /** Whether the specified algorithm is a stream cipher.
1142 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1144 * \return 1 if \p alg is a stream cipher algorithm, 0 otherwise.
1146 * algorithm identifier or if it is not a symmetric cipher algorithm.
1152 /** The stream cipher mode of a stream cipher algorithm.
1163 * For example, to use AES-128-CTR, use this algorithm with
1203 * multi-part cipher operation with this algorithm, psa_cipher_generate_iv()
1227 /** Whether the specified algorithm is an AEAD mode on a block cipher.
1229 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1231 * \return 1 if \p alg is an AEAD algorithm which is an AEAD mode based on
1234 * algorithm identifier.
1240 /** The CCM authenticated encryption algorithm.
1249 * For CCM* with a nonzero tag length, use the AEAD algorithm #PSA_ALG_CCM.
1257 /** The GCM authenticated encryption algorithm.
1263 /** The Chacha20-Poly1305 AEAD algorithm.
1274 /* In the encoding of an AEAD algorithm, the bits corresponding to
1281 /* In the encoding of an AEAD algorithm, the bit corresponding to
1282 * #PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm
1283 * is a wildcard algorithm. A key with such wildcard algorithm as permitted
1284 * algorithm policy can be used with any algorithm corresponding to the
1289 /** Macro to build a shortened AEAD algorithm.
1291 * A shortened AEAD algorithm is similar to the corresponding AEAD
1292 * algorithm, but has an authentication tag that consists of fewer bytes.
1293 * Depending on the algorithm, the tag length may affect the calculation
1296 * \param aead_alg An AEAD algorithm identifier (value of type
1301 * \return The corresponding AEAD algorithm with the specified
1304 * AEAD algorithm or if \p tag_length is not valid
1305 * for the specified AEAD algorithm.
1313 /** Retrieve the tag length of a specified AEAD algorithm
1315 * \param aead_alg An AEAD algorithm identifier (value of type
1319 * \return The tag length specified by the input algorithm.
1321 * AEAD algorithm.
1327 /** Calculate the corresponding AEAD algorithm with the default tag length.
1329 * \param aead_alg An AEAD algorithm (\c PSA_ALG_XXX value such that
1332 * \return The corresponding AEAD algorithm with the default
1333 * tag length for that algorithm.
1346 /** Macro to build an AEAD minimum-tag-length wildcard algorithm.
1348 * A minimum-tag-length AEAD wildcard algorithm permits all AEAD algorithms
1349 * sharing the same base algorithm, and where the tag length of the specific
1350 * algorithm is equal to or larger then the minimum tag length specified by the
1351 * wildcard algorithm.
1354 * smallest tag length allowed by the base algorithm, this effectively
1355 * becomes an 'any-tag-length-allowed' policy for that base algorithm.
1357 * \param aead_alg An AEAD algorithm identifier (value of type
1362 * allowed tag length of the algorithm.
1364 * \return The corresponding AEAD wildcard algorithm with the
1367 * AEAD algorithm or if \p min_tag_length is less than 1
1368 * or too large for the specified AEAD algorithm.
1381 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1384 * when specifying the algorithm in a usage policy.
1386 * \return The corresponding RSA PKCS#1 v1.5 signature algorithm.
1388 * hash algorithm.
1394 * The input to this algorithm is the DigestInfo structure used by
1410 * possible salt length for the algorithm and key size if that is
1411 * smaller than the hash length. The specified hash algorithm is
1415 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1418 * when specifying the algorithm in a usage policy.
1420 * \return The corresponding RSA PSS signature algorithm.
1422 * hash algorithm.
1429 * This algorithm has the same behavior as #PSA_ALG_RSA_PSS when signing,
1433 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1436 * when specifying the algorithm in a usage policy.
1438 * \return The corresponding RSA PSS signature algorithm.
1440 * hash algorithm.
1445 /** Whether the specified algorithm is RSA PSS with standard salt.
1447 * \param alg An algorithm value or an algorithm policy wildcard.
1451 * where \c hash_alg is a hash algorithm or
1454 * a supported algorithm identifier or policy.
1459 /** Whether the specified algorithm is RSA PSS with any salt.
1461 * \param alg An algorithm value or an algorithm policy wildcard.
1465 * where \c hash_alg is a hash algorithm or
1468 * a supported algorithm identifier or policy.
1473 /** Whether the specified algorithm is RSA PSS.
1475 * This includes any of the RSA PSS algorithm variants, regardless of the
1478 * \param alg An algorithm value or an algorithm policy wildcard.
1483 * where \c hash_alg is a hash algorithm or
1486 * a supported algorithm identifier or policy.
1504 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1507 * when specifying the algorithm in a usage policy.
1509 * \return The corresponding ECDSA signature algorithm.
1511 * hash algorithm.
1518 * without specifying a hash algorithm. This algorithm may only be
1532 * Note that when this algorithm is used for verification, signatures
1538 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1541 * when specifying the algorithm in a usage policy.
1544 * algorithm.
1546 * hash algorithm.
1561 /** Edwards-curve digital signature algorithm without prehashing (PureEdDSA),
1567 * suitable functions and extend this algorithm to support contexts.
1581 * This algorithm can be used with psa_sign_message() and
1595 /** Edwards-curve digital signature algorithm with prehashing (HashEdDSA),
1600 * This algorithm is Ed25519 as specified in RFC 8032.
1605 * This is a hash-and-sign algorithm: to calculate a signature,
1611 * using the hash algorithm #PSA_ALG_SHA_512,
1619 /** Edwards-curve digital signature algorithm with prehashing (HashEdDSA),
1624 * This algorithm is Ed448 as specified in RFC 8032.
1630 * This is a hash-and-sign algorithm: to calculate a signature,
1636 * using the hash algorithm #PSA_ALG_SHAKE256_512,
1649 /** Whether the specified algorithm is a signature algorithm that can be used
1658 * \param alg An algorithm identifier (value of type psa_algorithm_t).
1660 * \return 1 if alg is a signature algorithm that can be used to sign a
1661 * hash. 0 if alg is a signature algorithm that can only be used
1662 * to sign a message. 0 if alg is not a signature algorithm.
1664 * supported algorithm identifier.
1671 /** Whether the specified algorithm is a signature algorithm that can be used
1674 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1676 * \return 1 if alg is a signature algorithm that can be used to sign a
1677 * message. 0 if \p alg is a signature algorithm that can only be used
1679 * algorithm. This macro can return either 0 or 1 if \p alg is not a
1680 * supported algorithm identifier.
1685 /** Whether the specified algorithm is a hash-and-sign algorithm.
1692 * to extract this algorithm.
1694 * Thus, for a hash-and-sign algorithm,
1705 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1707 * \return 1 if \p alg is a hash-and-sign algorithm, 0 otherwise.
1709 * algorithm identifier.
1715 /** Get the hash used by a hash-and-sign signature algorithm.
1717 * A hash-and-sign algorithm is a signature algorithm which is
1723 * \param alg A signature algorithm (\c PSA_ALG_XXX value such that
1726 * \return The underlying hash algorithm if \p alg is a hash-and-sign
1727 * algorithm.
1728 * \return 0 if \p alg is a signature algorithm that does not
1730 * \return Unspecified if \p alg is not a signature algorithm or
1740 * \warning Calling psa_asymmetric_decrypt() with this algorithm as a
1756 * \param hash_alg The hash algorithm (\c PSA_ALG_XXX value such that
1760 * \return The corresponding RSA OAEP encryption algorithm.
1762 * hash algorithm.
1774 /** Macro to build an HKDF algorithm.
1778 * This key derivation algorithm uses the following inputs:
1788 * if the salt is longer than the block size of the hash algorithm; then
1793 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1796 * \return The corresponding HKDF algorithm.
1798 * hash algorithm.
1802 /** Whether the specified algorithm is an HKDF algorithm.
1807 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1809 * \return 1 if \c alg is an HKDF algorithm, 0 otherwise.
1811 * key derivation algorithm identifier.
1819 /** Macro to build an HKDF-Extract algorithm.
1824 * This key derivation algorithm uses the following inputs:
1833 * as a separate algorithm for the sake of protocols that use it as a
1839 * if the salt is longer than the block size of the hash algorithm; then
1844 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1847 * \return The corresponding HKDF-Extract algorithm.
1849 * hash algorithm.
1853 /** Whether the specified algorithm is an HKDF-Extract algorithm.
1858 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1860 * \return 1 if \c alg is an HKDF-Extract algorithm, 0 otherwise.
1862 * key derivation algorithm identifier.
1868 /** Macro to build an HKDF-Expand algorithm.
1873 * This key derivation algorithm uses the following inputs:
1882 * a separate algorithm for the sake of protocols that use it as a building
1886 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1889 * \return The corresponding HKDF-Expand algorithm.
1891 * hash algorithm.
1895 /** Whether the specified algorithm is an HKDF-Expand algorithm.
1900 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1902 * \return 1 if \c alg is an HKDF-Expand algorithm, 0 otherwise.
1904 * key derivation algorithm identifier.
1909 /** Whether the specified algorithm is an HKDF or HKDF-Extract or
1910 * HKDF-Expand algorithm.
1913 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1915 * \return 1 if \c alg is any HKDF type algorithm, 0 otherwise.
1917 * key derivation algorithm identifier.
1925 /** Macro to build a TLS-1.2 PRF algorithm.
1931 * This key derivation algorithm uses the following inputs, which must be
1944 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1947 * \return The corresponding TLS-1.2 PRF algorithm.
1949 * hash algorithm.
1954 /** Whether the specified algorithm is a TLS-1.2 PRF algorithm.
1956 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1958 * \return 1 if \c alg is a TLS-1.2 PRF algorithm, 0 otherwise.
1960 * key derivation algorithm identifier.
1968 /** Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm.
1976 * This key derivation algorithm uses the following inputs, which must be
1997 * algorithm constructed as
2014 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
2017 * \return The corresponding TLS-1.2 PSK to MS algorithm.
2019 * hash algorithm.
2024 /** Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
2026 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2028 * \return 1 if \c alg is a TLS-1.2 PSK to MS algorithm, 0 otherwise.
2030 * key derivation algorithm identifier.
2051 /* This flag indicates whether the key derivation algorithm is suitable for
2056 * Those algorithms cannot be combined with a key agreement algorithm.
2061 /** Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm.
2064 * This macro specifies the PBKDF2 algorithm constructed using a PRF based on
2069 * This key derivation algorithm uses the following inputs, which must be
2080 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
2083 * \return The corresponding PBKDF2-HMAC-XXX algorithm.
2085 * hash algorithm.
2090 /** Whether the specified algorithm is a PBKDF2-HMAC algorithm.
2092 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2094 * \return 1 if \c alg is a PBKDF2-HMAC algorithm, 0 otherwise.
2096 * key derivation algorithm identifier.
2102 /** The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.
2105 * This macro specifies the PBKDF2 algorithm constructed using the
2108 * This key derivation algorithm uses the same inputs as
2120 /** Macro to build a combined algorithm that chains a key agreement with
2123 * \param ka_alg A key agreement algorithm (\c PSA_ALG_XXX value such
2125 * \param kdf_alg A key derivation algorithm (\c PSA_ALG_XXX value such
2129 * algorithm.
2131 * key agreement algorithm or \p kdf_alg is not a
2132 * supported key derivation algorithm.
2143 /** Whether the specified algorithm is a raw key agreement algorithm.
2145 * A raw key agreement algorithm is one that does not specify
2151 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2153 * \return 1 if \p alg is a raw key agreement algorithm, 0 otherwise.
2155 * algorithm identifier.
2164 /** The finite-field Diffie-Hellman (DH) key agreement algorithm.
2173 /** Whether the specified algorithm is a finite field Diffie-Hellman algorithm.
2175 * This includes the raw finite field Diffie-Hellman algorithm as well as
2177 * algorithm.
2179 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2181 * \return 1 if \c alg is a finite field Diffie-Hellman algorithm, 0 otherwise.
2183 * key agreement algorithm identifier.
2188 /** The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.
2215 /** Whether the specified algorithm is an elliptic curve Diffie-Hellman
2216 * algorithm.
2218 * This includes the raw elliptic curve Diffie-Hellman algorithm as well as
2220 * algorithm.
2222 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2224 * \return 1 if \c alg is an elliptic curve Diffie-Hellman algorithm,
2227 * key agreement algorithm identifier.
2232 /** Whether the specified algorithm encoding is a wildcard.
2234 * Wildcard values may only be used to set the usage algorithm field in
2237 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2239 * \return 1 if \c alg is a wildcard algorithm encoding.
2240 * \return 0 if \c alg is a non-wildcard algorithm encoding (suitable for
2243 * algorithm identifier.
2254 /** Get the hash used by a composite algorithm.
2256 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2258 * \return The underlying hash algorithm if alg is a composite algorithm that
2259 * uses a hash algorithm.
2261 * \return \c 0 if alg is not a composite algorithm that uses a hash.
2732 /** Check if two AEAD algorithm identifiers refer to the same AEAD algorithm
2735 * \param aead_alg_1 An AEAD algorithm identifier.
2736 * \param aead_alg_2 An AEAD algorithm identifier.
2738 * \return 1 if both identifiers refer to the same AEAD algorithm,
2741 * a supported AEAD algorithm.