module arch.node.types.crypto;

import prelude open;

type PublicKey := | Curve25519PubKey ByteString;

publicKeyEq : PublicKey -> PublicKey -> Bool
  | (PublicKey.Curve25519PubKey s1) (PublicKey.Curve25519PubKey s2) := s1 == s2;

instance
PublicKeyEq : Eq PublicKey :=
  Eq.mk@{
    isEqual := publicKeyEq;
  };

instance
PublicKeyOrd : Ord PublicKey :=
  Ord.mk@{
    compare := \{_ _ := Equal};
  };

type PrivateKey := | Curve25519PrivKey ByteString;

instance
PrivateKeyOrd : Ord PrivateKey :=
  Ord.mk@{
    compare := \{_ _ := Equal};
  };

type SecretKey := | ChaCha20Key;

type Signature := | Ed25519Signature ByteString;

type Digest := | Blake3Digest ByteString;