feat: add pure-MoonBit SHA-512, Ed25519, AES-256-CBC, and signed RouterInfo/LeaseSet2

This commit is contained in:
nandi committed 2026-11-27 19:21:57 +00:00
1 parent c95e9cfc21
commit dff69dfac6
9 files changed
+1330 -4

No files matched your search

+27
View File
@@ -10,12 +10,26 @@ pub fn aead_chacha20_poly1305_decrypt(Bytes, Bytes, Bytes, Bytes) -> Bytes raise
pub fn aead_chacha20_poly1305_encrypt(Bytes, Bytes, Bytes, Bytes) -> Bytes raise CryptoError
pub fn aes256_cbc_decrypt(Bytes, Bytes, Bytes) -> Bytes raise CryptoError
pub fn aes256_cbc_encrypt(Bytes, Bytes, Bytes) -> Bytes raise CryptoError
pub fn aes256_decrypt_block(Bytes, Bytes) -> Bytes raise CryptoError
pub fn aes256_encrypt_block(Bytes, Bytes) -> Bytes raise CryptoError
pub fn chacha20_block(Bytes, UInt32, Bytes) -> Bytes raise CryptoError
pub fn chacha20_xor(Bytes, UInt32, Bytes, Bytes) -> Bytes raise CryptoError
pub fn ct_eq(Bytes, Bytes) -> Bool
pub fn ed25519_public_key(Bytes) -> Bytes raise CryptoError
pub fn ed25519_sign(Bytes, Bytes) -> Bytes raise CryptoError
pub fn ed25519_verify(Bytes, Bytes, Bytes) -> Bool
pub fn hkdf(Bytes, Bytes, Bytes, Int32) -> Bytes raise CryptoError
pub fn hkdf_expand(Bytes, Bytes, Int32) -> Bytes raise CryptoError
@@ -28,6 +42,8 @@ pub fn poly1305_mac(Bytes, Bytes) -> Bytes raise CryptoError
pub fn sha256(Bytes) -> Bytes
pub fn sha512(Bytes) -> Bytes
pub fn siphash_2_4(Bytes, Bytes) -> UInt64 raise CryptoError
pub fn x25519(Bytes, Bytes) -> Bytes raise CryptoError
@@ -54,6 +70,17 @@ pub fn Sha256::finalize(Self) -> Bytes
pub fn Sha256::new() -> Self
pub fn Sha256::update(Self, Bytes) -> Unit
pub struct Sha512 {
state : FixedArray[UInt64]
block : FixedArray[Byte]
mut block_len : Int32
mut total_len_lo : UInt64
mut total_len_hi : UInt64
}
pub fn Sha512::finalize(Self) -> Bytes
pub fn Sha512::new() -> Self
pub fn Sha512::update(Self, Bytes) -> Unit
// Type aliases
// Traits