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
342 /** \defgroup crypto_types Key and algorithm types
435 * The key policy determines which underlying hash algorithm the key can be
440 * \c alg is the HMAC algorithm or the underlying hash algorithm. */
451 * The key policy determines which key derivation algorithm the key
474 * The key policy determines which key derivation algorithm the key can be
481 * The key policy determines which key derivation algorithm the key
489 * The key policy determines which key derivation algorithm the key
494 /** Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
501 /** Key for a cipher, AEAD or MAC algorithm based on the
505 /** Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
516 /** Key for a cipher, AEAD or MAC algorithm based on the
520 /** Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
674 * The algorithm #PSA_ALG_ECDH performs X25519 when used with this curve.
677 * The algorithm #PSA_ALG_ECDH performs X448 when used with this curve.
769 /* Note that algorithm values are embedded in the persistent key store,
774 /** Vendor-defined algorithm flag.
793 /** Whether an algorithm is vendor-defined.
800 /** Whether the specified algorithm is a hash algorithm.
802 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
804 * \return 1 if \p alg is a hash algorithm, 0 otherwise.
806 * algorithm identifier.
811 /** Whether the specified algorithm is a MAC algorithm.
813 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
815 * \return 1 if \p alg is a MAC algorithm, 0 otherwise.
817 * algorithm identifier.
822 /** Whether the specified algorithm is a symmetric cipher algorithm.
824 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
826 * \return 1 if \p alg is a symmetric cipher algorithm, 0 otherwise.
828 * algorithm identifier.
833 /** Whether the specified algorithm is an authenticated encryption
834 * with associated data (AEAD) algorithm.
836 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
838 * \return 1 if \p alg is an AEAD algorithm, 0 otherwise.
840 * algorithm identifier.
845 /** Whether the specified algorithm is an asymmetric signature algorithm,
846 * also known as public-key signature algorithm.
848 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
850 * \return 1 if \p alg is an asymmetric signature algorithm, 0 otherwise.
852 * algorithm identifier.
857 /** Whether the specified algorithm is an asymmetric encryption algorithm,
858 * also known as public-key encryption algorithm.
860 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
862 * \return 1 if \p alg is an asymmetric encryption algorithm, 0 otherwise.
864 * algorithm identifier.
869 /** Whether the specified algorithm is a key agreement algorithm.
871 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
873 * \return 1 if \p alg is a key agreement algorithm, 0 otherwise.
875 * algorithm identifier.
880 /** Whether the specified algorithm is a key derivation algorithm.
882 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
884 * \return 1 if \p alg is a key derivation algorithm, 0 otherwise.
886 * algorithm identifier.
891 /** Whether the specified algorithm is a key stretching / password hashing
892 * algorithm.
894 * A key stretching / password hashing algorithm is a key derivation algorithm
896 * Equivalently, it's a key derivation algorithm that uses a
899 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
901 * \return 1 if \p alg is a key stretching / password hashing algorithm, 0
903 * supported algorithm identifier.
909 /** An invalid algorithm identifier value. */
949 /** In a hash-and-sign algorithm policy, allow any hash algorithm.
951 * This value may be used to form the algorithm usage field of a policy
952 * for a signature algorithm that is parametrized by a hash. The key
954 * algorithm parametrized with any supported hash.
967 * an algorithm built from `PSA_xxx_SIGNATURE` and a specific hash. Each
977 * an algorithm \c alg, #PSA_ALG_IS_HASH_AND_SIGN(\c alg) is true.
979 * This value may not be used to build an algorithm specification to
986 /** Macro to build an HMAC algorithm.
990 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
993 * \return The corresponding HMAC algorithm.
995 * hash algorithm.
1003 /** Whether the specified algorithm is an HMAC algorithm.
1007 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1009 * \return 1 if \p alg is an HMAC algorithm, 0 otherwise.
1011 * algorithm identifier.
1017 /* In the encoding of a MAC algorithm, the bits corresponding to
1019 * truncated. As an exception, the value 0 means the untruncated algorithm,
1027 /* In the encoding of a MAC algorithm, the bit corresponding to
1028 * #PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm
1029 * is a wildcard algorithm. A key with such wildcard algorithm as permitted
1030 * algorithm policy can be used with any algorithm corresponding to the
1035 /** Macro to build a truncated MAC algorithm.
1037 * A truncated MAC algorithm is identical to the corresponding MAC
1038 * algorithm except that the MAC value for the truncated algorithm
1040 * for the untruncated algorithm.
1042 * \note This macro may allow constructing algorithm identifiers that
1049 * algorithm is considered identical to the untruncated algorithm
1052 * \param mac_alg A MAC algorithm identifier (value of type
1055 * MAC algorithm.
1062 * \return The corresponding MAC algorithm with the specified
1065 * MAC algorithm or if \p mac_length is too small or
1066 * too large for the specified MAC algorithm.
1073 /** Macro to build the base MAC algorithm corresponding to a truncated
1074 * MAC algorithm.
1076 * \param mac_alg A MAC algorithm identifier (value of type
1079 * MAC algorithm.
1081 * \return The corresponding base MAC algorithm.
1083 * MAC algorithm.
1089 /** Length to which a MAC algorithm is truncated.
1091 * \param mac_alg A MAC algorithm identifier (value of type
1096 * \return 0 if \p mac_alg is a non-truncated MAC algorithm.
1098 * MAC algorithm.
1103 /** Macro to build a MAC minimum-MAC-length wildcard algorithm.
1105 * A minimum-MAC-length MAC wildcard algorithm permits all MAC algorithms
1106 * sharing the same base algorithm, and where the (potentially truncated) MAC
1107 * length of the specific algorithm is equal to or larger then the wildcard
1108 * algorithm's minimum MAC length.
1111 * smallest MAC length allowed by the base algorithm, this effectively
1112 * becomes an 'any-MAC-length-allowed' policy for that base algorithm.
1114 * \param mac_alg A MAC algorithm identifier (value of type
1121 * \return The corresponding MAC wildcard algorithm with the
1124 * algorithm or if \p min_mac_length is less than 1 or
1125 * too large for the specified MAC algorithm.
1141 /** Whether the specified algorithm is a MAC algorithm based on a block cipher.
1143 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1145 * \return 1 if \p alg is a MAC algorithm based on a block cipher, 0 otherwise.
1147 * algorithm identifier.
1156 /** Whether the specified algorithm is a stream cipher.
1162 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1164 * \return 1 if \p alg is a stream cipher algorithm, 0 otherwise.
1166 * algorithm identifier or if it is not a symmetric cipher algorithm.
1172 /** The stream cipher mode of a stream cipher algorithm.
1183 * For example, to use AES-128-CTR, use this algorithm with
1223 * multi-part cipher operation with this algorithm, psa_cipher_generate_iv()
1247 /** Whether the specified algorithm is an AEAD mode on a block cipher.
1249 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1251 * \return 1 if \p alg is an AEAD algorithm which is an AEAD mode based on
1254 * algorithm identifier.
1260 /** The CCM authenticated encryption algorithm.
1269 * For CCM* with a nonzero tag length, use the AEAD algorithm #PSA_ALG_CCM.
1277 /** The GCM authenticated encryption algorithm.
1283 /** The Chacha20-Poly1305 AEAD algorithm.
1294 /* In the encoding of an AEAD algorithm, the bits corresponding to
1301 /* In the encoding of an AEAD algorithm, the bit corresponding to
1302 * #PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm
1303 * is a wildcard algorithm. A key with such wildcard algorithm as permitted
1304 * algorithm policy can be used with any algorithm corresponding to the
1309 /** Macro to build a shortened AEAD algorithm.
1311 * A shortened AEAD algorithm is similar to the corresponding AEAD
1312 * algorithm, but has an authentication tag that consists of fewer bytes.
1313 * Depending on the algorithm, the tag length may affect the calculation
1316 * \param aead_alg An AEAD algorithm identifier (value of type
1321 * \return The corresponding AEAD algorithm with the specified
1324 * AEAD algorithm or if \p tag_length is not valid
1325 * for the specified AEAD algorithm.
1333 /** Retrieve the tag length of a specified AEAD algorithm
1335 * \param aead_alg An AEAD algorithm identifier (value of type
1339 * \return The tag length specified by the input algorithm.
1341 * AEAD algorithm.
1347 /** Calculate the corresponding AEAD algorithm with the default tag length.
1349 * \param aead_alg An AEAD algorithm (\c PSA_ALG_XXX value such that
1352 * \return The corresponding AEAD algorithm with the default
1353 * tag length for that algorithm.
1366 /** Macro to build an AEAD minimum-tag-length wildcard algorithm.
1368 * A minimum-tag-length AEAD wildcard algorithm permits all AEAD algorithms
1369 * sharing the same base algorithm, and where the tag length of the specific
1370 * algorithm is equal to or larger then the minimum tag length specified by the
1371 * wildcard algorithm.
1374 * smallest tag length allowed by the base algorithm, this effectively
1375 * becomes an 'any-tag-length-allowed' policy for that base algorithm.
1377 * \param aead_alg An AEAD algorithm identifier (value of type
1382 * allowed tag length of the algorithm.
1384 * \return The corresponding AEAD wildcard algorithm with the
1387 * AEAD algorithm or if \p min_tag_length is less than 1
1388 * or too large for the specified AEAD algorithm.
1401 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1404 * when specifying the algorithm in a usage policy.
1406 * \return The corresponding RSA PKCS#1 v1.5 signature algorithm.
1408 * hash algorithm.
1414 * The input to this algorithm is the DigestInfo structure used by
1430 * possible salt length for the algorithm and key size if that is
1431 * smaller than the hash length. The specified hash algorithm is
1435 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1438 * when specifying the algorithm in a usage policy.
1440 * \return The corresponding RSA PSS signature algorithm.
1442 * hash algorithm.
1449 * This algorithm has the same behavior as #PSA_ALG_RSA_PSS when signing,
1453 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1456 * when specifying the algorithm in a usage policy.
1458 * \return The corresponding RSA PSS signature algorithm.
1460 * hash algorithm.
1465 /** Whether the specified algorithm is RSA PSS with standard salt.
1467 * \param alg An algorithm value or an algorithm policy wildcard.
1471 * where \c hash_alg is a hash algorithm or
1474 * a supported algorithm identifier or policy.
1479 /** Whether the specified algorithm is RSA PSS with any salt.
1481 * \param alg An algorithm value or an algorithm policy wildcard.
1485 * where \c hash_alg is a hash algorithm or
1488 * a supported algorithm identifier or policy.
1493 /** Whether the specified algorithm is RSA PSS.
1495 * This includes any of the RSA PSS algorithm variants, regardless of the
1498 * \param alg An algorithm value or an algorithm policy wildcard.
1503 * where \c hash_alg is a hash algorithm or
1506 * a supported algorithm identifier or policy.
1524 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1527 * when specifying the algorithm in a usage policy.
1529 * \return The corresponding ECDSA signature algorithm.
1531 * hash algorithm.
1538 * without specifying a hash algorithm. This algorithm may only be
1552 * Note that when this algorithm is used for verification, signatures
1558 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1561 * when specifying the algorithm in a usage policy.
1564 * algorithm.
1566 * hash algorithm.
1581 /** Edwards-curve digital signature algorithm without prehashing (PureEdDSA),
1587 * suitable functions and extend this algorithm to support contexts.
1601 * This algorithm can be used with psa_sign_message() and
1615 /** Edwards-curve digital signature algorithm with prehashing (HashEdDSA),
1620 * This algorithm is Ed25519 as specified in RFC 8032.
1625 * This is a hash-and-sign algorithm: to calculate a signature,
1631 * using the hash algorithm #PSA_ALG_SHA_512,
1639 /** Edwards-curve digital signature algorithm with prehashing (HashEdDSA),
1644 * This algorithm is Ed448 as specified in RFC 8032.
1650 * This is a hash-and-sign algorithm: to calculate a signature,
1656 * using the hash algorithm #PSA_ALG_SHAKE256_512,
1669 /** Whether the specified algorithm is a signature algorithm that can be used
1678 * \param alg An algorithm identifier (value of type psa_algorithm_t).
1680 * \return 1 if alg is a signature algorithm that can be used to sign a
1681 * hash. 0 if alg is a signature algorithm that can only be used
1682 * to sign a message. 0 if alg is not a signature algorithm.
1684 * supported algorithm identifier.
1691 /** Whether the specified algorithm is a signature algorithm that can be used
1694 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1696 * \return 1 if alg is a signature algorithm that can be used to sign a
1697 * message. 0 if \p alg is a signature algorithm that can only be used
1699 * algorithm. This macro can return either 0 or 1 if \p alg is not a
1700 * supported algorithm identifier.
1705 /** Whether the specified algorithm is a hash-and-sign algorithm.
1712 * to extract this algorithm.
1714 * Thus, for a hash-and-sign algorithm,
1725 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1727 * \return 1 if \p alg is a hash-and-sign algorithm, 0 otherwise.
1729 * algorithm identifier.
1735 /** Get the hash used by a hash-and-sign signature algorithm.
1737 * A hash-and-sign algorithm is a signature algorithm which is
1743 * \param alg A signature algorithm (\c PSA_ALG_XXX value such that
1746 * \return The underlying hash algorithm if \p alg is a hash-and-sign
1747 * algorithm.
1748 * \return 0 if \p alg is a signature algorithm that does not
1750 * \return Unspecified if \p alg is not a signature algorithm or
1760 * \warning Calling psa_asymmetric_decrypt() with this algorithm as a
1776 * \param hash_alg The hash algorithm (\c PSA_ALG_XXX value such that
1780 * \return The corresponding RSA OAEP encryption algorithm.
1782 * hash algorithm.
1794 /** Macro to build an HKDF algorithm.
1798 * This key derivation algorithm uses the following inputs:
1808 * if the salt is longer than the block size of the hash algorithm; then
1813 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1816 * \return The corresponding HKDF algorithm.
1818 * hash algorithm.
1822 /** Whether the specified algorithm is an HKDF algorithm.
1827 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1829 * \return 1 if \c alg is an HKDF algorithm, 0 otherwise.
1831 * key derivation algorithm identifier.
1839 /** Macro to build an HKDF-Extract algorithm.
1844 * This key derivation algorithm uses the following inputs:
1853 * as a separate algorithm for the sake of protocols that use it as a
1859 * if the salt is longer than the block size of the hash algorithm; then
1864 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1867 * \return The corresponding HKDF-Extract algorithm.
1869 * hash algorithm.
1873 /** Whether the specified algorithm is an HKDF-Extract algorithm.
1878 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1880 * \return 1 if \c alg is an HKDF-Extract algorithm, 0 otherwise.
1882 * key derivation algorithm identifier.
1888 /** Macro to build an HKDF-Expand algorithm.
1893 * This key derivation algorithm uses the following inputs:
1902 * a separate algorithm for the sake of protocols that use it as a building
1906 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1909 * \return The corresponding HKDF-Expand algorithm.
1911 * hash algorithm.
1915 /** Whether the specified algorithm is an HKDF-Expand algorithm.
1920 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1922 * \return 1 if \c alg is an HKDF-Expand algorithm, 0 otherwise.
1924 * key derivation algorithm identifier.
1929 /** Whether the specified algorithm is an HKDF or HKDF-Extract or
1930 * HKDF-Expand algorithm.
1933 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1935 * \return 1 if \c alg is any HKDF type algorithm, 0 otherwise.
1937 * key derivation algorithm identifier.
1945 /** Macro to build a TLS-1.2 PRF algorithm.
1951 * This key derivation algorithm uses the following inputs, which must be
1964 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1967 * \return The corresponding TLS-1.2 PRF algorithm.
1969 * hash algorithm.
1974 /** Whether the specified algorithm is a TLS-1.2 PRF algorithm.
1976 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1978 * \return 1 if \c alg is a TLS-1.2 PRF algorithm, 0 otherwise.
1980 * key derivation algorithm identifier.
1988 /** Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm.
1996 * This key derivation algorithm uses the following inputs, which must be
2017 * algorithm constructed as
2034 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
2037 * \return The corresponding TLS-1.2 PSK to MS algorithm.
2039 * hash algorithm.
2044 /** Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
2046 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2048 * \return 1 if \c alg is a TLS-1.2 PSK to MS algorithm, 0 otherwise.
2050 * key derivation algorithm identifier.
2071 /* This flag indicates whether the key derivation algorithm is suitable for
2076 * Those algorithms cannot be combined with a key agreement algorithm.
2081 /** Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm.
2084 * This macro specifies the PBKDF2 algorithm constructed using a PRF based on
2089 * This key derivation algorithm uses the following inputs, which must be
2100 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
2103 * \return The corresponding PBKDF2-HMAC-XXX algorithm.
2105 * hash algorithm.
2110 /** Whether the specified algorithm is a PBKDF2-HMAC algorithm.
2112 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2114 * \return 1 if \c alg is a PBKDF2-HMAC algorithm, 0 otherwise.
2116 * key derivation algorithm identifier.
2122 /** The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.
2125 * This macro specifies the PBKDF2 algorithm constructed using the
2128 * This key derivation algorithm uses the same inputs as
2140 /** Macro to build a combined algorithm that chains a key agreement with
2143 * \param ka_alg A key agreement algorithm (\c PSA_ALG_XXX value such
2145 * \param kdf_alg A key derivation algorithm (\c PSA_ALG_XXX value such
2149 * algorithm.
2151 * key agreement algorithm or \p kdf_alg is not a
2152 * supported key derivation algorithm.
2163 /** Whether the specified algorithm is a raw key agreement algorithm.
2165 * A raw key agreement algorithm is one that does not specify
2171 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2173 * \return 1 if \p alg is a raw key agreement algorithm, 0 otherwise.
2175 * algorithm identifier.
2184 /** The finite-field Diffie-Hellman (DH) key agreement algorithm.
2193 /** Whether the specified algorithm is a finite field Diffie-Hellman algorithm.
2195 * This includes the raw finite field Diffie-Hellman algorithm as well as
2197 * algorithm.
2199 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2201 * \return 1 if \c alg is a finite field Diffie-Hellman algorithm, 0 otherwise.
2203 * key agreement algorithm identifier.
2208 /** The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.
2235 /** Whether the specified algorithm is an elliptic curve Diffie-Hellman
2236 * algorithm.
2238 * This includes the raw elliptic curve Diffie-Hellman algorithm as well as
2240 * algorithm.
2242 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2244 * \return 1 if \c alg is an elliptic curve Diffie-Hellman algorithm,
2247 * key agreement algorithm identifier.
2252 /** Whether the specified algorithm encoding is a wildcard.
2254 * Wildcard values may only be used to set the usage algorithm field in
2257 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2259 * \return 1 if \c alg is a wildcard algorithm encoding.
2260 * \return 0 if \c alg is a non-wildcard algorithm encoding (suitable for
2263 * algorithm identifier.
2274 /** Get the hash used by a composite algorithm.
2276 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2278 * \return The underlying hash algorithm if alg is a composite algorithm that
2279 * uses a hash algorithm.
2281 * \return \c 0 if alg is not a composite algorithm that uses a hash.
2752 /** Check if two AEAD algorithm identifiers refer to the same AEAD algorithm
2755 * \param aead_alg_1 An AEAD algorithm identifier.
2756 * \param aead_alg_2 An AEAD algorithm identifier.
2758 * \return 1 if both identifiers refer to the same AEAD algorithm,
2761 * a supported AEAD algorithm.