1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3 * LibTomCrypt is a library that provides various cryptographic
4 * algorithms in a highly modular and flexible manner.
6 * The library is free for all purposes without any express
12 @file der_encode_boolean.c
13 ASN.1 DER, encode a BOOLEAN, Tom St Denis
21 @param in The boolean to encode
22 @param out [out] The destination for the DER encoded BOOLEAN
23 @param outlen [in/out] The max size and resulting size of the DER BOOLEAN
24 @return CRYPT_OK if successful
26 int der_encode_boolean(int in,
27 unsigned char *out, unsigned long *outlen)
29 LTC_ARGCHK(outlen != NULL);
30 LTC_ARGCHK(out != NULL);
34 return CRYPT_BUFFER_OVERFLOW;
40 out[2] = in ? 0xFF : 0x00;
47 /* ref: $Format:%D$ */
48 /* git commit: $Format:%H$ */
49 /* commit time: $Format:%ai$ */