diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-06-28 13:59:48 +0200 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-06-28 13:59:48 +0200 |
commit | 1525eec1426a6a34b84809179d784e5cee3e8bfa (patch) | |
tree | 1e73534e95d14f776085df7ca6154057b8108712 /openpgp/src/parse/mpis.rs | |
parent | f214d55b7061e9d6006f915ee8fbedf29ddf6078 (diff) |
openpgp: Make struct MPI opaque.
Diffstat (limited to 'openpgp/src/parse/mpis.rs')
-rw-r--r-- | openpgp/src/parse/mpis.rs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/openpgp/src/parse/mpis.rs b/openpgp/src/parse/mpis.rs index 49c7e5f4..3b78755b 100644 --- a/openpgp/src/parse/mpis.rs +++ b/openpgp/src/parse/mpis.rs @@ -478,12 +478,12 @@ fn mpis_parse_test() { //assert_eq!(mpis.serialized_len(), 6); match &mpis { &mpis::PublicKey::RSA{ ref n, ref e } => { - assert_eq!(n.bits, 1); - assert_eq!(n.value[0], 1); - assert_eq!(n.value.len(), 1); - assert_eq!(e.bits, 2); - assert_eq!(e.value[0], 2); - assert_eq!(e.value.len(), 1); + assert_eq!(n.bits(), 1); + assert_eq!(n.value()[0], 1); + assert_eq!(n.value().len(), 1); + assert_eq!(e.bits(), 2); + assert_eq!(e.value()[0], 2); + assert_eq!(e.value().len(), 1); } _ => assert!(false), @@ -500,10 +500,10 @@ fn mpis_parse_test() { // The number 511. let mpi = MPI::from_bytes(b"\x00\x09\x01\xff").unwrap(); - assert_eq!(mpi.value.len(), 2); - assert_eq!(mpi.bits, 9); - assert_eq!(mpi.value[0], 1); - assert_eq!(mpi.value[1], 0xff); + assert_eq!(mpi.value().len(), 2); + assert_eq!(mpi.bits(), 9); + assert_eq!(mpi.value()[0], 1); + assert_eq!(mpi.value()[1], 0xff); // The number 1, incorrectly encoded (the length should be 1, // not 2). |