Trait askar_crypto::alg::bls::BlsPublicKeyType[][src]

pub trait BlsPublicKeyType: 'static {
    type Buffer: Clone + Debug + PartialEq + Sized;
    type BufferSize: ArrayLength<u8>;

    const ALG_TYPE: BlsCurves;
    const JWK_CURVE: &'static str;

    fn from_secret_scalar(secret: &Scalar) -> Self::Buffer;
fn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>;
fn with_bytes<O>(
        buf: &Self::Buffer,
        alg: Option<KeyAlg>,
        f: impl FnOnce(&[u8]) -> O
    ) -> O; fn get_jwk_curve(_alg: Option<KeyAlg>) -> &'static str { ... } }
This is supported on crate feature bls only.
Expand description

Trait implemented by supported BLS public key types

Associated Types

type Buffer: Clone + Debug + PartialEq + Sized[src]

Expand description

The concrete key representation

type BufferSize: ArrayLength<u8>[src]

Expand description

The size of the serialized public key

Loading content...

Associated Constants

const ALG_TYPE: BlsCurves[src]

Expand description

The associated algorithm type

const JWK_CURVE: &'static str[src]

Expand description

The associated JWK curve name

Loading content...

Required methods

fn from_secret_scalar(secret: &Scalar) -> Self::Buffer[src]

Expand description

Initialize from the secret scalar

fn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>[src]

Expand description

Initialize from the compressed bytes

fn with_bytes<O>(
    buf: &Self::Buffer,
    alg: Option<KeyAlg>,
    f: impl FnOnce(&[u8]) -> O
) -> O
[src]

Expand description

Access the bytes of the public key

Loading content...

Provided methods

fn get_jwk_curve(_alg: Option<KeyAlg>) -> &'static str[src]

Expand description

Get the JWK curve for a specific key algorithm

Loading content...

Implementors

impl BlsPublicKeyType for G1[src]

type Buffer = G1Affine

type BufferSize = U48

const ALG_TYPE: BlsCurves[src]

const JWK_CURVE: &'static str[src]

fn from_secret_scalar(secret: &Scalar) -> Self::Buffer[src]

fn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>[src]

fn with_bytes<O>(
    buf: &Self::Buffer,
    _alg: Option<KeyAlg>,
    f: impl FnOnce(&[u8]) -> O
) -> O
[src]

impl BlsPublicKeyType for G1G2[src]

type Buffer = (G1Affine, G2Affine)

type BufferSize = U144

const ALG_TYPE: BlsCurves[src]

const JWK_CURVE: &'static str[src]

fn get_jwk_curve(alg: Option<KeyAlg>) -> &'static str[src]

fn from_secret_scalar(secret: &Scalar) -> Self::Buffer[src]

fn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>[src]

fn with_bytes<O>(
    buf: &Self::Buffer,
    alg: Option<KeyAlg>,
    f: impl FnOnce(&[u8]) -> O
) -> O
[src]

impl BlsPublicKeyType for G2[src]

type Buffer = G2Affine

type BufferSize = U96

const ALG_TYPE: BlsCurves[src]

const JWK_CURVE: &'static str[src]

fn from_secret_scalar(secret: &Scalar) -> Self::Buffer[src]

fn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>[src]

fn with_bytes<O>(
    buf: &Self::Buffer,
    _alg: Option<KeyAlg>,
    f: impl FnOnce(&[u8]) -> O
) -> O
[src]

Loading content...