feat: bootstrap moon-i2p core protocol foundation
This commit is contained in:
commit
e527b84bc3
47 files changed
+5350
No files matched your search
@@ -0,0 +1,59 @@
|
||||
// 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 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 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 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
|
||||
|
||||
// Type aliases
|
||||
|
||||
// Traits
|
||||
Reference in new issue
Block a user