[][src]Struct fawkes_crypto_powersoftau::batched_accumulator::BatchedAccumulator

pub struct BatchedAccumulator<'a, E: Engine> {
    pub tau_powers_g1: Vec<E::G1Affine>,
    pub tau_powers_g2: Vec<E::G2Affine>,
    pub alpha_tau_powers_g1: Vec<E::G1Affine>,
    pub beta_tau_powers_g1: Vec<E::G1Affine>,
    pub beta_g2: E::G2Affine,
    pub hash: GenericArray<u8, U64>,
    pub parameters: &'a CeremonyParams<E>,
}

The Accumulator is an object that participants of the ceremony contribute randomness to. This object contains powers of trapdoor tau in G1 and in G2 over fixed generators, and additionally in G1 over two other generators of exponents alpha and beta over those fixed generators. In other words:

  • (τ, τ2, ..., τ222 - 2, α, ατ, ατ2, ..., ατ221 - 1, β, βτ, βτ2, ..., βτ221 - 1)1
  • (β, τ, τ2, ..., τ221 - 1)2

Fields

tau_powers_g1: Vec<E::G1Affine>

tau^0, tau^1, tau^2, ..., tau^{TAU_POWERS_G1_LENGTH - 1}

tau_powers_g2: Vec<E::G2Affine>

tau^0, tau^1, tau^2, ..., tau^{TAU_POWERS_LENGTH - 1}

alpha_tau_powers_g1: Vec<E::G1Affine>

alpha * tau^0, alpha * tau^1, alpha * tau^2, ..., alpha * tau^{TAU_POWERS_LENGTH - 1}

beta_tau_powers_g1: Vec<E::G1Affine>

beta * tau^0, beta * tau^1, beta * tau^2, ..., beta * tau^{TAU_POWERS_LENGTH - 1}

beta_g2: E::G2Affine

beta

hash: GenericArray<u8, U64>

Hash chain hash

parameters: &'a CeremonyParams<E>

The parameters used for the setup of this accumulator

Implementations

impl<'a, E: Engine> BatchedAccumulator<'a, E>[src]

pub fn empty(parameters: &'a CeremonyParams<E>) -> Self[src]

impl<'a, E: Engine> BatchedAccumulator<'a, E>[src]

pub fn verify_transformation(
    input_map: &Mmap,
    output_map: &Mmap,
    key: &PublicKey<E>,
    digest: &[u8],
    input_is_compressed: UseCompression,
    output_is_compressed: UseCompression,
    check_input_for_correctness: CheckForCorrectness,
    check_output_for_correctness: CheckForCorrectness,
    parameters: &'a CeremonyParams<E>
) -> bool
[src]

Verifies a transformation of the Accumulator with the PublicKey, given a 64-byte transcript digest.

pub fn decompress(
    input_map: &Mmap,
    output_map: &mut MmapMut,
    check_input_for_correctness: CheckForCorrectness,
    parameters: &'a CeremonyParams<E>
) -> Result<()>
[src]

pub fn deserialize(
    input_map: &Mmap,
    check_input_for_correctness: CheckForCorrectness,
    compression: UseCompression,
    parameters: &'a CeremonyParams<E>
) -> Result<BatchedAccumulator<'a, E>>
[src]

pub fn serialize(
    &mut self,
    output_map: &mut MmapMut,
    compression: UseCompression,
    parameters: &CeremonyParams<E>
) -> Result<()>
[src]

pub fn read_chunk(
    &mut self,
    from: usize,
    size: usize,
    compression: UseCompression,
    checked: CheckForCorrectness,
    input_map: &Mmap
) -> Result<(), DeserializationError>
[src]

pub fn write_chunk(
    &mut self,
    chunk_start: usize,
    compression: UseCompression,
    output_map: &mut MmapMut
) -> Result<()>
[src]

Write the accumulator with some compression behavior.

pub fn transform(
    input_map: &Mmap,
    output_map: &mut MmapMut,
    input_is_compressed: UseCompression,
    compress_the_output: UseCompression,
    check_input_for_correctness: CheckForCorrectness,
    key: &PrivateKey<E>,
    parameters: &'a CeremonyParams<E>
) -> Result<()>
[src]

Transforms the accumulator with a private key. Due to large amount of data in a previous accumulator even in the compressed form this function can now work on compressed input. Output can be made in any form WARNING: Contributor does not have to check that values from challenge file were serialized correctly, but we may want to enforce it if a ceremony coordinator does not recompress the previous contribution into the new challenge file

pub fn generate_initial(
    output_map: &mut MmapMut,
    compress_the_output: UseCompression,
    parameters: &'a CeremonyParams<E>
) -> Result<()>
[src]

Transforms the accumulator with a private key.

Auto Trait Implementations

impl<'a, E> RefUnwindSafe for BatchedAccumulator<'a, E> where
    E: RefUnwindSafe,
    <E as Engine>::G1Affine: RefUnwindSafe,
    <E as Engine>::G2Affine: RefUnwindSafe

impl<'a, E> Send for BatchedAccumulator<'a, E> where
    E: Sync,
    <E as Engine>::G1Affine: Send,
    <E as Engine>::G2Affine: Send

impl<'a, E> Sync for BatchedAccumulator<'a, E> where
    E: Sync,
    <E as Engine>::G1Affine: Sync,
    <E as Engine>::G2Affine: Sync

impl<'a, E> Unpin for BatchedAccumulator<'a, E> where
    <E as Engine>::G1Affine: Unpin,
    <E as Engine>::G2Affine: Unpin

impl<'a, E> UnwindSafe for BatchedAccumulator<'a, E> where
    E: RefUnwindSafe,
    <E as Engine>::G1Affine: UnwindSafe,
    <E as Engine>::G2Affine: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.