[][src]Struct wedpr_indy_crypto::bls::Generator

pub struct Generator { /* fields omitted */ }

BLS generator point. BLS algorithm requires choosing of generator point that must be known to all parties. The most of BLS methods require generator to be provided.

Implementations

impl Generator[src]

pub fn new() -> Result<Generator, IndyCryptoError>[src]

Creates and returns random generator point that satisfies BLS algorithm requirements.

Example

use indy_crypto::bls::Generator;
Generator::new().unwrap();

pub fn as_bytes(&self) -> &[u8][src]

Returns BLS generator point bytes representation.

Example

use indy_crypto::bls::*;
let gen = Generator::new().unwrap();
let gen_bytes = gen.as_bytes();
assert!(gen_bytes.len() > 0);

pub fn from_bytes(bytes: &[u8]) -> Result<Generator, IndyCryptoError>[src]

Creates and returns generator point from bytes representation.

Example

use indy_crypto::bls::Generator;
let gen = Generator::new().unwrap();
let gen_bytes = gen.as_bytes();
Generator::from_bytes(gen_bytes).unwrap();

Trait Implementations

impl Debug for Generator[src]

impl<'de> Deserialize<'de> for Generator[src]

impl Serialize for Generator[src]

Auto Trait Implementations

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[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

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.