pub struct DeterministicPublicKey(/* private fields */);Expand description
Used to deterministically generate all other generators given a commitment to a private key This is effectively a BLS signature public key
Implementations§
Source§impl DeterministicPublicKey
impl DeterministicPublicKey
Sourcepub fn to_bytes_compressed_form(&self) -> [u8; 96]
pub fn to_bytes_compressed_form(&self) -> [u8; 96]
Convert to raw bytes compressed form
Sourcepub fn to_bytes_uncompressed_form(&self) -> [u8; 192]
pub fn to_bytes_uncompressed_form(&self) -> [u8; 192]
Convert to raw bytes uncompressed form
Source§impl DeterministicPublicKey
impl DeterministicPublicKey
Sourcepub fn new(option: Option<KeyGenOption>) -> Result<(Self, SecretKey), BBSError>
pub fn new(option: Option<KeyGenOption>) -> Result<(Self, SecretKey), BBSError>
Generates a random Secretkey and only creates the commitment to it
Sourcepub fn to_public_key(&self, message_count: usize) -> Result<PublicKey, BBSError>
pub fn to_public_key(&self, message_count: usize) -> Result<PublicKey, BBSError>
Convert to a normal public key but deterministically derive all the generators using the hash to curve algorithm BLS12381G1_XMD:SHA-256_SSWU_RO denoted as H2C h_0 <- H2C(w || I2OSP(0, 4) || I2OSP(0, 1) || I2OSP(message_count, 4)) h_i <- H2C(w || I2OSP(i, 4) || I2OSP(0, 1) || I2OSP(message_count, 4))
Trait Implementations§
Source§impl AsRef<G2> for DeterministicPublicKey
impl AsRef<G2> for DeterministicPublicKey
Source§impl Clone for DeterministicPublicKey
impl Clone for DeterministicPublicKey
Source§fn clone(&self) -> DeterministicPublicKey
fn clone(&self) -> DeterministicPublicKey
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DeterministicPublicKey
Source§impl Debug for DeterministicPublicKey
impl Debug for DeterministicPublicKey
Source§impl Default for DeterministicPublicKey
impl Default for DeterministicPublicKey
Source§impl<'a> Deserialize<'a> for DeterministicPublicKey
impl<'a> Deserialize<'a> for DeterministicPublicKey
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DeterministicPublicKey
impl Display for DeterministicPublicKey
impl Eq for DeterministicPublicKey
Source§impl From<&G2> for DeterministicPublicKey
impl From<&G2> for DeterministicPublicKey
Source§impl From<G2> for DeterministicPublicKey
impl From<G2> for DeterministicPublicKey
Source§impl HashElem for DeterministicPublicKey
impl HashElem for DeterministicPublicKey
Source§impl PartialEq for DeterministicPublicKey
impl PartialEq for DeterministicPublicKey
Source§fn eq(&self, other: &DeterministicPublicKey) -> bool
fn eq(&self, other: &DeterministicPublicKey) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DeterministicPublicKey
impl Serialize for DeterministicPublicKey
impl StructuralPartialEq for DeterministicPublicKey
Source§impl TryFrom<&[u8]> for DeterministicPublicKey
impl TryFrom<&[u8]> for DeterministicPublicKey
Auto Trait Implementations§
impl Freeze for DeterministicPublicKey
impl RefUnwindSafe for DeterministicPublicKey
impl Send for DeterministicPublicKey
impl Sync for DeterministicPublicKey
impl Unpin for DeterministicPublicKey
impl UnsafeUnpin for DeterministicPublicKey
impl UnwindSafe for DeterministicPublicKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more