XenevaOS
Loading...
Searching...
No Matches
mps_error.h
Go to the documentation of this file.
1/*
2 * Copyright The Mbed TLS Contributors
3 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
4 */
5
12#ifndef MBEDTLS_MPS_ERROR_H
13#define MBEDTLS_MPS_ERROR_H
14
15
16/* TODO: The error code allocation needs to be revisited:
17 *
18 * - Should we make (some of) the MPS Reader error codes public?
19 * If so, we need to adjust MBEDTLS_MPS_READER_MAKE_ERROR() to hit
20 * a gap in the Mbed TLS public error space.
21 * If not, we have to make sure we don't forward those errors
22 * at the level of the public API -- no risk at the moment as
23 * long as MPS is an experimental component not accessible from
24 * public API.
25 */
26
33#ifndef MBEDTLS_MPS_ERR_BASE
34#define MBEDTLS_MPS_ERR_BASE (0)
35#endif
36
37#define MBEDTLS_MPS_MAKE_ERROR(code) \
38 (-(MBEDTLS_MPS_ERR_BASE | (code)))
39
40#define MBEDTLS_ERR_MPS_OPERATION_UNEXPECTED MBEDTLS_MPS_MAKE_ERROR(0x1)
41#define MBEDTLS_ERR_MPS_INTERNAL_ERROR MBEDTLS_MPS_MAKE_ERROR(0x2)
42
43/* \} name SECTION: MPS general error codes */
44
51#ifndef MBEDTLS_MPS_READER_ERR_BASE
52#define MBEDTLS_MPS_READER_ERR_BASE (1 << 8)
53#endif
54
55#define MBEDTLS_MPS_READER_MAKE_ERROR(code) \
56 (-(MBEDTLS_MPS_READER_ERR_BASE | (code)))
57
60#define MBEDTLS_ERR_MPS_READER_DATA_LEFT MBEDTLS_MPS_READER_MAKE_ERROR(0x1)
61
63#define MBEDTLS_ERR_MPS_READER_INVALID_ARG MBEDTLS_MPS_READER_MAKE_ERROR(0x2)
64
68#define MBEDTLS_ERR_MPS_READER_NEED_MORE MBEDTLS_MPS_READER_MAKE_ERROR(0x3)
69
71#define MBEDTLS_ERR_MPS_READER_OUT_OF_DATA MBEDTLS_MPS_READER_MAKE_ERROR(0x4)
72
76#define MBEDTLS_ERR_MPS_READER_INCONSISTENT_REQUESTS MBEDTLS_MPS_READER_MAKE_ERROR(0x5)
77
80#define MBEDTLS_ERR_MPS_READER_NEED_ACCUMULATOR MBEDTLS_MPS_READER_MAKE_ERROR(0x6)
81
85#define MBEDTLS_ERR_MPS_READER_ACCUMULATOR_TOO_SMALL MBEDTLS_MPS_READER_MAKE_ERROR(0x7)
86
87/* \} name SECTION: MPS Reader error codes */
88
89#endif /* MBEDTLS_MPS_ERROR_H */