Struct chain_crypto::algorithms::sumed25519::sum::Signature
source · pub struct Signature(Vec<u8>);
Expand description
Signature using the repetitive MMM sum composition
Serialization:
- period
- sigma : ED25519 individual signature linked to period
- ED25519 public key of this period
- public keys : merkle tree path elements
Tuple Fields§
§0: Vec<u8>
Implementations§
source§impl Signature
impl Signature
const T_OFFSET: usize = 0usize
const SIGMA_OFFSET: usize = 4usize
const PK_OFFSET: usize = 68usize
const MERKLE_PKS_OFFSET: usize = 100usize
pub fn depth(&self) -> Depth
sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Compute the size in bytes of a signature currently this is : 100 + 32*depth()
pub fn t(&self) -> usize
fn sigma(&self) -> Signature
fn pk(&self) -> PublicKey
fn merkle_pks(&self) -> MerkleSignaturePublicKeys<'_> ⓘ
fn create(t: usize, sigma: Signature, pk: &PublicKey, pks: &[PublicKey]) -> Self
pub fn from_bytes(depth: Depth, bytes: &[u8]) -> Result<Self, Error>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Signature
impl Send for Signature
impl Sync for Signature
impl Unpin for Signature
impl UnwindSafe for Signature
Blanket Implementations§
§impl<T> Base32Len for Twhere
T: AsRef<[u8]>,
impl<T> Base32Len for Twhere T: AsRef<[u8]>,
§fn base32_len(&self) -> usize
fn base32_len(&self) -> usize
Calculate the base32 serialized length
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
source§impl<T> ToHex for Twhere
T: AsRef<[u8]>,
impl<T> ToHex for Twhere T: AsRef<[u8]>,
source§fn encode_hex<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Lower case
letters are used (e.g. f9b4ca
)source§fn encode_hex_upper<U>(&self) -> Uwhere
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> Uwhere U: FromIterator<char>,
Encode the hex strict representing
self
into the result. Upper case
letters are used (e.g. F9B4CA
)