mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-12 02:14:10 +00:00
* Add basic block processing benches * Start reviving state processing benches * Fix old block builders * Add optimization for faster pubkey add * Tidy benches, add another * Add extra block processing bench * Start working on faster BLS scheme * Add partially complete sig verify optimization * Add .gitignore to state processing * Add progress on faster signature verification * Fix SignatureSet for fake_crypto * Tidy attester slashings sig set * Tidy bulk signature verifier * Refactor signature sets to be cleaner * Start threading SignatureStrategy through code * Add (empty) test dir * Move BenchingBlockBuilder * Add initial block signature verification tests * Add tests for bulk signature verification * Start threading SignatureStrategy in block proc. * Refactor per_block_processing errors * Use sig set tuples instead of lists of two * Remove dead code * Thread VerifySignatures through per_block_processing * Add bulk signature verification * Introduce parallel bulk signature verification * Expand state processing benches * Fix additional compile errors * Fix issue where par iter chunks is 0 * Update milagro_bls dep * Remove debugs, code fragment in beacon chain * Tidy, add comments to block sig verifier * Fix various PR comments * Add block_root option to per_block_processing * Fix comment in block signature verifier * Fix comments from PR review * Remove old comment * Fix comment
56 lines
1.2 KiB
Rust
56 lines
1.2 KiB
Rust
use super::{PublicKey, BLS_PUBLIC_KEY_BYTE_SIZE};
|
|
use milagro_bls::G1Point;
|
|
|
|
/// A BLS aggregate public key.
|
|
///
|
|
/// This struct is a wrapper upon a base type and provides helper functions (e.g., SSZ
|
|
/// serialization).
|
|
#[derive(Debug, Clone, Default)]
|
|
pub struct FakeAggregatePublicKey {
|
|
bytes: Vec<u8>,
|
|
/// Never used, only use for compatibility with "real" `AggregatePublicKey`.
|
|
pub point: G1Point,
|
|
}
|
|
|
|
impl FakeAggregatePublicKey {
|
|
pub fn new() -> Self {
|
|
Self::zero()
|
|
}
|
|
|
|
pub fn add_without_affine(&mut self, _public_key: &PublicKey) {
|
|
// No nothing.
|
|
}
|
|
|
|
pub fn affine(&mut self) {
|
|
// No nothing.
|
|
}
|
|
|
|
/// Creates a new all-zero's aggregate public key
|
|
pub fn zero() -> Self {
|
|
Self {
|
|
bytes: vec![0; BLS_PUBLIC_KEY_BYTE_SIZE],
|
|
point: G1Point::new(),
|
|
}
|
|
}
|
|
|
|
pub fn add(&mut self, _public_key: &PublicKey) {
|
|
// No nothing.
|
|
}
|
|
|
|
pub fn add_point(&mut self, _point: &G1Point) {
|
|
// No nothing.
|
|
}
|
|
|
|
pub fn as_raw(&self) -> &Self {
|
|
&self
|
|
}
|
|
|
|
pub fn into_raw(self) -> Self {
|
|
self
|
|
}
|
|
|
|
pub fn as_bytes(&self) -> Vec<u8> {
|
|
self.bytes.clone()
|
|
}
|
|
}
|