#crypto #no-std #serialization

no-std flexiber

Encoding and decoding of BER-TLV as described in ISO 7816-4, without allocations

1 unstable release

0.1.0 Nov 20, 2021

#936 in Cryptography

Download history 38/week @ 2022-06-07 41/week @ 2022-06-14 71/week @ 2022-06-21 187/week @ 2022-06-28 154/week @ 2022-07-05 172/week @ 2022-07-12 234/week @ 2022-07-19 194/week @ 2022-07-26 255/week @ 2022-08-02 154/week @ 2022-08-09 155/week @ 2022-08-16 154/week @ 2022-08-23 120/week @ 2022-08-30 470/week @ 2022-09-06 293/week @ 2022-09-13 198/week @ 2022-09-20

1,097 downloads per month
Used in 5 crates (3 directly)

Apache-2.0 OR MIT

75KB
1.5K SLoC

flexiber

Encoding and decoding of BER-TLV as described in ISO 7816-4, without allocations.

Follows the approach taken in der, and then in simple-tlv.

License

flexiber is licensed under either of Apache License, Version 2.0 or MIT License at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


lib.rs:

flexiber

Implementation of the BER-TLV serialization format from ISO 7816-4:2005.

ITU-T X.690 (08/2015) defines the BER, CER and DER encoding rules for ASN.1

The exact same document is ISO/IET 8825-1, which is freely available, inconveniently packed as a single PDF in a ZIP file :)

Credits

This library is a remix of RustCrypto/utils/der.

The core idea taken from der is to have Encodable require an encoded_length method. By calling this recursively in a first pass, allocations required in other approaches are avoided.

Dependencies

~115–510KB
~10K SLoC