Lines Matching full:algorithm
58 * parameter such as a key type, algorithm, etc. is not recognized.
228 * an algorithm with a randomized result, as well as functions that
316 /** \defgroup crypto_types Key and algorithm types
403 * The key policy determines which underlying hash algorithm the key can be
408 * \c alg is the HMAC algorithm or the underlying hash algorithm. */
419 * The key policy determines which key derivation algorithm the key
442 * The key policy determines which key derivation algorithm the key can be
449 * The key policy determines which key derivation algorithm the key
457 * The key policy determines which key derivation algorithm the key
462 /** Key for a cipher, AEAD or MAC algorithm based on the AES block cipher.
469 /** Key for a cipher, AEAD or MAC algorithm based on the
473 /** Key for a cipher or MAC algorithm based on DES or 3DES (Triple-DES).
484 /** Key for a cipher, AEAD or MAC algorithm based on the
488 /** Key for the ChaCha20 stream cipher or the Chacha20-Poly1305 AEAD algorithm.
622 * The algorithm #PSA_ALG_ECDH performs X25519 when used with this curve.
625 * The algorithm #PSA_ALG_ECDH performs X448 when used with this curve.
715 /** Vendor-defined algorithm flag.
734 /** Whether an algorithm is vendor-defined.
741 /** Whether the specified algorithm is a hash algorithm.
743 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
745 * \return 1 if \p alg is a hash algorithm, 0 otherwise.
747 * algorithm identifier.
752 /** Whether the specified algorithm is a MAC algorithm.
754 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
756 * \return 1 if \p alg is a MAC algorithm, 0 otherwise.
758 * algorithm identifier.
763 /** Whether the specified algorithm is a symmetric cipher algorithm.
765 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
767 * \return 1 if \p alg is a symmetric cipher algorithm, 0 otherwise.
769 * algorithm identifier.
774 /** Whether the specified algorithm is an authenticated encryption
775 * with associated data (AEAD) algorithm.
777 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
779 * \return 1 if \p alg is an AEAD algorithm, 0 otherwise.
781 * algorithm identifier.
786 /** Whether the specified algorithm is an asymmetric signature algorithm,
787 * also known as public-key signature algorithm.
789 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
791 * \return 1 if \p alg is an asymmetric signature algorithm, 0 otherwise.
793 * algorithm identifier.
798 /** Whether the specified algorithm is an asymmetric encryption algorithm,
799 * also known as public-key encryption algorithm.
801 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
803 * \return 1 if \p alg is an asymmetric encryption algorithm, 0 otherwise.
805 * algorithm identifier.
810 /** Whether the specified algorithm is a key agreement algorithm.
812 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
814 * \return 1 if \p alg is a key agreement algorithm, 0 otherwise.
816 * algorithm identifier.
821 /** Whether the specified algorithm is a key derivation algorithm.
823 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
825 * \return 1 if \p alg is a key derivation algorithm, 0 otherwise.
827 * algorithm identifier.
832 /** Whether the specified algorithm is a key stretching / password hashing
833 * algorithm.
835 * A key stretching / password hashing algorithm is a key derivation algorithm
837 * Equivalently, it's a key derivation algorithm that uses a
840 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
842 * \return 1 if \p alg is a key stretching / password hashing algorithm, 0
844 * supported algorithm identifier.
850 /** An invalid algorithm identifier value. */
888 /** In a hash-and-sign algorithm policy, allow any hash algorithm.
890 * This value may be used to form the algorithm usage field of a policy
891 * for a signature algorithm that is parametrized by a hash. The key
893 * algorithm parametrized with any supported hash.
906 * an algorithm built from `PSA_xxx_SIGNATURE` and a specific hash. Each
916 * an algorithm \c alg, #PSA_ALG_IS_HASH_AND_SIGN(\c alg) is true.
918 * This value may not be used to build an algorithm specification to
925 /** Macro to build an HMAC algorithm.
929 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
932 * \return The corresponding HMAC algorithm.
934 * hash algorithm.
942 /** Whether the specified algorithm is an HMAC algorithm.
946 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
948 * \return 1 if \p alg is an HMAC algorithm, 0 otherwise.
950 * algorithm identifier.
956 /* In the encoding of a MAC algorithm, the bits corresponding to
958 * truncated. As an exception, the value 0 means the untruncated algorithm,
966 /* In the encoding of a MAC algorithm, the bit corresponding to
967 * #PSA_ALG_MAC_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm
968 * is a wildcard algorithm. A key with such wildcard algorithm as permitted
969 * algorithm policy can be used with any algorithm corresponding to the
974 /** Macro to build a truncated MAC algorithm.
976 * A truncated MAC algorithm is identical to the corresponding MAC
977 * algorithm except that the MAC value for the truncated algorithm
979 * for the untruncated algorithm.
981 * \note This macro may allow constructing algorithm identifiers that
988 * algorithm is considered identical to the untruncated algorithm
991 * \param mac_alg A MAC algorithm identifier (value of type
994 * MAC algorithm.
1001 * \return The corresponding MAC algorithm with the specified
1004 * MAC algorithm or if \p mac_length is too small or
1005 * too large for the specified MAC algorithm.
1012 /** Macro to build the base MAC algorithm corresponding to a truncated
1013 * MAC algorithm.
1015 * \param mac_alg A MAC algorithm identifier (value of type
1018 * MAC algorithm.
1020 * \return The corresponding base MAC algorithm.
1022 * MAC algorithm.
1028 /** Length to which a MAC algorithm is truncated.
1030 * \param mac_alg A MAC algorithm identifier (value of type
1035 * \return 0 if \p mac_alg is a non-truncated MAC algorithm.
1037 * MAC algorithm.
1042 /** Macro to build a MAC minimum-MAC-length wildcard algorithm.
1044 * A minimum-MAC-length MAC wildcard algorithm permits all MAC algorithms
1045 * sharing the same base algorithm, and where the (potentially truncated) MAC
1046 * length of the specific algorithm is equal to or larger then the wildcard
1047 * algorithm's minimum MAC length.
1050 * smallest MAC length allowed by the base algorithm, this effectively
1051 * becomes an 'any-MAC-length-allowed' policy for that base algorithm.
1053 * \param mac_alg A MAC algorithm identifier (value of type
1060 * \return The corresponding MAC wildcard algorithm with the
1063 * algorithm or if \p min_mac_length is less than 1 or
1064 * too large for the specified MAC algorithm.
1080 /** Whether the specified algorithm is a MAC algorithm based on a block cipher.
1082 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1084 * \return 1 if \p alg is a MAC algorithm based on a block cipher, 0 otherwise.
1086 * algorithm identifier.
1095 /** Whether the specified algorithm is a stream cipher.
1101 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1103 * \return 1 if \p alg is a stream cipher algorithm, 0 otherwise.
1105 * algorithm identifier or if it is not a symmetric cipher algorithm.
1111 /** The stream cipher mode of a stream cipher algorithm.
1122 * For example, to use AES-128-CTR, use this algorithm with
1162 * multi-part cipher operation with this algorithm, psa_cipher_generate_iv()
1186 /** Whether the specified algorithm is an AEAD mode on a block cipher.
1188 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1190 * \return 1 if \p alg is an AEAD algorithm which is an AEAD mode based on
1193 * algorithm identifier.
1199 /** The CCM authenticated encryption algorithm.
1208 * For CCM* with a nonzero tag length, use the AEAD algorithm #PSA_ALG_CCM.
1216 /** The GCM authenticated encryption algorithm.
1222 /** The Chacha20-Poly1305 AEAD algorithm.
1233 /* In the encoding of a AEAD algorithm, the bits corresponding to
1240 /* In the encoding of an AEAD algorithm, the bit corresponding to
1241 * #PSA_ALG_AEAD_AT_LEAST_THIS_LENGTH_FLAG encodes the fact that the algorithm
1242 * is a wildcard algorithm. A key with such wildcard algorithm as permitted
1243 * algorithm policy can be used with any algorithm corresponding to the
1248 /** Macro to build a shortened AEAD algorithm.
1250 * A shortened AEAD algorithm is similar to the corresponding AEAD
1251 * algorithm, but has an authentication tag that consists of fewer bytes.
1252 * Depending on the algorithm, the tag length may affect the calculation
1255 * \param aead_alg An AEAD algorithm identifier (value of type
1260 * \return The corresponding AEAD algorithm with the specified
1263 * AEAD algorithm or if \p tag_length is not valid
1264 * for the specified AEAD algorithm.
1272 /** Retrieve the tag length of a specified AEAD algorithm
1274 * \param aead_alg An AEAD algorithm identifier (value of type
1278 * \return The tag length specified by the input algorithm.
1280 * AEAD algorithm.
1286 /** Calculate the corresponding AEAD algorithm with the default tag length.
1288 * \param aead_alg An AEAD algorithm (\c PSA_ALG_XXX value such that
1291 * \return The corresponding AEAD algorithm with the default
1292 * tag length for that algorithm.
1305 /** Macro to build an AEAD minimum-tag-length wildcard algorithm.
1307 * A minimum-tag-length AEAD wildcard algorithm permits all AEAD algorithms
1308 * sharing the same base algorithm, and where the tag length of the specific
1309 * algorithm is equal to or larger then the minimum tag length specified by the
1310 * wildcard algorithm.
1313 * smallest tag length allowed by the base algorithm, this effectively
1314 * becomes an 'any-tag-length-allowed' policy for that base algorithm.
1316 * \param aead_alg An AEAD algorithm identifier (value of type
1321 * allowed tag length of the algorithm.
1323 * \return The corresponding AEAD wildcard algorithm with the
1326 * AEAD algorithm or if \p min_tag_length is less than 1
1327 * or too large for the specified AEAD algorithm.
1340 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1343 * when specifying the algorithm in a usage policy.
1345 * \return The corresponding RSA PKCS#1 v1.5 signature algorithm.
1347 * hash algorithm.
1353 * The input to this algorithm is the DigestInfo structure used by
1369 * hash algorithm is used to hash the input message, to create the
1372 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1375 * when specifying the algorithm in a usage policy.
1377 * \return The corresponding RSA PSS signature algorithm.
1379 * hash algorithm.
1386 * This algorithm has the same behavior as #PSA_ALG_RSA_PSS when signing,
1390 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1393 * when specifying the algorithm in a usage policy.
1395 * \return The corresponding RSA PSS signature algorithm.
1397 * hash algorithm.
1402 /** Whether the specified algorithm is RSA PSS with standard salt.
1404 * \param alg An algorithm value or an algorithm policy wildcard.
1408 * where \c hash_alg is a hash algorithm or
1411 * a supported algorithm identifier or policy.
1416 /** Whether the specified algorithm is RSA PSS with any salt.
1418 * \param alg An algorithm value or an algorithm policy wildcard.
1422 * where \c hash_alg is a hash algorithm or
1425 * a supported algorithm identifier or policy.
1430 /** Whether the specified algorithm is RSA PSS.
1432 * This includes any of the RSA PSS algorithm variants, regardless of the
1435 * \param alg An algorithm value or an algorithm policy wildcard.
1440 * where \c hash_alg is a hash algorithm or
1443 * a supported algorithm identifier or policy.
1461 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1464 * when specifying the algorithm in a usage policy.
1466 * \return The corresponding ECDSA signature algorithm.
1468 * hash algorithm.
1475 * without specifying a hash algorithm. This algorithm may only be
1489 * Note that when this algorithm is used for verification, signatures
1495 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1498 * when specifying the algorithm in a usage policy.
1501 * algorithm.
1503 * hash algorithm.
1518 /** Edwards-curve digital signature algorithm without prehashing (PureEdDSA),
1524 * suitable functions and extend this algorithm to support contexts.
1538 * This algorithm can be used with psa_sign_message() and
1552 /** Edwards-curve digital signature algorithm with prehashing (HashEdDSA),
1557 * This algorithm is Ed25519 as specified in RFC 8032.
1562 * This is a hash-and-sign algorithm: to calculate a signature,
1568 * using the hash algorithm #PSA_ALG_SHA_512,
1576 /** Edwards-curve digital signature algorithm with prehashing (HashEdDSA),
1581 * This algorithm is Ed448 as specified in RFC 8032.
1587 * This is a hash-and-sign algorithm: to calculate a signature,
1593 * using the hash algorithm #PSA_ALG_SHAKE256_512,
1606 /** Whether the specified algorithm is a signature algorithm that can be used
1615 * \param alg An algorithm identifier (value of type psa_algorithm_t).
1617 * \return 1 if alg is a signature algorithm that can be used to sign a
1618 * hash. 0 if alg is a signature algorithm that can only be used
1619 * to sign a message. 0 if alg is not a signature algorithm.
1621 * supported algorithm identifier.
1628 /** Whether the specified algorithm is a signature algorithm that can be used
1631 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1633 * \return 1 if alg is a signature algorithm that can be used to sign a
1634 * message. 0 if \p alg is a signature algorithm that can only be used
1636 * algorithm. This macro can return either 0 or 1 if \p alg is not a
1637 * supported algorithm identifier.
1642 /** Whether the specified algorithm is a hash-and-sign algorithm.
1649 * to extract this algorithm.
1651 * Thus, for a hash-and-sign algorithm,
1662 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1664 * \return 1 if \p alg is a hash-and-sign algorithm, 0 otherwise.
1666 * algorithm identifier.
1672 /** Get the hash used by a hash-and-sign signature algorithm.
1674 * A hash-and-sign algorithm is a signature algorithm which is
1680 * \param alg A signature algorithm (\c PSA_ALG_XXX value such that
1683 * \return The underlying hash algorithm if \p alg is a hash-and-sign
1684 * algorithm.
1685 * \return 0 if \p alg is a signature algorithm that does not
1687 * \return Unspecified if \p alg is not a signature algorithm or
1706 * \param hash_alg The hash algorithm (\c PSA_ALG_XXX value such that
1710 * \return The corresponding RSA OAEP encryption algorithm.
1712 * hash algorithm.
1724 /** Macro to build an HKDF algorithm.
1728 * This key derivation algorithm uses the following inputs:
1737 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1740 * \return The corresponding HKDF algorithm.
1742 * hash algorithm.
1746 /** Whether the specified algorithm is an HKDF algorithm.
1751 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1753 * \return 1 if \c alg is an HKDF algorithm, 0 otherwise.
1755 * key derivation algorithm identifier.
1763 /** Macro to build a TLS-1.2 PRF algorithm.
1769 * This key derivation algorithm uses the following inputs, which must be
1782 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1785 * \return The corresponding TLS-1.2 PRF algorithm.
1787 * hash algorithm.
1792 /** Whether the specified algorithm is a TLS-1.2 PRF algorithm.
1794 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1796 * \return 1 if \c alg is a TLS-1.2 PRF algorithm, 0 otherwise.
1798 * key derivation algorithm identifier.
1806 /** Macro to build a TLS-1.2 PSK-to-MasterSecret algorithm.
1814 * This key derivation algorithm uses the following inputs, which must be
1828 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1831 * \return The corresponding TLS-1.2 PSK to MS algorithm.
1833 * hash algorithm.
1838 /** Whether the specified algorithm is a TLS-1.2 PSK to MS algorithm.
1840 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1842 * \return 1 if \c alg is a TLS-1.2 PSK to MS algorithm, 0 otherwise.
1844 * key derivation algorithm identifier.
1851 /* This flag indicates whether the key derivation algorithm is suitable for
1856 * Those algorithms cannot be combined with a key agreement algorithm.
1861 /** Macro to build a PBKDF2-HMAC password hashing / key stretching algorithm.
1864 * This macro specifies the PBKDF2 algorithm constructed using a PRF based on
1869 * This key derivation algorithm uses the following inputs, which must be
1880 * \param hash_alg A hash algorithm (\c PSA_ALG_XXX value such that
1883 * \return The corresponding PBKDF2-HMAC-XXX algorithm.
1885 * hash algorithm.
1890 /** Whether the specified algorithm is a PBKDF2-HMAC algorithm.
1892 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1894 * \return 1 if \c alg is a PBKDF2-HMAC algorithm, 0 otherwise.
1896 * key derivation algorithm identifier.
1901 /** The PBKDF2-AES-CMAC-PRF-128 password hashing / key stretching algorithm.
1904 * This macro specifies the PBKDF2 algorithm constructed using the
1907 * This key derivation algorithm uses the same inputs as
1915 /** Macro to build a combined algorithm that chains a key agreement with
1918 * \param ka_alg A key agreement algorithm (\c PSA_ALG_XXX value such
1920 * \param kdf_alg A key derivation algorithm (\c PSA_ALG_XXX value such
1924 * algorithm.
1926 * key agreement algorithm or \p kdf_alg is not a
1927 * supported key derivation algorithm.
1938 /** Whether the specified algorithm is a raw key agreement algorithm.
1940 * A raw key agreement algorithm is one that does not specify
1946 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1948 * \return 1 if \p alg is a raw key agreement algorithm, 0 otherwise.
1950 * algorithm identifier.
1959 /** The finite-field Diffie-Hellman (DH) key agreement algorithm.
1968 /** Whether the specified algorithm is a finite field Diffie-Hellman algorithm.
1970 * This includes the raw finite field Diffie-Hellman algorithm as well as
1972 * algorithm.
1974 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
1976 * \return 1 if \c alg is a finite field Diffie-Hellman algorithm, 0 otherwise.
1978 * key agreement algorithm identifier.
1983 /** The elliptic curve Diffie-Hellman (ECDH) key agreement algorithm.
2010 /** Whether the specified algorithm is an elliptic curve Diffie-Hellman
2011 * algorithm.
2013 * This includes the raw elliptic curve Diffie-Hellman algorithm as well as
2015 * algorithm.
2017 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2019 * \return 1 if \c alg is an elliptic curve Diffie-Hellman algorithm,
2022 * key agreement algorithm identifier.
2027 /** Whether the specified algorithm encoding is a wildcard.
2029 * Wildcard values may only be used to set the usage algorithm field in
2032 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2034 * \return 1 if \c alg is a wildcard algorithm encoding.
2035 * \return 0 if \c alg is a non-wildcard algorithm encoding (suitable for
2038 * algorithm identifier.
2049 /** Get the hash used by a composite algorithm.
2051 * \param alg An algorithm identifier (value of type #psa_algorithm_t).
2053 * \return The underlying hash algorithm if alg is a composite algorithm that
2054 * uses a hash algorithm.
2056 * \return \c 0 if alg is not a composite algorithm that uses a hash.
2497 /** Check if two AEAD algorithm identifiers refer to the same AEAD algorithm
2500 * \param aead_alg_1 An AEAD algorithm identifier.
2501 * \param aead_alg_2 An AEAD algorithm identifier.
2503 * \return 1 if both identifiers refer to the same AEAD algorithm,
2506 * a supported AEAD algorithm.