mirror of https://github.com/poanetwork/hbbft.git
Improve Hash impl for Ciphertext.
This formulation makes it harder to forget updating the `Hash` implementation if the `Ciphertext` type changes.
This commit is contained in:
parent
1f27fa6891
commit
a47123c4dd
|
@ -175,9 +175,10 @@ impl<E: Engine> PartialEq for Ciphertext<E> {
|
||||||
|
|
||||||
impl<E: Engine> Hash for Ciphertext<E> {
|
impl<E: Engine> Hash for Ciphertext<E> {
|
||||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
self.0.into_affine().into_compressed().as_ref().hash(state);
|
let Ciphertext(ref u, ref v, ref w) = *self;
|
||||||
self.1.hash(state);
|
u.into_affine().into_compressed().as_ref().hash(state);
|
||||||
self.2.into_affine().into_compressed().as_ref().hash(state);
|
v.hash(state);
|
||||||
|
w.into_affine().into_compressed().as_ref().hash(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue