| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Cometa.Crypto.Ed25519.Signature
Contents
Description
Ed25519 signatures as immutable 64-byte values. Import checks encoded length, not whether a signature verifies against a particular key/message.
import qualified Cometa.Crypto.Ed25519.Signature as Signature roundTrip :: Signature.Signature -> Bool roundTrip value = Signature.fromBytes (Signature.toBytes value) == Right value
Documentation
An immutable 64-byte Ed25519 signature. Equality compares bytes;
ordering is lexicographic byte ordering. Show is diagnostic; use toHex
for a stable textual representation.
Instances
| Show Signature Source # | |
| Eq Signature Source # | |
| Ord Signature Source # | |
Import
fromBytes :: ByteString -> Either Error Signature Source #
Import exactly 64 bytes. Other lengths return InvalidEd25519SignatureLength.
No cryptographic verification is performed.
fromHex :: Text -> Either Error Signature Source #
Import 128 ASCII hexadecimal digits, accepting either case. No whitespace
or prefix is accepted. Empty, odd-length or nonhexadecimal text returns
InvalidHex; valid hex of another byte length returns InvalidEd25519SignatureLength.
Inspection
toBytes :: Signature -> ByteString Source #
Retrieve the exact encoded bytes.
toHex :: Signature -> Text Source #
Render lowercase ASCII hexadecimal digits without a prefix or whitespace.
byteLength :: Signature -> Int Source #
Encoded byte length, always 64.