Mistake on this page?
Report an issue in GitHub or email us
t_cose_common.h
Go to the documentation of this file.
1 /*
2  * t_cose_common.h
3  *
4  * Copyright 2019, Laurence Lundblade
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  *
8  * See BSD-3-Clause license in README.mdE.
9  */
10 
11 
12 #ifndef __T_COSE_COMMON_H__
13 #define __T_COSE_COMMON_H__
14 
15 
16 /**
17  * \file t_cose_common.h
18  *
19  * \brief Defines common to all public t_cose interfaces.
20  *
21  */
22 
23 
24 /* Private value. Intentionally not documented for Doxygen.
25  * This is the size allocated for the encoded protected headers. It
26  * needs to be big enough for make_protected_header() to succeed. It
27  * currently sized for one header with an algorithm ID up to 32 bits
28  * long -- one byte for the wrapping map, one byte for the label, 5
29  * bytes for the ID. If this is made accidentially too small, QCBOR will
30  * only return an error, and not overrun any buffers.
31  *
32  * 9 extra bytes are added, rounding it up to 16 total, in case some
33  * other protected header is to be added.
34  */
35 #define T_COSE_SIGN1_MAX_PROT_HEADER (1+1+5+9)
36 
37 
38 /**
39  * Error codes return by t_cose.
40  *
41  * Do not reorder these. It is OK to add
42  * new ones at the end.
43  */
45  /**
46  * Operation completed successfully
47  */
49  /**
50  * The requested signing algorithm is not supported.
51  */
53  /**
54  * Error constructing the protected headers.
55  */
57  /**
58  * The hash algorithm needed is not supported. Note that the
59  * signing algorithm identifier usually identifies the hash
60  * algorithm.
61  */
63  /**
64  * Some system failure when running the hash algorithm.
65  */
67  /**
68  * The buffer to receive a hash result is too small.
69  */
71  /**
72  * The buffer to receive result of a signing operation is too
73  * small.
74  */
76  /**
77  * The buffer to receive to receive a key is too small.
78  */
80  /**
81  * When verifying a \c COSE_Sign1, something is wrong with the
82  * format of the CBOR. For example, it is missing something like
83  * the payload.
84  */
86  /**
87  * When decoding some CBOR like a \c COSE_Sign1, the CBOR was not
88  * well-formed. Most likely what was supposed to be CBOR was is
89  * either not or it has been corrupted.
90  */
92  /**
93  * No algorithm ID was found when one is needed. For example, when
94  * verifying a \c COSE_Sign1.
95  */
97  /**
98  * No key ID was found when one is needed. For example, when
99  * verifying a \c COSE_Sign1.
100  */
102  /**
103  * Signature verification failed. For example, the cryptographic
104  * operations completed successfully but hash wasn't as expected.
105  */
107  /**
108  * Verification of a short-circuit signature failed.
109  */
111  /**
112  * Some (unspecified) argument was not valid.
113  */
115  /**
116  * Out of heap memory.
117  */
119  /**
120  * General unspecific failure.
121  */
123  /**
124  * Equivalent to \c PSA_ERROR_TAMPERING_DETECTED.
125  */
127  /**
128  * The key identified by a key slot of a key ID was not found.
129  */
131  /**
132  * The key was found, but it was the wrong type for the operation.
133  */
135  /**
136  * Error constructing the \c Sig_structure when signing or verify.
137  */
139  /**
140  * Signature was short-circuit. THe option to allow verification
141  * of short-circuit signatures was not set
142  */
144 };
145 
146 
147 
148 #endif /* __T_COSE_COMMON_H__ */
The buffer to receive a hash result is too small.
Definition: t_cose_common.h:70
The requested signing algorithm is not supported.
Definition: t_cose_common.h:52
Verification of a short-circuit signature failed.
Operation completed successfully.
Definition: t_cose_common.h:48
When verifying a COSE_Sign1, something is wrong with the format of the CBOR.
Definition: t_cose_common.h:85
The hash algorithm needed is not supported.
Definition: t_cose_common.h:62
Signature verification failed.
Equivalent to PSA_ERROR_TAMPERING_DETECTED.
The key was found, but it was the wrong type for the operation.
The key identified by a key slot of a key ID was not found.
General unspecific failure.
No key ID was found when one is needed.
When decoding some CBOR like a COSE_Sign1, the CBOR was not well-formed.
Definition: t_cose_common.h:91
The buffer to receive to receive a key is too small.
Definition: t_cose_common.h:79
Some system failure when running the hash algorithm.
Definition: t_cose_common.h:66
Error constructing the protected headers.
Definition: t_cose_common.h:56
t_cose_err_t
Error codes return by t_cose.
Definition: t_cose_common.h:44
Signature was short-circuit.
Error constructing the Sig_structure when signing or verify.
Some (unspecified) argument was not valid.
No algorithm ID was found when one is needed.
Definition: t_cose_common.h:96
The buffer to receive result of a signing operation is too small.
Definition: t_cose_common.h:75
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.