Struct chain_crypto::algorithms::sumed25519::sum::SecretKey
source · pub struct SecretKey {
depth: Depth,
data: Vec<u8>,
}
Expand description
Secret Key in the binary tree sum composition of the ed25519 scheme
Serialization:
- period
- keypair : ED25519 keypair
- pks : depth size of left and right public keys
- rs : Stack of right seed for updates
Fields§
§depth: Depth
§data: Vec<u8>
Implementations§
source§impl SecretKey
impl SecretKey
const T_OFFSET: usize = 0usize
const KEYPAIR_OFFSET: usize = 4usize
const MERKLE_PKS_OFFSET: usize = 68usize
const fn seed_offset(depth: Depth) -> usize
const fn seed_offset_index(depth: Depth, i: usize) -> usize
pub fn t(&self) -> usize
pub fn sk(&self) -> Keypair
fn set_t(&mut self, t: usize)
fn set_sk(&mut self, sk: &Keypair)
fn set_merkle_pks(&mut self, n: usize, pks: &(PublicKey, PublicKey))
fn get_merkle_pks(&self, n: usize) -> (PublicKey, PublicKey)
pub fn compute_public(&self) -> PublicKey
fn create( t: usize, keypair: Keypair, pks: &[(PublicKey, PublicKey)], rs: &[Seed] ) -> Self
pub fn rs_pop(&mut self) -> Option<Seed>
pub fn rs_extend(&mut self, seed_offset: usize, rs: Seeds<'_>)
pub fn depth(&self) -> Depth
pub fn is_updatable(&self) -> bool
pub fn from_bytes(depth: Depth, bytes: &[u8]) -> Result<Self, Error>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for SecretKey
impl Send for SecretKey
impl Sync for SecretKey
impl Unpin for SecretKey
impl UnwindSafe for SecretKey
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
)