saltine-0.1.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
LanguageHaskell2010

Crypto.Saltine.Class

Description

Saltine type classes

Synopsis

Documentation

class IsEncoding a where #

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 #

decode :: ByteString -> Maybe a #

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

Instances
IsEncoding Nonce # 
Instance details

Defined in Crypto.Saltine.Core.Stream

IsEncoding Key # 
Instance details

Defined in Crypto.Saltine.Core.Stream

IsEncoding PublicKey # 
Instance details

Defined in Crypto.Saltine.Core.Sign

IsEncoding SecretKey # 
Instance details

Defined in Crypto.Saltine.Core.Sign

IsEncoding Nonce # 
Instance details

Defined in Crypto.Saltine.Core.SecretBox

IsEncoding Key # 
Instance details

Defined in Crypto.Saltine.Core.SecretBox

IsEncoding Scalar # 
Instance details

Defined in Crypto.Saltine.Core.ScalarMult

IsEncoding GroupElement # 
Instance details

Defined in Crypto.Saltine.Core.ScalarMult

IsEncoding Authenticator # 
Instance details

Defined in Crypto.Saltine.Core.OneTimeAuth

IsEncoding Key # 
Instance details

Defined in Crypto.Saltine.Core.OneTimeAuth

IsEncoding ShorthashKey # 
Instance details

Defined in Crypto.Saltine.Core.Hash

IsEncoding Nonce # 
Instance details

Defined in Crypto.Saltine.Core.Box

IsEncoding CombinedKey # 
Instance details

Defined in Crypto.Saltine.Core.Box

IsEncoding PublicKey # 
Instance details

Defined in Crypto.Saltine.Core.Box

IsEncoding SecretKey # 
Instance details

Defined in Crypto.Saltine.Core.Box

IsEncoding Authenticator # 
Instance details

Defined in Crypto.Saltine.Core.Auth

IsEncoding Key # 
Instance details

Defined in Crypto.Saltine.Core.Auth

IsEncoding Nonce # 
Instance details

Defined in Crypto.Saltine.Core.AEAD

IsEncoding Key # 
Instance details

Defined in Crypto.Saltine.Core.AEAD

class IsNonce n where #

A generic class for interacting with nonces.

Minimal complete definition

zero, nudge

Methods

zero :: n #

Some privileged nonce value.

nudge :: n -> n #

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.

Instances
IsNonce Nonce # 
Instance details

Defined in Crypto.Saltine.Core.Stream

Methods

zero :: Nonce #

nudge :: Nonce -> Nonce #

IsNonce Nonce # 
Instance details

Defined in Crypto.Saltine.Core.SecretBox

Methods

zero :: Nonce #

nudge :: Nonce -> Nonce #

IsNonce Nonce # 
Instance details

Defined in Crypto.Saltine.Core.Box

Methods

zero :: Nonce #

nudge :: Nonce -> Nonce #

IsNonce Nonce # 
Instance details

Defined in Crypto.Saltine.Core.AEAD

Methods

zero :: Nonce #

nudge :: Nonce -> Nonce #