Safe Haskell | None |
---|---|
Language | Haskell2010 |
Ed25519 cryptographic primitives.
Synopsis
- newtype PublicKey = PublicKey {}
- data SecretKey
- newtype Signature = Signature {}
- detSecretKey :: ByteString -> SecretKey
- toPublic :: SecretKey -> PublicKey
- publicKeyToBytes :: ByteArray ba => PublicKey -> ba
- mkPublicKey :: ByteArrayAccess ba => ba -> Either CryptoParseError PublicKey
- publicKeyLengthBytes :: Integral n => n
- signatureToBytes :: ByteArray ba => Signature -> ba
- mkSignature :: ByteArrayAccess ba => ba -> Either CryptoParseError Signature
- signatureLengthBytes :: Integral n => n
- formatPublicKey :: PublicKey -> Text
- mformatPublicKey :: PublicKey -> MText
- parsePublicKey :: Text -> Either CryptoParseError PublicKey
- formatSecretKey :: SecretKey -> Text
- formatSignature :: Signature -> Text
- mformatSignature :: Signature -> MText
- parseSignature :: Text -> Either CryptoParseError Signature
- sign :: SecretKey -> ByteString -> Signature
- checkSignature :: PublicKey -> Signature -> ByteString -> Bool
Cryptographic primitive types
ED25519 public cryptographic key.
ED25519 secret cryptographic key.
ED25519 cryptographic signature.
detSecretKey :: ByteString -> SecretKey Source #
Deterministicaly generate a secret key from seed.
Raw bytes (no checksums, tags or anything)
mkPublicKey :: ByteArrayAccess ba => ba -> Either CryptoParseError PublicKey Source #
Make a PublicKey
from raw bytes.
publicKeyLengthBytes :: Integral n => n Source #
mkSignature :: ByteArrayAccess ba => ba -> Either CryptoParseError Signature Source #
Make a Signature
from raw bytes.
signatureLengthBytes :: Integral n => n Source #
Formatting and parsing
formatPublicKey :: PublicKey -> Text Source #
mformatPublicKey :: PublicKey -> MText Source #
formatSecretKey :: SecretKey -> Text Source #
formatSignature :: Signature -> Text Source #
mformatSignature :: Signature -> MText Source #
Signing
checkSignature :: PublicKey -> Signature -> ByteString -> Bool Source #
Check that a sequence of bytes has been signed with a given key.