saltine-0.2.0.1: Cryptography that's easy to digest (NaCl/libsodium bindings).
Copyright(c) Joseph Abrahamson 2013
LicenseMIT
Maintainerme@jspha.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Crypto.Saltine.Class

Description

Saltine type classes

Synopsis

Documentation

class IsEncoding a where Source #

Class for all keys and nonces in Saltine which have a representation as ByteString. encoded is a Prism of type Prism' ByteString a compatible with Control.Lens and is automatically deduced.

Minimal complete definition

encode, decode

Methods

encode :: a -> ByteString Source #

decode :: ByteString -> Maybe a Source #

encoded :: (Choice p, Applicative f) => p a (f a) -> p ByteString (f ByteString) Source #

Instances

Instances details
IsEncoding Scalar Source # 
Instance details

Defined in Crypto.Saltine.Internal.ScalarMult

IsEncoding GroupElement Source # 
Instance details

Defined in Crypto.Saltine.Internal.ScalarMult

IsEncoding Salt Source # 
Instance details

Defined in Crypto.Saltine.Internal.Password

IsEncoding GenerichashKey Source # 
Instance details

Defined in Crypto.Saltine.Internal.Hash

IsEncoding ShorthashKey Source # 
Instance details

Defined in Crypto.Saltine.Internal.Hash

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.Stream

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.Stream

IsEncoding Signature Source #

Actual signatures may be shorter, but not when generated with saltine.

Instance details

Defined in Crypto.Saltine.Internal.Sign

IsEncoding PublicKey Source # 
Instance details

Defined in Crypto.Saltine.Internal.Sign

IsEncoding SecretKey Source # 
Instance details

Defined in Crypto.Saltine.Internal.Sign

IsEncoding Authenticator Source # 
Instance details

Defined in Crypto.Saltine.Internal.SecretBox

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.SecretBox

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.SecretBox

IsEncoding Authenticator Source # 
Instance details

Defined in Crypto.Saltine.Internal.OneTimeAuth

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.OneTimeAuth

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.Box

IsEncoding CombinedKey Source # 
Instance details

Defined in Crypto.Saltine.Internal.Box

IsEncoding PublicKey Source # 
Instance details

Defined in Crypto.Saltine.Internal.Box

IsEncoding SecretKey Source # 
Instance details

Defined in Crypto.Saltine.Internal.Box

IsEncoding Authenticator Source # 
Instance details

Defined in Crypto.Saltine.Internal.Auth

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.Auth

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.XChaCha20Poly1305

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.ChaCha20Poly1305IETF

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.ChaCha20Poly1305IETF

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.ChaCha20Poly1305

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.ChaCha20Poly1305

IsEncoding Nonce Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.AES256GCM

IsEncoding Key Source # 
Instance details

Defined in Crypto.Saltine.Internal.AEAD.AES256GCM

class IsNonce n where Source #

A generic class for interacting with nonces.

Methods

zero :: n Source #

Some privileged nonce value.

nudge :: n -> n Source #

Some perturbation on nonces such that n /= nudge n with high probability. Since nonces are finite, repeats may happen in particularly small cases, but no nonces in Saltine are so small. This is not guaranteed to be difficult to predict---if a nonce had an Enum instance succ would be a good implementation excepting that succ is partial.