Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
algorithm.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2024 TU Dresden
3
* SPDX-FileCopyrightText: 2021 HAW Hamburg
4
* SPDX-License-Identifier: LGPL-2.1-only
5
*/
6
7
#pragma once
8
21
#ifdef __cplusplus
22
extern
"C"
{
23
#endif
24
25
#include "
psa/algorithm.h
"
26
#include "
psa/hash/algorithm.h
"
27
31
#define PSA_ALG_CATEGORY_SIGN ((psa_algorithm_t)0x06000000)
32
42
#define PSA_ALG_IS_SIGN(alg) \
43
(((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_ASYMMETRIC_SIGNATURE)
44
53
#define PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) \
54
(((alg) & ~0x000000ff) == 0x06000200)
55
67
#define PSA_ALG_IS_RSA_PSS(alg) \
68
(((alg) & ~0x000000ff) == 0x06000300)
69
84
#define PSA_ALG_IS_RSA_PSS_ANY_SALT(alg) \
85
(((alg) & ~0x000000ff) == 0x06001300)
86
101
#define PSA_ALG_IS_RSA_PSS_STANDARD_SALT(alg) \
102
(((alg) & ~0x000000ff) == 0x06000300)
103
112
#define PSA_ALG_IS_ECDSA(alg) \
113
(((alg) & PSA_ALG_CATEGORY_MASK) == PSA_ALG_CATEGORY_SIGN)
114
125
#define PSA_ALG_IS_DETERMINISTIC_ECDSA(alg) \
126
(((alg) & ~0x000000ff) == 0x06000700)
127
138
#define PSA_ALG_IS_RANDOMIZED_ECDSA(alg) \
139
(((alg) & ~0x000000ff) == 0x06000600)
140
149
#define PSA_ALG_IS_HASH_EDDSA(alg) \
150
(((alg) & ~0x000000ff) == 0x06000900)
151
167
#define PSA_ALG_IS_SIGN_HASH(alg) \
168
(PSA_ALG_IS_RSA_PSS(alg) || PSA_ALG_IS_RSA_PKCS1V15_SIGN(alg) || \
169
PSA_ALG_IS_ECDSA(alg) || PSA_ALG_IS_HASH_EDDSA(alg))
170
203
#define PSA_ALG_IS_HASH_AND_SIGN(alg) \
204
(PSA_ALG_IS_SIGN_HASH(alg) && \
205
((alg) & PSA_ALG_HASH_MASK) != 0)
206
218
#define PSA_ALG_IS_SIGN_MESSAGE(alg) \
219
(PSA_ALG_IS_SIGN_HASH(alg) || (alg) == PSA_ALG_PURE_EDDSA)
220
235
#define PSA_ALG_IS_WILDCARD(alg) \
236
(PSA_ALG_GET_HASH(alg) == PSA_ALG_ANY_HASH)
237
280
#define PSA_ALG_ANY_HASH ((psa_algorithm_t)0x020000ff)
281
307
#define PSA_ALG_RSA_PKCS1V15_SIGN(hash_alg) \
308
((psa_algorithm_t)(0x06000200 | ((hash_alg) & 0x000000ff)))
309
332
#define PSA_ALG_RSA_PKCS1V15_SIGN_RAW ((psa_algorithm_t)0x06000200)
333
363
#define PSA_ALG_RSA_PSS(hash_alg) \
364
((psa_algorithm_t)(0x06000300 | ((hash_alg) & 0x000000ff)))
365
396
#define PSA_ALG_RSA_PSS_ANY_SALT(hash_alg) \
397
((psa_algorithm_t)(0x06001300 | ((hash_alg) & 0x000000ff)))
398
402
#define PSA_ALG_ECDSA_BASE ((psa_algorithm_t)0x06000600)
403
453
#define PSA_ALG_ECDSA(hash_alg) \
454
(PSA_ALG_ECDSA_BASE | ((hash_alg) & PSA_ALG_HASH_MASK))
455
483
#define PSA_ALG_ECDSA_ANY PSA_ALG_ECDSA_BASE
484
526
#define PSA_ALG_DETERMINISTIC_ECDSA(hash_alg) \
527
((psa_algorithm_t)(0x06000700 | ((hash_alg) & 0x000000ff)))
528
564
#define PSA_ALG_PURE_EDDSA ((psa_algorithm_t)0x06000800)
565
593
#define PSA_ALG_ED25519PH ((psa_algorithm_t)0x0600090B)
594
623
#define PSA_ALG_ED448PH ((psa_algorithm_t)0x06000915)
624
625
#ifdef __cplusplus
626
}
627
#endif
628
algorithm.h
Algorithm definitions for the PSA Crypto API.
algorithm.h
Hash algorithm definitions for the PSA Crypto API.
Generated on Mon Nov 24 2025 18:43:16 by
1.9.1