Copyright | (c) Joseph Abrahamson 2013 |
---|---|
License | MIT |
Maintainer | me@jspha.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Signatures: Crypto.Saltine.Core.Sign
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.
- data SecretKey
- data PublicKey
- type Keypair = (SecretKey, PublicKey)
- newKeypair :: IO Keypair
- sign :: SecretKey -> ByteString -> ByteString
- signOpen :: PublicKey -> ByteString -> Maybe ByteString
- signDetached :: SecretKey -> ByteString -> ByteString
- signVerifyDetached :: PublicKey -> ByteString -> ByteString -> Bool
Documentation
An opaque box
cryptographic secret key.
An opaque box
cryptographic public key.
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 |
-> ByteString | Signature |
Returns just the signature for a message using a SecretKey.
:: PublicKey | |
-> ByteString | Signature |
-> ByteString | Message |
-> Bool |
Returns True
if the signature is valid for the given public key and
message.