pub struct AuditSigner { /* private fields */ }Expand description
ed25519 审计签名器(持有私钥)
同一私钥 + 同一载荷 → 同一签名(RFC 8032 确定性 nonce,无 RNG),与 evorule 的确定性执行纪律兼容。
Implementations§
Source§impl AuditSigner
impl AuditSigner
Sourcepub fn from_bytes(seed: [u8; 32]) -> Self
pub fn from_bytes(seed: [u8; 32]) -> Self
从 32 字节私钥种子构造签名器
Sourcepub fn generate_keys() -> Result<(String, String), SignError>
pub fn generate_keys() -> Result<(String, String), SignError>
生成一对新密钥(一次性运维操作)
返回 (sk_seed_hex, pk_hex):sk_seed_hex 为 32 字节私钥种子(需私密保存),
pk_hex 为 32 字节压缩公钥(可公开分发供验证)。
Sourcepub fn verifying_bytes(&self) -> [u8; 32]
pub fn verifying_bytes(&self) -> [u8; 32]
32 字节压缩公钥(供验证方使用)
Sourcepub fn signature_bytes(&self, payload: &[u8]) -> [u8; 64]
pub fn signature_bytes(&self, payload: &[u8]) -> [u8; 64]
对载荷做确定性签名,返回 64 字节签名
Trait Implementations§
Source§impl Clone for AuditSigner
impl Clone for AuditSigner
Source§fn clone(&self) -> AuditSigner
fn clone(&self) -> AuditSigner
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AuditSigner
impl RefUnwindSafe for AuditSigner
impl Send for AuditSigner
impl Sync for AuditSigner
impl Unpin for AuditSigner
impl UnsafeUnpin for AuditSigner
impl UnwindSafe for AuditSigner
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