sha256-0.1.0.2: A modern binding to SHA256, HMAC, HKDF, and PBKDF2
Copyright(c) 2024 Auth Global
LicenseApache2
Safe HaskellNone
LanguageHaskell2010

Crypto.Sha256.Subtle

Description

 
Synopsis

Documentation

newtype Sha256Ctx Source #

Constructors

Sha256Ctx 

Instances

Instances details
Eq Sha256Ctx Source # 
Instance details

Defined in Crypto.Sha256.Subtle

Ord Sha256Ctx Source # 
Instance details

Defined in Crypto.Sha256.Subtle

sha256state_feed :: ByteString -> Sha256State -> Sha256State Source #

Note that this function only processes as many 64-byte blocks as possible, then discards the remainder of the input. Also note that this function does nothing to track the number of bytes that have been fed into the state, which will have to be done externally.

sha256state_fromCtxInplace :: Sha256Ctx -> Sha256State Source #

Cast a Sha256Ctx to a Sha256State, without (much, if any) copying. This has the disadvantage that the result will retain at least 8, and up to 71 unnecessary bytes, depending on the length of the buffer. 72 extra bytes will likely be possible once this binding supports mutable contexts and supports freezing mutable contexts into immutable contexts without copying.

sha256state_fromCtx :: Sha256Ctx -> Sha256State Source #

Cast a Sha256Ctx to a Sha256State. This copies the first 32 bytes of the Sha256Ctx structure, so the result is always as small as possible.

c_sha256_promote_to_ctx Source #

Arguments

:: Sha256State#

state, a pointer to an constant array of eight Word32

-> Word64

blockCount, the number of blocks that a sha256 context has processed

-> CString

pointer to the constant data to process

-> CSize

length of the data to process

-> MutableSha256Ctx# RealWorld

output pointer

-> IO () 

c_sha256_update Source #

Arguments

:: Sha256State#

state, a pointer to an constant array of eight Word32

-> CString

pointer to the constant data to process

-> CSize

length of the data to process

-> MutableSha256State# RealWorld

output pointer

-> IO Word64

the new count

c_sha256_update_ctx Source #

Arguments

:: Sha256Ctx#

ctx, a pointer to a constant sha256 context

-> CString

pointer to the constant data to process

-> CSize

length of the data to process

-> MutableSha256Ctx# RealWorld

output pointer

-> IO () 

c_sha256_mutate_ctx Source #

Arguments

:: MutableSha256Ctx# RealWorld

ctx, a pointer to a constant sha256 context

-> CString

pointer to the constant data to process

-> CSize

length of the data to process

-> MutableSha256Ctx# RealWorld

output pointer, can be same as the input context

-> IO ()