It decomposes the drgNew call that was gathering entropy then
initializing a ChaChaDRG, into 2 new calls seedNew and drgNewSeed.
drgNew remains unchanged.
The integer importing capability, should be used when wanting to bring
reproducibility to a debugging problem or for testing, otherwise it's
probably a bad idea to use.
Caused by a difference in the size of the digest
byte array allocated on Haskell side and the
amount of bytes copied to it on the C side.
In cbits/cryptonite_sha512.c:cryptonite_sha384_finalize
SHA384_DIGEST_SIZE bytes is copied into the out buffer.
SHA384_DIGEST_SIZE is #defined as 64 in cbits/cryptonite_sha512.h
while the buffer given will have size 48, as defined in
Crypto/Hash/SHA384.hs.
Defining SHA384_DIGEST_SIZE as 48 fixes the issue.
When in c99 mode (which is needed for some of our newer additions),
old distributions has an glibc inlining bug which triggers lots of
duplicated symbols.
Add a cabal flag to revert the inliner to c89 mode.
Fixes#64
Cabal links to all C-sources defined unconditionally, then conditionally
append blocks that defined C-Sources; This lead to bug when the order of
.c files are important, like for cabal repl.
Workaround this bug, by defining everything aes related in the
conditional part.
The example code had a type mismatch.
Couldn't match expected type ‘State’
with actual type ‘CryptoFailable State’
In the second argument of ‘appendAAD’, namely ‘st1’
In the second argument of ‘($)’, namely ‘appendAAD hdr st1’
This is due to the following part:
let st1 = ChaChaPoly1305.initialize key nonce
st2 = ChaChaPoly1305.finalizeAAD $ ChaChaPoly1305.appendAAD hdr st1
`initialize` returns `CryptoFailable State`, not `State`.
This commit fixes the type mismatch, changes the return type of the
example function to `CryptoFailable ByteString`, and makes the code
to be immediately copy-and-paste-able.
The output size is now passed by parameter to the finalize function
instead of being stored in the context. that simplify quite a
bit the passing of this parameter