pub struct SigCtx { /* private fields */ }
Implementations§
source§impl SigCtx
impl SigCtx
pub fn new() -> SigCtx
pub fn hash( &self, id: &str, pk: &Point, msg: &[u8] ) -> Result<[u8; 32], Sm2Error>
pub fn recid_combine( &self, id: &str, pk: &Point, msg: &[u8] ) -> Result<Vec<u8>, Sm2Error>
pub fn sign( &self, msg: &[u8], sk: &BigUint, pk: &Point ) -> Result<Signature, Sm2Error>
pub fn sign_raw( &self, digest: &[u8], sk: &BigUint ) -> Result<Signature, Sm2Error>
pub fn verify( &self, msg: &[u8], pk: &Point, sig: &Signature ) -> Result<bool, Sm2Error>
pub fn verify_raw( &self, digest: &[u8], pk: &Point, sig: &Signature ) -> Result<bool, Sm2Error>
pub fn new_keypair(&self) -> Result<(Point, BigUint), Sm2Error>
pub fn pk_from_sk(&self, sk: &BigUint) -> Result<Point, Sm2Error>
pub fn load_pubkey(&self, buf: &[u8]) -> Result<Point, Sm2Error>
pub fn serialize_pubkey( &self, p: &Point, compress: bool ) -> Result<Vec<u8>, Sm2Error>
pub fn load_seckey(&self, buf: &[u8]) -> Result<BigUint, Sm2Error>
pub fn serialize_seckey(&self, x: &BigUint) -> Result<Vec<u8>, Sm2Error>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SigCtx
impl Send for SigCtx
impl Sync for SigCtx
impl Unpin for SigCtx
impl UnwindSafe for SigCtx
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