Move PublicKey to store uncompressed bytes.

This is an optimisation that allows for faster hashing of a public key,
however it adds a penalty to SSZ encoding because we need to go
decompressed -> PublicKey -> compressed.

The spec presently uses compressed bytes to store public keys, however
I'm hoping it will change.
This commit is contained in:
Paul Hauner
2019-03-13 14:41:43 +11:00
parent 243ef2db80
commit bfa2e71b46
3 changed files with 44 additions and 18 deletions

View File

@@ -14,7 +14,7 @@ impl AggregatePublicKey {
}
pub fn add(&mut self, public_key: &PublicKey) {
self.0.add(public_key.as_raw())
self.0.add(&public_key.as_raw())
}
/// Returns the underlying signature.