pub struct Generator(/* private fields */);Expand description
Represents a generator on the secp256k1 curve.
A generator is a public key internally but has a slightly different serialization with the first byte being tweaked.
Implementations§
Source§impl Generator
impl Generator
Sourcepub fn from_slice(bytes: &[u8]) -> Result<Self, Error>
pub fn from_slice(bytes: &[u8]) -> Result<Self, Error>
Parse a generator from a slice of bytes.
Sourcepub fn new_blinded<C: Signing>(
secp: &Secp256k1<C>,
tag: Tag,
blinding_factor: Tweak,
) -> Self
pub fn new_blinded<C: Signing>( secp: &Secp256k1<C>, tag: Tag, blinding_factor: Tweak, ) -> Self
Creates a new Generator by blinding a Tag using the given blinding factor.
Use Generator::new_unblinded for creating a Generator with zero blinding factor
Sourcepub fn new_unblinded<C: Signing>(secp: &Secp256k1<C>, tag: Tag) -> Self
pub fn new_unblinded<C: Signing>(secp: &Secp256k1<C>, tag: Tag) -> Self
Creates a new unblinded Generator by from Tag
Same as using zero Tweak with Generator::new_blinded
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Generator
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Generator
Available on crate feature
serde only.Source§fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Ord for Generator
impl Ord for Generator
Source§impl PartialOrd for Generator
impl PartialOrd for Generator
impl Copy for Generator
impl Eq for Generator
impl StructuralPartialEq for Generator
Auto Trait Implementations§
impl Freeze for Generator
impl RefUnwindSafe for Generator
impl Send for Generator
impl Sync for Generator
impl Unpin for Generator
impl UnwindSafe for Generator
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