1 // SPDX-License-Identifier: BSD-2-Clause
2 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
3  *
4  * LibTomCrypt is a library that provides various cryptographic
5  * algorithms in a highly modular and flexible manner.
6  *
7  * The library is free for all purposes without any express
8  * guarantee it works.
9  */
10 #include "tomcrypt_private.h"
11 
12 /**
13   @file der_length_asn1_length.c
14   ASN.1 DER, determine the length of the ASN.1 length field, Steffen Jaeckel
15 */
16 
17 #ifdef LTC_DER
18 /**
19   Determine the length required to encode len in the ASN.1 length field
20   @param len      The length to encode
21   @param outlen   [out] The length that's required to store len
22   @return CRYPT_OK if successful
23 */
der_length_asn1_length(unsigned long len,unsigned long * outlen)24 int der_length_asn1_length(unsigned long len, unsigned long *outlen)
25 {
26    return der_encode_asn1_length(len, NULL, outlen);
27 }
28 
29 #endif
30 
31 /* ref:         $Format:%D$ */
32 /* git commit:  $Format:%H$ */
33 /* commit time: $Format:%ai$ */
34