ndn-lite
ndn-lite-sec-utils.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018-2019 Zhiyi Zhang
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v3.0. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
9 #ifndef NDN_SECURITY_UTILS_H_
10 #define NDN_SECURITY_UTILS_H_
11 
12 #include <inttypes.h>
13 #include <stdbool.h>
14 
15 int
16 ndn_const_time_memcmp(const uint8_t* a, const uint8_t* b, uint32_t size);
17 
29 int
30 ndn_asn1_encode_ecdsa_signature(uint8_t* raw_ecdsa_sig, uint32_t raw_ecdsa_sig_len,
31  uint32_t raw_ecdsa_sig_buf_len);
32 
44 int
45 ndn_asn1_probe_ecdsa_signature_encoding_size(const uint8_t *raw_ecdsa_sig, uint32_t raw_ecdsa_sig_len,
46  uint32_t *encoded_ecdsa_sig_len);
47 
60 int
61 ndn_asn1_decode_ecdsa_signature(const uint8_t *encoded_ecdsa_sig, uint32_t encoded_ecdsa_sig_len,
62  uint8_t *decoded_ecdsa_sig, uint32_t decoded_ecdsa_sig_buf_len,
63  uint32_t *raw_ecdsa_sig_len);
64 
65 #endif // NDN_SECURITY_UTILS_H_
int ndn_const_time_memcmp(const uint8_t *a, const uint8_t *b, uint32_t size)
Definition: ndn-lite-sec-utils.c:17
int ndn_asn1_decode_ecdsa_signature(const uint8_t *encoded_ecdsa_sig, uint32_t encoded_ecdsa_sig_len, uint8_t *decoded_ecdsa_sig, uint32_t decoded_ecdsa_sig_buf_len, uint32_t *raw_ecdsa_sig_len)
Decode a signature in ASN.1, DER format into the format used by the micro-ecc library.
Definition: ndn-lite-sec-utils.c:240
int ndn_asn1_encode_ecdsa_signature(uint8_t *raw_ecdsa_sig, uint32_t raw_ecdsa_sig_len, uint32_t raw_ecdsa_sig_buf_len)
Encode a signature in the format used by the micro-ecc format; final encoding will be in ASN....
Definition: ndn-lite-sec-utils.c:176
int ndn_asn1_probe_ecdsa_signature_encoding_size(const uint8_t *raw_ecdsa_sig, uint32_t raw_ecdsa_sig_len, uint32_t *encoded_ecdsa_sig_len)
Probe the size that an ecdsa signature in the same format used by the micro-ecc library will have if ...
Definition: ndn-lite-sec-utils.c:140