morley-1.20.0: Developer tools for the Michelson Language
Safe HaskellSafe-Inferred
LanguageHaskell2010

Morley.Tezos.Crypto.Ed25519

Description

Ed25519 cryptographic primitives.

Synopsis

Cryptographic primitive types

newtype PublicKey Source #

ED25519 public cryptographic key.

Constructors

PublicKey 

Instances

Instances details
Generic PublicKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Associated Types

type Rep PublicKey :: Type -> Type #

Show PublicKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

NFData PublicKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Methods

rnf :: PublicKey -> () #

Eq PublicKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Ord PublicKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Buildable PublicKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Methods

build :: PublicKey -> Doc

buildList :: [PublicKey] -> Doc

type Rep PublicKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

type Rep PublicKey = D1 ('MetaData "PublicKey" "Morley.Tezos.Crypto.Ed25519" "morley-1.20.0-inplace" 'True) (C1 ('MetaCons "PublicKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unPublicKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PublicKey)))

data SecretKey Source #

ED25519 secret cryptographic key.

Instances

Instances details
Generic SecretKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Associated Types

type Rep SecretKey :: Type -> Type #

Show SecretKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

NFData SecretKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Methods

rnf :: SecretKey -> () #

Eq SecretKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Buildable SecretKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Methods

build :: SecretKey -> Doc

buildList :: [SecretKey] -> Doc

type Rep SecretKey Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

type Rep SecretKey = D1 ('MetaData "SecretKey" "Morley.Tezos.Crypto.Ed25519" "morley-1.20.0-inplace" 'True) (C1 ('MetaCons "SecretKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSecretKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SecretKey)))

newtype Signature Source #

ED25519 cryptographic signature.

Constructors

Signature 

Instances

Instances details
Generic Signature Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Associated Types

type Rep Signature :: Type -> Type #

Show Signature Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

NFData Signature Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Methods

rnf :: Signature -> () #

Eq Signature Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Buildable Signature Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

Methods

build :: Signature -> Doc

buildList :: [Signature] -> Doc

type Rep Signature Source # 
Instance details

Defined in Morley.Tezos.Crypto.Ed25519

type Rep Signature = D1 ('MetaData "Signature" "Morley.Tezos.Crypto.Ed25519" "morley-1.20.0-inplace" 'True) (C1 ('MetaCons "Signature" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSignature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Signature)))

detSecretKey :: ByteString -> SecretKey Source #

Deterministicaly generate a secret key from seed.

randomSecretKey :: MonadRandom m => m SecretKey Source #

Generate a random secret key.

toPublic :: SecretKey -> PublicKey Source #

Create a public key from a secret key.

Raw bytes (no checksums, tags or anything)

publicKeyToBytes :: ByteArray ba => PublicKey -> ba Source #

Convert a PublicKey to raw bytes.

publicKeyLengthBytes :: (Integral n, CheckIntSubType Int n) => n Source #

signatureToBytes :: ByteArray ba => Signature -> ba Source #

Convert a Signature to raw bytes.

signatureLengthBytes :: (Integral n, CheckIntSubType Int n) => n Source #

Formatting and parsing

Signing

sign :: SecretKey -> ByteString -> Signature Source #

Sign a message using the secret key.

checkSignature :: PublicKey -> Signature -> ByteString -> Bool Source #

Check that a sequence of bytes has been signed with a given key.