pub enum EcCurve {
P256,
P384,
}Expand description
A supported NIST curve.
Variants§
Implementations§
Source§impl EcCurve
impl EcCurve
pub fn generate_private(self) -> Vec<u8> ⓘ
pub fn public_key(self, private: &[u8]) -> Option<Vec<u8>>
Sourcepub fn public_key_for_load(self, private: &[u8]) -> Option<Vec<u8>>
pub fn public_key_for_load(self, private: &[u8]) -> Option<Vec<u8>>
EcCurve::public_key for a key being loaded: P-256 skips building its base-point
table (start-up time and memory), which the first signature builds instead.
Sourcepub fn sign(
self,
private: &[u8],
digest: &[u8],
hash: HashAlg,
) -> Option<(Vec<u8>, Vec<u8>)>
pub fn sign( self, private: &[u8], digest: &[u8], hash: HashAlg, ) -> Option<(Vec<u8>, Vec<u8>)>
ECDSA over a digest; (r, s) big-endian, curve-sized.
pub fn verify(self, public: &[u8], digest: &[u8], r: &[u8], s: &[u8]) -> bool
pub fn validate_point(self, public: &[u8]) -> bool
Trait Implementations§
impl Copy for EcCurve
impl Eq for EcCurve
impl StructuralPartialEq for EcCurve
Auto Trait Implementations§
impl Forget for EcCurve
impl Freeze for EcCurve
impl Move for EcCurve
impl RefUnwindSafe for EcCurve
impl Send for EcCurve
impl Sync for EcCurve
impl Unpin for EcCurve
impl UnsafeUnpin for EcCurve
impl UnwindSafe for EcCurve
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