cardano-crypto-1.3.0: Cryptography primitives for cardano
LicenseBSD-style
MaintainerVincent Hanquez <vincent@snarc.org>
Stabilityexperimental
Portabilityunknown
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.ECC.Ed25519Donna

Description

Ed25519 support

Synopsis

Documentation

newtype SecretKey Source #

An Ed25519 Secret key

Constructors

SecretKey ScrubbedBytes 

Instances

Instances details
NFData SecretKey Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

Methods

rnf :: SecretKey -> () #

Eq SecretKey Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

ByteArrayAccess SecretKey Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

Methods

length :: SecretKey -> Int #

withByteArray :: SecretKey -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: SecretKey -> Ptr p -> IO () #

newtype PublicKey Source #

An Ed25519 public key

Constructors

PublicKey Bytes 

Instances

Instances details
Show PublicKey Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

NFData PublicKey Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

Methods

rnf :: PublicKey -> () #

Eq PublicKey Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

ByteArrayAccess PublicKey Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

Methods

length :: PublicKey -> Int #

withByteArray :: PublicKey -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: PublicKey -> Ptr p -> IO () #

data Signature Source #

An Ed25519 signature

Instances

Instances details
Show Signature Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

NFData Signature Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

Methods

rnf :: Signature -> () #

Eq Signature Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

ByteArrayAccess Signature Source # 
Instance details

Defined in Crypto.ECC.Ed25519Donna

Methods

length :: Signature -> Int #

withByteArray :: Signature -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: Signature -> Ptr p -> IO () #

Smart constructors

signature :: ByteArrayAccess ba => ba -> CryptoFailable Signature Source #

Try to build a signature from a bytearray

publicKey :: ByteArrayAccess ba => ba -> CryptoFailable PublicKey Source #

Try to build a public key from a bytearray

secretKey :: ByteArrayAccess ba => ba -> CryptoFailable SecretKey Source #

Try to build a secret key from a bytearray

methods

toPublic :: SecretKey -> PublicKey Source #

Create a public key from a secret key

sign :: (ByteArrayAccess msg, ByteArrayAccess salt) => SecretKey -> salt -> PublicKey -> msg -> Signature Source #

Sign a message using the key pair

verify :: ByteArrayAccess ba => PublicKey -> ba -> Signature -> Bool Source #

Verify a message