Mistake on this page?
Report an issue in GitHub or email us
TARGET_TFM/TARGET_TFM_V1_0/include/psa/crypto_extra.h
1 /*
2  * Copyright (c) 2018-2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 /**
8  * \file psa/crypto_extra.h
9  *
10  * \brief PSA cryptography module: vendor extensions
11  *
12  * \note This file may not be included directly. Applications must
13  * include psa/crypto.h.
14  *
15  * This file is reserved for vendor-specific definitions.
16  */
17 
18 #ifndef PSA_CRYPTO_EXTRA_H
19 #define PSA_CRYPTO_EXTRA_H
20 
21 #include "psa/crypto_compat.h"
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /** \brief Declare the enrollment algorithm for a key.
28  *
29  * An operation on a key may indifferently use the algorithm set with
30  * psa_set_key_algorithm() or with this function.
31  *
32  * \param[out] attributes The attribute structure to write to.
33  * \param alg2 A second algorithm that the key may be used
34  * for, in addition to the algorithm set with
35  * psa_set_key_algorithm().
36  *
37  * \warning Setting an enrollment algorithm is not recommended, because
38  * using the same key with different algorithms can allow some
39  * attacks based on arithmetic relations between different
40  * computations made with the same key, or can escalate harmless
41  * side channels into exploitable ones. Use this function only
42  * if it is necessary to support a protocol for which it has been
43  * verified that the usage of the key with multiple algorithms
44  * is safe.
45  */
46 static inline void psa_set_key_enrollment_algorithm(
47  psa_key_attributes_t *attributes,
48  psa_algorithm_t alg2)
49 {
50  attributes->core.policy.alg2 = alg2;
51 }
52 
53 #ifdef __cplusplus
54 }
55 #endif
56 
57 #endif /* PSA_CRYPTO_EXTRA_H */
static void psa_set_key_enrollment_algorithm(psa_key_attributes_t *attributes, psa_algorithm_t alg2)
Declare the enrollment algorithm for a key.
uint32_t psa_algorithm_t
Encoding of a cryptographic algorithm.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.