mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +00:00
Add test that UnpackedScalar::{to,from}_bytes() roundtrips.
This commit is contained in:
parent
f0102806a2
commit
e2cbec81fc
1 changed files with 9 additions and 0 deletions
|
|
@ -722,6 +722,15 @@ mod test {
|
||||||
assert_eq!(should_be_X, X);
|
assert_eq!(should_be_X, X);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn to_bytes_from_bytes_roundtrips() {
|
||||||
|
let unpacked = X.unpack();
|
||||||
|
let bytes = unpacked.to_bytes();
|
||||||
|
let should_be_unpacked = UnpackedScalar::from_bytes(&bytes);
|
||||||
|
|
||||||
|
assert_eq!(should_be_unpacked.0, unpacked.0);
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
use serde_cbor;
|
use serde_cbor;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue