Shared types used by all the Crypto.Strings modules.
String
Another name for String
, to aid in documentation.
String
Another name for String
, to aid in documentation.
String
Another name for String
, to aid in documentation.
{ keySize : Basics.Int
, expander : Array Basics.Int -> Result String key
}
Describe key expansion for a particular block encryption algorithm.
keySize
is the number of bytes in a raw key.
expander
is a function to turn an array of that size into a key.
A portable name for block encryption algorithm specific keys.
{ encryption : Encryption key
, keyEncoding : KeyEncoding
, chaining : Chaining key state randomState
, encoding : Encoding
}
Configuration for the block chaining and string encoding
Basics.Int
An alternative name for Int to make docs clearer.
Array Basics.Int
One block for a block encryption algorithm.
{ name : String
, blockSize : BlockSize
, keyExpander : KeyExpander key
, encryptor : Encryptor key
, decryptor : Decryptor key
}
Package up information about a block encryption algorithm.
key -> Block -> Block
An encryption function for a particular low-level block algorithm.
key -> Block -> Block
A decryption function for a particular low-level block algorithm.
BlockSize -> ( Block
, randomState
}
Create a random byte array of a given length
{ name : String
, encoder : KeyEncoder
}
Describe a KeyEncoder
for a Config
.
Not all KeyEncodings
will be compatible with all block Encryption
types.
BlockSize -> Passphrase -> Block
Turn a passphrase into an IV.
{ name : String
, encoder : Encoder
, decoder : Decoder
}
Encoder and decoder for translating between strings and blocks.
List Basics.Int -> String
A string encoding algorithm.
String -> Result String (List Basics.Int)
A string decoding algorithm.
{ name : String
, initializer : ChainingInitializer state randomState
, encryptor : Chainer key state
, decryptor : Chainer key state
, adjoiner : ChainingStateAdjoiner state
, separator : ChainingStateSeparator state
}
Package up all the information needed to do block chaining.
RandomGenerator randomState -> BlockSize -> ( state
, randomState
}
Create an initial chaining state for encryption.
state -> ( Encryptor key
, Decryptor key ) -> key -> Block -> ( Block
, state
}
A block chaining algorithm.
state -> List Basics.Int -> List Basics.Int
Adjoin chaining state to a list of ciphertext blocks.
BlockSize -> List Basics.Int -> ( List Basics.Int
, state
}
Remove the adjoined state from a list of cipher blocks and turn it into a state.