Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
841b753
Add Real tag
ChristopherRabotin Jan 12, 2022
073112b
Initial work on Real
ChristopherRabotin Jan 14, 2022
8b66223
Not sure I understand the base 10 encoding, seems like a bit string
ChristopherRabotin Jan 17, 2022
25db001
Add decode/encode of f64; Add real error
ChristopherRabotin Jan 18, 2022
0b66bce
Fixed the decoding of an f64
ChristopherRabotin Jan 19, 2022
b9a7571
Select examples of normal f64 work
ChristopherRabotin Jan 19, 2022
436cb48
Cleanup
ChristopherRabotin Jan 19, 2022
2da03c8
Proposed support of REAL DER type
ChristopherRabotin Jan 14, 2022
2dae5f6
Merge branch '304-der-support-real-type' of github.com:ChristopherRab…
ChristopherRabotin Jan 19, 2022
c258f2b
Clippy changes
ChristopherRabotin Jan 19, 2022
6e49378
Fixed implementation of section 11.3.1
ChristopherRabotin Jan 22, 2022
8bdabfe
Merge branch 'RustCrypto:master' into 304-der-support-real-type
ChristopherRabotin Jan 25, 2022
c240f03
Update der/src/asn1/real.rs
ChristopherRabotin Jan 31, 2022
7a2ef47
Update der/src/asn1/real.rs
ChristopherRabotin Jan 31, 2022
042f067
Add validation tests; fix impl for 0 & NR3 decode
ChristopherRabotin Jan 31, 2022
cc3c552
Merge branch 'RustCrypto:master' into 304-der-support-real-type
ChristopherRabotin Feb 7, 2022
082d214
Remove Real error kinds in favor of the tag error
ChristopherRabotin Feb 7, 2022
6f30dc0
Merge branch '304-der-support-real-type' of github.com:ChristopherRab…
ChristopherRabotin Feb 7, 2022
b284a48
REAL: almost working, issue with very large numbers
ChristopherRabotin Mar 23, 2022
effa7b3
Final DER REALs implementation
ChristopherRabotin Mar 23, 2022
9fecabb
Removed commented tests in validation
ChristopherRabotin Mar 23, 2022
f3afa91
Merge branch 'RustCrypto:master' into 304-der-support-real-type
ChristopherRabotin Mar 24, 2022
f7813bc
Updates for v0.6.0-pre.3
ChristopherRabotin Mar 24, 2022
712e8c6
cargo fmt
ChristopherRabotin Mar 24, 2022
f1804bc
Support rust 1.57
ChristopherRabotin Mar 25, 2022
a45766b
Update der/src/asn1/real.rs
ChristopherRabotin Mar 26, 2022
ba61723
Remove impl f64 from Any
ChristopherRabotin Mar 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions der/src/asn1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ mod octet_string;
mod oid;
mod optional;
mod printable_string;
mod real;
mod sequence;
mod sequence_of;
mod set_of;
Expand Down
4 changes: 2 additions & 2 deletions der/src/asn1/integer.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//! ASN.1 `INTEGER` support.

pub(super) mod bigint;
mod int;
mod uint;
pub(super) mod int;
pub(super) mod uint;

use crate::{
asn1::Any, ByteSlice, DecodeValue, Decoder, EncodeValue, Encoder, Error, FixedTag, Header,
Expand Down
8 changes: 4 additions & 4 deletions der/src/asn1/integer/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{Encoder, Length, Result, Tag};
/// zeroes removed.
///
/// Returns a byte array of the requested size containing a big endian integer.
pub(super) fn decode_to_slice(bytes: &[u8]) -> Result<&[u8]> {
pub(crate) fn decode_to_slice(bytes: &[u8]) -> Result<&[u8]> {
// The `INTEGER` type always encodes a signed value, so for unsigned
// values the leading `0x00` byte may need to be removed.
//
Expand Down Expand Up @@ -40,7 +40,7 @@ pub(super) fn decode_to_array<const N: usize>(bytes: &[u8]) -> Result<[u8; N]> {
}

/// Encode the given big endian bytes representing an integer as ASN.1 DER.
pub(super) fn encode_bytes(encoder: &mut Encoder<'_>, bytes: &[u8]) -> Result<()> {
pub(crate) fn encode_bytes(encoder: &mut Encoder<'_>, bytes: &[u8]) -> Result<()> {
let bytes = strip_leading_zeroes(bytes);

if needs_leading_zero(bytes) {
Expand All @@ -52,13 +52,13 @@ pub(super) fn encode_bytes(encoder: &mut Encoder<'_>, bytes: &[u8]) -> Result<()

/// Get the encoded length for the given unsigned integer serialized as bytes.
#[inline]
pub(super) fn encoded_len(bytes: &[u8]) -> Result<Length> {
pub(crate) fn encoded_len(bytes: &[u8]) -> Result<Length> {
let bytes = strip_leading_zeroes(bytes);
Length::try_from(bytes.len())? + needs_leading_zero(bytes) as u8
}

/// Strip the leading zeroes from the given byte slice
pub(super) fn strip_leading_zeroes(mut bytes: &[u8]) -> &[u8] {
pub(crate) fn strip_leading_zeroes(mut bytes: &[u8]) -> &[u8] {
while let Some((byte, rest)) = bytes.split_first() {
if *byte == 0 && !rest.is_empty() {
bytes = rest;
Expand Down
Loading