// Generated using `moon info`, DON'T EDIT IT package "experiments/moon_i2p/crypto" import { "moonbitlang/core/debug", } // Values pub fn aead_chacha20_poly1305_decrypt(Bytes, Bytes, Bytes, Bytes) -> Bytes raise CryptoError 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 pub fn hkdf_extract(Bytes, Bytes) -> Bytes pub fn hmac_sha256(Bytes, Bytes) -> Bytes 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 pub fn x25519_public_key(Bytes) -> Bytes raise CryptoError // Errors #derive(Eq, @debug.Debug) pub suberror CryptoError { InvalidKeyLength(String) InvalidNonceLength(String) InvalidLength(String) AuthenticationFailed } // Types and methods pub struct Sha256 { state : FixedArray[UInt32] block : FixedArray[Byte] mut block_len : Int32 mut total_len : UInt64 } 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