[−][src]Struct leslie_lamport::LamportSignature
Lamport Signature
After Signing with the LamportKeyPair
struct, you can keep the LamportSignature
struct Public. Your LamportKeyPair
will now be useless for signing as it's a One-Time Signature.
This Struct Contains:
- The Hashing Algorithm as
Enum Algorithms
- The Public Key as a
Vector<Strings>
- The Input String as a
String
- The Signature as a
Vector<Strings>
Example Usage
Its Only Function is for Verification Purposes
use leslie_lamport::{LamportKeyPair,Algorithms,LamportSignature}; // Generate Keypair let keypair = LamportKeyPair::generate(Algorithms::OS_SHA256); // Generates a "LamportSignature" Struct for a One-Time Signature For a 512-bit Hexadecimal String let signature = keypair.sign("A55FE31CB83313443F38356A065F9E6386BE591C30490ECC6994B0C152D46D80ABC010DF01257FFEC437402967995D5C34EAD950E0C62C3BCAFF34BCEFB3BDF7"); // Verify Signature let is_verified: bool = signature.verify();
Fields
hash: Algorithms
pk: Vec<String>
input: String
signature: Vec<String>
Implementations
impl LamportSignature
[src]
pub fn verify(&self) -> bool
[src]
The Verify Function that returns a boolean
value when verifying whether the signature matches the public key and input
It must:
- The Number of Public Keys must be divisible by
8
and then2
to retrieven
- THe Number of Signatures must be at most half of the Public Keys
- The Input Must Be At Most The Size Of
n
in Bytes And Be In Hexadecimal (which is converted to binary)
Trait Implementations
impl Clone for LamportSignature
[src]
pub fn clone(&self) -> LamportSignature
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for LamportSignature
[src]
impl<'de> Deserialize<'de> for LamportSignature
[src]
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Hash for LamportSignature
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<LamportSignature> for LamportSignature
[src]
pub fn eq(&self, other: &LamportSignature) -> bool
[src]
pub fn ne(&self, other: &LamportSignature) -> bool
[src]
impl PartialOrd<LamportSignature> for LamportSignature
[src]
pub fn partial_cmp(&self, other: &LamportSignature) -> Option<Ordering>
[src]
pub fn lt(&self, other: &LamportSignature) -> bool
[src]
pub fn le(&self, other: &LamportSignature) -> bool
[src]
pub fn gt(&self, other: &LamportSignature) -> bool
[src]
pub fn ge(&self, other: &LamportSignature) -> bool
[src]
impl Serialize for LamportSignature
[src]
pub fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for LamportSignature
[src]
Auto Trait Implementations
impl RefUnwindSafe for LamportSignature
[src]
impl Send for LamportSignature
[src]
impl Sync for LamportSignature
[src]
impl Unpin for LamportSignature
[src]
impl UnwindSafe for LamportSignature
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,