hopenssl-2.2.4: FFI Bindings to OpenSSL's EVP Digest Interface

Safe HaskellNone



Low-level bindings to OpenSSL's EVP interface. Most users do not need this code. Check out OpenSSL.Digest for a more comfortable interface.



initDigest :: Algorithm -> Context -> IO () Source #

Configure the given digest context to use the given message digest algorithm. Throws an exception to signal failure, i.e. because the system is out of memory.

updateDigest :: Context -> Ptr a -> CSize -> IO () Source #

Hash the given block of memory and update the digest state accordingly. This function can be called many times. Then use finalizeDigest to retrieve the actual hash value.

finalizeDigest :: Context -> Ptr Word8 -> IO () Source #

Finalize the digest calculation and return the result in the Word8 array passed as an argument. Naturally, that array is expected to be large enough to contain the digest. digestSize or maxDigestSize are your friends. This function does not clean up the digest context; this has to be done with an explicit call to freeContext (or resetContext, if you want to re-use it). However, it does invalidate the digest state so that no further calls of digestUpdate can be made without re-initializing the context first.

data OpaqueEngine Source #

We don't support choosing a custom engine to implement the given algorithm. This type is just a place holder, and we always pass nullPtr wherever it is required to let OpenSSL choose whatever engine it thinks is best.