Implement a basic CBOR encoder

Desktop / Chromium - Kim Paulhamus [chromium.org] - 14 September 2017 18:46 EDT

CBOR encoding is defined by the spec: https://tools.ietf.org/html/rfc7049

This implementation supports definite-length encoding for the following major types: 0 (unsigned int) 2 (byte string) 3 (text string) 4 (array) 5 (map)

Bug: 752690 Change-Id: Id0d475d0d6706018c74470aff1010c0c54e4f3d3 Reviewed-on: https://chromium-review.googlesource.com/602866 Commit-Queue: Kim Paulhamus

6efcf49 Implement a basic CBOR encoder.
content/browser/BUILD.gn | 4 +
content/browser/webauth/cbor/cbor_values.cc | 190 +++++++++++++++
content/browser/webauth/cbor/cbor_values.h | 104 ++++++++
.../browser/webauth/cbor/cbor_values_unittest.cc | 270 +++++++++++++++++++++
content/browser/webauth/cbor/cbor_writer.cc | 141 +++++++++++
content/browser/webauth/cbor/cbor_writer.h | 95 ++++++++
.../browser/webauth/cbor/cbor_writer_unittest.cc | 138 +++++++++++
content/test/BUILD.gn | 2 +
8 files changed, 944 insertions(+)

Upstream: git.chromium.org


  • Share