Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type SignedBlock = (ByteString, Signature, PublicKey)
- type Blocks = NonEmpty SignedBlock
- signBlock :: SecretKey -> ByteString -> IO (SignedBlock, SecretKey)
- verifyBlocks :: Blocks -> PublicKey -> Bool
- verifySecretProof :: SecretKey -> SignedBlock -> Bool
- verifySignatureProof :: Signature -> SignedBlock -> Bool
- getSignatureProof :: SignedBlock -> SecretKey -> Signature
- data PublicKey
- data SecretKey
- data Signature
- convert :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout
- publicKey :: ByteArrayAccess ba => ba -> CryptoFailable PublicKey
- secretKey :: ByteArrayAccess ba => ba -> CryptoFailable SecretKey
- signature :: ByteArrayAccess ba => ba -> CryptoFailable Signature
- eitherCryptoError :: CryptoFailable a -> Either CryptoError a
- maybeCryptoError :: CryptoFailable a -> Maybe a
- generateSecretKey :: MonadRandom m => m SecretKey
- toPublic :: SecretKey -> PublicKey
Documentation
type SignedBlock = (ByteString, Signature, PublicKey) Source #
type Blocks = NonEmpty SignedBlock Source #
signBlock :: SecretKey -> ByteString -> IO (SignedBlock, SecretKey) Source #
verifySecretProof :: SecretKey -> SignedBlock -> Bool Source #
verifySignatureProof :: Signature -> SignedBlock -> Bool Source #
getSignatureProof :: SignedBlock -> SecretKey -> Signature Source #
An Ed25519 public key
Instances
An Ed25519 Secret key
Instances
An Ed25519 signature
Instances
convert :: (ByteArrayAccess bin, ByteArray bout) => bin -> bout #
Convert a bytearray to another type of bytearray
publicKey :: ByteArrayAccess ba => ba -> CryptoFailable PublicKey #
Try to build a public key from a bytearray
secretKey :: ByteArrayAccess ba => ba -> CryptoFailable SecretKey #
Try to build a secret key from a bytearray
signature :: ByteArrayAccess ba => ba -> CryptoFailable Signature #
Try to build a signature from a bytearray
eitherCryptoError :: CryptoFailable a -> Either CryptoError a #
Transform a CryptoFailable to an Either
maybeCryptoError :: CryptoFailable a -> Maybe a #
Transform a CryptoFailable to a Maybe
generateSecretKey :: MonadRandom m => m SecretKey #
Generate a secret key