Debian Codegraph @

third_party/rust/cose-c/include/cosec.h

raw
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #include <stdint.h>
6
7 enum CoseSignatureType
8 {
9 ES256 = 0,
10 ES384 = 1,
11 ES512 = 2,
12 PS256 = 3
13 };
14
15 extern "C" {
16 typedef bool (*cose_verify_callback)(const uint8_t* payload,
17 size_t payload_len,
18 const uint8_t** cert_chain,
19 size_t cert_chain_len,
20 const size_t* certs_len,
21 const uint8_t* ee_cert,
22 size_t ee_cert_len,
23 const uint8_t* signature,
24 size_t signature_len,
25 uint8_t algorithm,
26 void* ctx);
27 bool
28 verify_cose_signature_ffi(const uint8_t* payload,
29 size_t payload_len,
30 const uint8_t* signature,
31 size_t signature_len,
32 void* ctx,
33 cose_verify_callback);
34 }