xref: /openbmc/linux/include/linux/asn1_encoder.h (revision b0706762)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef _LINUX_ASN1_ENCODER_H
4 #define _LINUX_ASN1_ENCODER_H
5 
6 #include <linux/types.h>
7 #include <linux/asn1.h>
8 #include <linux/asn1_ber_bytecode.h>
9 #include <linux/bug.h>
10 
11 #define asn1_oid_len(oid) (sizeof(oid)/sizeof(u32))
12 unsigned char *
13 asn1_encode_integer(unsigned char *data, const unsigned char *end_data,
14 		    s64 integer);
15 unsigned char *
16 asn1_encode_oid(unsigned char *data, const unsigned char *end_data,
17 		u32 oid[], int oid_len);
18 unsigned char *
19 asn1_encode_tag(unsigned char *data, const unsigned char *end_data,
20 		u32 tag, const unsigned char *string, int len);
21 unsigned char *
22 asn1_encode_octet_string(unsigned char *data,
23 			 const unsigned char *end_data,
24 			 const unsigned char *string, u32 len);
25 unsigned char *
26 asn1_encode_sequence(unsigned char *data, const unsigned char *end_data,
27 		     const unsigned char *seq, int len);
28 unsigned char *
29 asn1_encode_boolean(unsigned char *data, const unsigned char *end_data,
30 		    bool val);
31 
32 #endif
33