Merge rust-bitcoin/rust-secp256k1#674: Derive Hash for Scalar
f87dc91151
Derive Hash for Scalar (Jiri Jakes) Pull request description: Unless there is some safety concern I cannot see, having Scalar implementing Hash would be useful. ACKs for top commit: Kixunil: ACKf87dc91151
apoelstra: ACKf87dc91151
Tree-SHA512: 276670a3d938fade3828123547b01e38b1a3c56775fb3c545d2c392622de808cf2bf8125925c7896ee27bacd5897d88908384d8c157dc8ec7d605781475964fd
This commit is contained in:
commit
f96fcd8fcf
|
@ -22,7 +22,7 @@ use crate::constants;
|
||||||
// Internal represenation is big endian to match what `libsecp256k1` uses.
|
// Internal represenation is big endian to match what `libsecp256k1` uses.
|
||||||
// Also easier to implement comparison.
|
// Also easier to implement comparison.
|
||||||
// Debug impl omitted for now, the bytes may be secret
|
// Debug impl omitted for now, the bytes may be secret
|
||||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
|
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
|
||||||
pub struct Scalar([u8; 32]);
|
pub struct Scalar([u8; 32]);
|
||||||
impl_pretty_debug!(Scalar);
|
impl_pretty_debug!(Scalar);
|
||||||
impl_non_secure_erase!(Scalar, 0, [0u8; 32]);
|
impl_non_secure_erase!(Scalar, 0, [0u8; 32]);
|
||||||
|
|
Loading…
Reference in New Issue