Crypto engines low-level abstraction.
Crypto engines low-level abstraction.
(block-cipher alg mode)
Block cipher engine constructor.
Block cipher engine constructor.
(block-size engine)
Return the block size of the block cipher.
Return the block size of the block cipher.
(decrypt input key iv)
(decrypt input
key
iv
{:keys [algorithm alg] :or {alg :aes128-cbc-hmac-sha256} :as options})
Decrypt data encrypted using the encrypt
function.
The input, key and iv parameters should be of any type that can be coerced to byte array.
Decrypt data encrypted using the `encrypt` function. The input, key and iv parameters should be of any type that can be coerced to byte array.
(encrypt input key iv)
(encrypt input
key
iv
{:keys [algorithm alg] :or {alg :aes128-cbc-hmac-sha256} :as options})
Encrypt arbitrary length data using one of the supported encryption
scheme. The default encryption scheme is: :aes128-cbc-hmac-sha256
.
Example: (encrypt "hello world" mykey myiv)
You can specify an other encryption scheme passing an additional parameter.
Example: (encrypt "hello world" mykey myiv {:alg :aes128-cbc-hmac-sha512})
See the documentation for know the complete list of supported encryption schemes.
The input, key and iv parameters should be of any type that can be coerced to byte array.
Encrypt arbitrary length data using one of the supported encryption scheme. The default encryption scheme is: `:aes128-cbc-hmac-sha256`. Example: `(encrypt "hello world" mykey myiv)` You can specify an other encryption scheme passing an additional parameter. Example: `(encrypt "hello world" mykey myiv {:alg :aes128-cbc-hmac-sha512})` See the documentation for know the complete list of supported encryption schemes. The input, key and iv parameters should be of any type that can be coerced to byte array.
(end! engine output offset)
End the encryption process.
This is only usefull for aead block ciphers, for the
rest it always return 0
and does nothing.
End the encryption process. This is only usefull for aead block ciphers, for the rest it always return `0` and does nothing.
A backward compatibility alias for output-size
function.
A backward compatibility alias for `output-size` function.
A backward compatibility alias for output-size
function.
A backward compatibility alias for `output-size` function.
(-end engine out offset)
Finalize cipher engine.
Finalize cipher engine.
(-init engine params)
Initialize cipher engine.
Initialize cipher engine.
(init! engine params)
Initialize the cipher engine.
Initialize the cipher engine.
A backward compatibility alias for init!
A backward compatibility alias for `init!`
(output-size engine length)
Get the output size of the aead block cipher.
Get the output size of the aead block cipher.
(process-block! engine in)
(process-block! engine in inoff out outoff)
Encrypt or decrypt a bytes using the specified engine. The length of the block to encrypt or decrypt depends on the used crypto engine.
Encrypt or decrypt a bytes using the specified engine. The length of the block to encrypt or decrypt depends on the used crypto engine.
(process-bytes! engine in)
(process-bytes! engine in inoff out outoff)
(process-bytes! engine in inoff inlen out outoff)
Encrypt or decrypt a bytes using the specified engine.
Is a specialized version of process-block!
for stream ciphers
and aead ciphers.
Encrypt or decrypt a bytes using the specified engine. Is a specialized version of `process-block!` for stream ciphers and aead ciphers.
(split-by-blocksize input blocksize)
(split-by-blocksize input blocksize additional)
Split a byte array in blocksize blocks.
Given a arbitrary size bytearray and block size in bytes, returns a vector of bytearray blocks of blocksize size. If last block does not have enought data for fill all block, it is padded using zerobyte padding.
Split a byte array in blocksize blocks. Given a arbitrary size bytearray and block size in bytes, returns a vector of bytearray blocks of blocksize size. If last block does not have enought data for fill all block, it is padded using zerobyte padding.
(stream-cipher alg)
Stream cipher engine constructor.
Stream cipher engine constructor.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close