morley-1.12.0: Developer tools for the Michelson Language
Safe HaskellNone
LanguageHaskell2010

Tezos.Crypto.P256

Description

P256 cryptographic primitives.

Synopsis

Cryptographic primitive types

newtype PublicKey Source #

P256 public cryptographic key.

Constructors

PublicKey 

Instances

Instances details
Eq PublicKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Show PublicKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Generic PublicKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Associated Types

type Rep PublicKey :: Type -> Type #

NFData PublicKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Methods

rnf :: PublicKey -> () #

Buildable PublicKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Methods

build :: PublicKey -> Builder #

type Rep PublicKey Source # 
Instance details

Defined in Tezos.Crypto.P256

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

data SecretKey Source #

P256 secret cryptographic key.

Instances

Instances details
Eq SecretKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Show SecretKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Generic SecretKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Associated Types

type Rep SecretKey :: Type -> Type #

NFData SecretKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Methods

rnf :: SecretKey -> () #

Buildable SecretKey Source # 
Instance details

Defined in Tezos.Crypto.P256

Methods

build :: SecretKey -> Builder #

type Rep SecretKey Source # 
Instance details

Defined in Tezos.Crypto.P256

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

newtype Signature Source #

P256 cryptographic signature.

Constructors

Signature 

Instances

Instances details
Eq Signature Source # 
Instance details

Defined in Tezos.Crypto.P256

Show Signature Source # 
Instance details

Defined in Tezos.Crypto.P256

Generic Signature Source # 
Instance details

Defined in Tezos.Crypto.P256

Associated Types

type Rep Signature :: Type -> Type #

NFData Signature Source # 
Instance details

Defined in Tezos.Crypto.P256

Methods

rnf :: Signature -> () #

Buildable Signature Source # 
Instance details

Defined in Tezos.Crypto.P256

Methods

build :: Signature -> Builder #

type Rep Signature Source # 
Instance details

Defined in Tezos.Crypto.P256

type Rep Signature = D1 ('MetaData "Signature" "Tezos.Crypto.P256" "morley-1.12.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.

toPublic :: SecretKey -> PublicKey Source #

Create a public key from a secret key.

Raw bytes (no checksums, tags or anything)

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

Convert a PublicKey to raw bytes.

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

Convert a PublicKey to raw bytes.

Formatting and parsing

Signing

sign :: MonadRandom m => SecretKey -> ByteString -> m 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.