Copyright | (c) Max Amanshauser 2021 |
---|---|
License | MIT |
Maintainer | max@lambdalifting.org |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- box_publickeybytes :: Int
- box_secretkeybytes :: Int
- box_noncebytes :: Int
- box_zerobytes :: Int
- box_boxzerobytes :: Int
- box_macbytes :: Int
- box_beforenmbytes :: Int
- box_sealbytes :: Int
- c_box_keypair :: Ptr CChar -> Ptr CChar -> IO CInt
- c_box_easy :: Ptr CChar -> Ptr CChar -> CULLong -> Ptr CChar -> Ptr CChar -> Ptr CChar -> IO CInt
- c_box_open_easy :: Ptr CChar -> Ptr CChar -> CULLong -> Ptr CChar -> Ptr CChar -> Ptr CChar -> IO CInt
- c_box_beforenm :: Ptr CChar -> Ptr CChar -> Ptr CChar -> IO CInt
- c_box_easy_afternm :: Ptr CChar -> Ptr CChar -> CULLong -> Ptr CChar -> Ptr CChar -> IO CInt
- c_box_open_easy_afternm :: Ptr CChar -> Ptr CChar -> CULLong -> Ptr CChar -> Ptr CChar -> IO CInt
- c_box_seal :: Ptr CChar -> Ptr CChar -> CULLong -> Ptr CChar -> IO CInt
- c_box_seal_open :: Ptr CChar -> Ptr CChar -> CULLong -> Ptr CChar -> Ptr CChar -> IO CInt
- newtype SecretKey = SK {
- unSK :: ByteString
- newtype PublicKey = PK {
- unPK :: ByteString
- data Keypair = Keypair {}
- newtype CombinedKey = CK {
- unCK :: ByteString
- newtype Nonce = Nonce {}
Documentation
box_publickeybytes :: Int Source #
Size of a crypto_box
public key
box_secretkeybytes :: Int Source #
Size of a crypto_box
secret key
box_noncebytes :: Int Source #
Size of a crypto_box
nonce
box_zerobytes :: Int Source #
Size of 0-padding prepended to messages before using crypto_box
or after using crypto_box_open
box_boxzerobytes :: Int Source #
Size of 0-padding prepended to ciphertext before using
crypto_box_open
or after using crypto_box
.
box_macbytes :: Int Source #
box_beforenmbytes :: Int Source #
Size of a crypto_box_beforenm
-generated combined key
box_sealbytes :: Int Source #
Amount by which ciphertext is longer than plaintext in sealed boxes
Should always return a 0.
:: Ptr CChar | Cipher output buffer |
-> Ptr CChar | Constant message input buffer |
-> CULLong | Length of message input buffer |
-> Ptr CChar | Constant nonce buffer |
-> Ptr CChar | Constant public key buffer |
-> Ptr CChar | Constant secret key buffer |
-> IO CInt | Always 0 |
The secretbox C API uses C strings.
:: Ptr CChar | Message output buffer |
-> Ptr CChar | Constant ciphertext input buffer |
-> CULLong | Length of message input buffer |
-> Ptr CChar | Constant nonce buffer |
-> Ptr CChar | Constant public key buffer |
-> Ptr CChar | Constant secret key buffer |
-> IO CInt | 0 for success, -1 for failure to verify |
The secretbox C API uses C strings.
:: Ptr CChar | Combined key output buffer |
-> Ptr CChar | Constant public key buffer |
-> Ptr CChar | Constant secret key buffer |
-> IO CInt | Always 0 |
Single target key precompilation.
:: Ptr CChar | Cipher output buffer |
-> Ptr CChar | Constant message input buffer |
-> CULLong | Length of message input buffer (incl. 0s) |
-> Ptr CChar | Constant nonce buffer |
-> Ptr CChar | Constant combined key buffer |
-> IO CInt | Always 0 |
Precompiled key crypto box. Uses C strings.
c_box_open_easy_afternm Source #
:: Ptr CChar | Message output buffer |
-> Ptr CChar | Constant ciphertext input buffer |
-> CULLong | Length of message input buffer (incl. 0s) |
-> Ptr CChar | Constant nonce buffer |
-> Ptr CChar | Constant combined key buffer |
-> IO CInt | 0 for success, -1 for failure to verify |
The secretbox C API uses C strings.
:: Ptr CChar | Cipher output buffer |
-> Ptr CChar | Constant message input buffer |
-> CULLong | Length of message input buffer |
-> Ptr CChar | Constant public key buffer |
-> IO CInt | Always 0 |
The sealedbox C API uses C strings.
:: Ptr CChar | Message output buffer |
-> Ptr CChar | Constant ciphertext input buffer |
-> CULLong | Length of message input buffer |
-> Ptr CChar | Constant public key buffer |
-> Ptr CChar | Constant secret key buffer |
-> IO CInt | 0 for success, -1 for failure to decrypt |
The sealedbox C API uses C strings.
An opaque box
cryptographic secret key.
SK | |
|
Instances
An opaque box
cryptographic public key.
PK | |
|
Instances
A convenience type for keypairs
Instances
Data Keypair Source # | |
Defined in Crypto.Saltine.Internal.Box 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 # | |
Generic Keypair Source # | |
Show Keypair Source # | |
NFData Keypair Source # | |
Defined in Crypto.Saltine.Internal.Box | |
Eq Keypair Source # | |
Ord Keypair Source # | |
Defined in Crypto.Saltine.Internal.Box | |
Hashable Keypair Source # | |
Defined in Crypto.Saltine.Internal.Box | |
type Rep Keypair Source # | |
Defined in Crypto.Saltine.Internal.Box type Rep Keypair = D1 ('MetaData "Keypair" "Crypto.Saltine.Internal.Box" "saltine-0.2.1.0-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))) |
newtype CombinedKey Source #
An opaque boxAfterNM
cryptographic combined key.
CK | |
|
Instances
An opaque box
nonce.
Instances
Data Nonce Source # | |
Defined in Crypto.Saltine.Internal.Box gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Nonce -> c Nonce # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Nonce # dataTypeOf :: Nonce -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Nonce) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Nonce) # gmapT :: (forall b. Data b => b -> b) -> Nonce -> Nonce # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Nonce -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Nonce -> r # gmapQ :: (forall d. Data d => d -> u) -> Nonce -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Nonce -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Nonce -> m Nonce # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Nonce -> m Nonce # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Nonce -> m Nonce # | |
Generic Nonce Source # | |
Show Nonce Source # | |
NFData Nonce Source # | |
Defined in Crypto.Saltine.Internal.Box | |
Eq Nonce Source # | |
Ord Nonce Source # | |
Hashable Nonce Source # | |
Defined in Crypto.Saltine.Internal.Box | |
IsEncoding Nonce Source # | |
Defined in Crypto.Saltine.Internal.Box encode :: Nonce -> ByteString Source # decode :: ByteString -> Maybe Nonce Source # encoded :: (Choice p, Applicative f) => p Nonce (f Nonce) -> p ByteString (f ByteString) Source # | |
IsNonce Nonce Source # | |
type Rep Nonce Source # | |
Defined in Crypto.Saltine.Internal.Box type Rep Nonce = D1 ('MetaData "Nonce" "Crypto.Saltine.Internal.Box" "saltine-0.2.1.0-inplace" 'True) (C1 ('MetaCons "Nonce" 'PrefixI 'True) (S1 ('MetaSel ('Just "unNonce") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) |