algorithm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 TU Dresden
3  * Copyright (C) 2021 HAW Hamburg
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
22 #ifndef PSA_CRYPTO_PSA_ASYMMETRIC_ENCRYPTION_ALGORITHM_H
23 #define PSA_CRYPTO_PSA_ASYMMETRIC_ENCRYPTION_ALGORITHM_H
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include "psa/algorithm.h"
30 
34 #define PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION ((psa_algorithm_t)0x07000000)
35 
45 #define PSA_ALG_IS_ASYMMETRIC_ENCRYPTION(alg) \
46  (((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_ASYMMETRIC_ENCRYPTION)
47 
56 #define PSA_ALG_IS_RSA_OAEP(alg) \
57  (((alg) & ~0x000000ff) == 0x07000300)
58 
70 #define PSA_ALG_RSA_PKCS1V15_CRYPT ((psa_algorithm_t)0x07000200)
71 
94 #define PSA_ALG_RSA_OAEP(hash_alg) \
95  ((psa_algorithm_t)(0x07000300 | ((hash_alg) & 0x000000ff)))
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* PSA_CRYPTO_PSA_ASYMMETRIC_ENCRYPTION_ALGORITHM_H */
Algorithm definitions for the PSA Crypto API.