chenzehaoo/moon_guard/lib/crypto does not have a README file

    KeyPair

    pub(all) struct KeyPair {
    public_key : String
    secret_key : String
    }

    Signature

    pub(all) struct Signature {
    r : String
    s : String
    }

    base_point

    fn base_point() -> ExtPoint

    bigint_to_le_bytes

    fn bigint_to_le_bytes(n :
    BigInt
    , len : Int) -> Array[Byte]

    generate_keypair

    fn generate_keypair(seed : String) -> KeyPair

    hex_to_bytes

    fn hex_to_bytes(hex : String) -> Array[Byte]

    le_bytes_to_bigint

    fn le_bytes_to_bigint(bytes : Array[Byte]) ->
    BigInt

    point_encode

    fn point_encode(p : ExtPoint) -> Array[Byte]

    scalar_mult

    fn scalar_mult(scalar :
    BigInt
    , point : ExtPoint) -> ExtPoint

    sha512

    fn sha512(data : Array[Byte]) -> Array[Byte]

    sha512_bytes

    fn sha512_bytes(data : Array[Byte]) -> Array[Byte]

    sign

    fn sign(message : String, keypair : KeyPair) -> Signature

    signature_to_hex

    fn signature_to_hex(sig : Signature) -> String

    string_to_utf8

    fn string_to_utf8(s : String) -> Array[Byte]

    verify

    fn verify(message : String, signature : Signature, public_key : String) -> Bool