jedisct1 / rust-ed25519-compact

Small, wasm-friendly, zero-dependencies Ed25519 and X25519 implementation for Rust.
MIT License
121 stars 22 forks source link

Fixed a recursive invocation of Debug::fmt #6

Closed raphaelahrens closed 2 years ago

raphaelahrens commented 2 years ago

The implementation of Debug::fmt in Signature was recursive, since format_args!("{:x?}", self) calls fmt.

This can be tested by running

let kp = ed25519_compact::KeyPair::from_seed([42u8; 32].into());
let message = b"Hello, World!";
let signature = kp.sk.sign(message, None);
dbg!(&signature);
jedisct1 commented 2 years ago

Good catch, thank you!