pub enum TypedSeed {
Ed25519([u8; 32]),
P256([u8; 32]),
}Expand description
A private key seed that knows its curve.
Adding a new curve means adding a variant here. The compiler then errors
on every match that doesn’t handle it — no grep needed.
Variants§
Ed25519([u8; 32])
Ed25519 private key seed (32 bytes).
P256([u8; 32])
P-256 private scalar (32 bytes).
Implementations§
Source§impl TypedSeed
impl TypedSeed
Sourcepub fn as_bytes(&self) -> &[u8; 32]
pub fn as_bytes(&self) -> &[u8; 32]
Returns the raw seed bytes (32 bytes for both Ed25519 and P-256).
Sourcepub fn to_secure_seed(&self) -> SecureSeed
pub fn to_secure_seed(&self) -> SecureSeed
Convert to a legacy SecureSeed (loses curve info — use sparingly).
Trait Implementations§
impl Sealed for TypedSeed
impl Secret for TypedSeed
Auto Trait Implementations§
impl Freeze for TypedSeed
impl RefUnwindSafe for TypedSeed
impl Send for TypedSeed
impl Sync for TypedSeed
impl Unpin for TypedSeed
impl UnsafeUnpin for TypedSeed
impl UnwindSafe for TypedSeed
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