Copyright | (c) Joseph Abrahamson 2013 |
---|---|
License | MIT |
Maintainer | me@jspha.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
The newKeypair
function randomly generates a secret key and a
corresponding public key. The sign
function signs a message
ByteString
using the signer's secret key and returns the
resulting signed message. The signOpen
function verifies the
signature in a signed message using the signer's public key then
returns the message without its signature.
Crypto.Saltine.Core.Sign is an EdDSA signature using elliptic-curve Curve25519 (see: http://ed25519.cr.yp.to/). See also, "Daniel J. Bernstein, Niels Duif, Tanja Lange, Peter Schwabe, Bo-Yin Yang. High-speed high-security signatures. Journal of Cryptographic Engineering 2 (2012), 77–89." http://ed25519.cr.yp.to/ed25519-20110926.pdf.
This is current information as of 2013 June 6.
Synopsis
- data SecretKey
- data PublicKey
- data Keypair = Keypair {}
- data Signature
- newKeypair :: IO Keypair
- sign :: SecretKey -> ByteString -> ByteString
- signOpen :: PublicKey -> ByteString -> Maybe ByteString
- signDetached :: SecretKey -> ByteString -> Signature
- signVerifyDetached :: PublicKey -> Signature -> ByteString -> Bool
Documentation
An opaque box
cryptographic secret key.
Instances
An opaque box
cryptographic public key.
Instances
A convenience type for keypairs
Instances
Eq Keypair Source # | |
Data Keypair Source # | |
Defined in Crypto.Saltine.Internal.Sign gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Keypair -> c Keypair # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Keypair # toConstr :: Keypair -> Constr # dataTypeOf :: Keypair -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Keypair) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Keypair) # gmapT :: (forall b. Data b => b -> b) -> Keypair -> Keypair # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Keypair -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Keypair -> r # gmapQ :: (forall d. Data d => d -> u) -> Keypair -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Keypair -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Keypair -> m Keypair # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Keypair -> m Keypair # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Keypair -> m Keypair # | |
Ord Keypair Source # | |
Defined in Crypto.Saltine.Internal.Sign | |
Generic Keypair Source # | |
NFData Keypair Source # | |
Defined in Crypto.Saltine.Internal.Sign | |
Hashable Keypair Source # | |
Defined in Crypto.Saltine.Internal.Sign | |
type Rep Keypair Source # | |
Defined in Crypto.Saltine.Internal.Sign type Rep Keypair = D1 ('MetaData "Keypair" "Crypto.Saltine.Internal.Sign" "saltine-0.2.0.1-inplace" 'False) (C1 ('MetaCons "Keypair" 'PrefixI 'True) (S1 ('MetaSel ('Just "secretKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SecretKey) :*: S1 ('MetaSel ('Just "publicKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PublicKey))) |
A signature for a Message
Instances
Eq Signature Source # | |
Data Signature Source # | |
Defined in Crypto.Saltine.Internal.Sign gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Signature -> c Signature # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Signature # toConstr :: Signature -> Constr # dataTypeOf :: Signature -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Signature) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Signature) # gmapT :: (forall b. Data b => b -> b) -> Signature -> Signature # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Signature -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Signature -> r # gmapQ :: (forall d. Data d => d -> u) -> Signature -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Signature -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Signature -> m Signature # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Signature -> m Signature # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Signature -> m Signature # | |
Ord Signature Source # | |
Defined in Crypto.Saltine.Internal.Sign | |
Show Signature Source # | |
Generic Signature Source # | |
NFData Signature Source # | |
Defined in Crypto.Saltine.Internal.Sign | |
Hashable Signature Source # | |
Defined in Crypto.Saltine.Internal.Sign | |
IsEncoding Signature Source # | Actual signatures may be shorter, but not when generated with saltine. |
Defined in Crypto.Saltine.Internal.Sign encode :: Signature -> ByteString Source # decode :: ByteString -> Maybe Signature Source # encoded :: (Choice p, Applicative f) => p Signature (f Signature) -> p ByteString (f ByteString) Source # | |
type Rep Signature Source # | |
Defined in Crypto.Saltine.Internal.Sign type Rep Signature = D1 ('MetaData "Signature" "Crypto.Saltine.Internal.Sign" "saltine-0.2.0.1-inplace" 'True) (C1 ('MetaCons "Signature" 'PrefixI 'True) (S1 ('MetaSel ('Just "unSignature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) |
newKeypair :: IO Keypair Source #
:: SecretKey | |
-> ByteString | Message |
-> ByteString | Signed message |
Augments a message with a signature forming a "signed message".
:: PublicKey | |
-> ByteString | Signed message |
-> Maybe ByteString | Maybe the restored message |
:: SecretKey | |
-> ByteString | Message |
-> Signature | Signature |
Returns just the signature for a message using a SecretKey.
:: PublicKey | |
-> Signature | Signature |
-> ByteString | Message (not signed) |
-> Bool |
Returns True
if the signature is valid for the given public key and
message.