[][src]Trait bls_sigs_ref_rs::BLSSigCore

pub trait BLSSigCore: CurveProjective {
    type PKType: CurveProjective<Engine = Self::Engine, Scalar = Self::Scalar> + SerDes;
    fn keygen<B: AsRef<[u8]>>(sk: B) -> (Self::Scalar, Self::PKType);
fn core_sign<B: AsRef<[u8]>, C: AsRef<[u8]>>(
        x_prime: Self::Scalar,
        msg: B,
        ciphersuite: C
    ) -> Self;
fn core_verify<B: AsRef<[u8]>, C: AsRef<[u8]>>(
        pk: Self::PKType,
        sig: Self,
        msg: B,
        ciphersuite: C
    ) -> bool;
fn core_aggregate_verify<B: AsRef<[u8]>, C: AsRef<[u8]>>(
        pks: &[Self::PKType],
        msgs: &[B],
        sig: Self,
        ciphersuite: C
    ) -> bool; fn aggregate(sigs: &[Self]) -> Self { ... } }

BLS signature implementation

Associated Types

type PKType: CurveProjective<Engine = Self::Engine, Scalar = Self::Scalar> + SerDes

The type of the public key

Loading content...

Required methods

fn keygen<B: AsRef<[u8]>>(sk: B) -> (Self::Scalar, Self::PKType)

Generate secret exponent and public key

  • input: the secret key as bytes
  • output: the actual secret key x_prime, a.k.a, the secret scala
  • output: the public key g^x_prime

fn core_sign<B: AsRef<[u8]>, C: AsRef<[u8]>>(
    x_prime: Self::Scalar,
    msg: B,
    ciphersuite: C
) -> Self

Sign a message

  • input: the actual secret key x_prime
  • input: the message as bytes
  • input: the ciphersuite ID
  • output: a signature

fn core_verify<B: AsRef<[u8]>, C: AsRef<[u8]>>(
    pk: Self::PKType,
    sig: Self,
    msg: B,
    ciphersuite: C
) -> bool

Verify a signature

  • input: public key, a group element
  • input: signature, a group element
  • input: the message as bytes
  • input: ciphersuite ID
  • output: if the signature is valid or not

fn core_aggregate_verify<B: AsRef<[u8]>, C: AsRef<[u8]>>(
    pks: &[Self::PKType],
    msgs: &[B],
    sig: Self,
    ciphersuite: C
) -> bool

Verify an aggregated signature

Loading content...

Provided methods

fn aggregate(sigs: &[Self]) -> Self

Aggregate signatures

Loading content...

Implementations on Foreign Types

impl BLSSigCore for G1[src]

type PKType = G2

impl BLSSigCore for G2[src]

type PKType = G1

Loading content...

Implementors

Loading content...