age-0.0.1.0: Actually Good Encryption
Safe HaskellNone
LanguageHaskell2010

Crypto.Age.Payload.Counter

Description

ChaCha20-Poly1305 counter nonces for decrypting chunks of an age file payload.

Synopsis

Documentation

mkPayloadChunkCounter :: Integer -> Maybe PayloadChunkCounter Source #

Construct a PayloadChunkCounter.

Note that, if the provided Integer value is less than 0 or greater than 0xFFFFFFFFFFFFFFFFFFFFFF (i.e. the maximum integer value that can be stored in 11 bytes), this function will return Nothing.

incrementPayloadChunkCounter :: PayloadChunkCounter -> Maybe PayloadChunkCounter Source #

Increment a PayloadChunkCounter by 1.

Note that, if this operation would result in a PayloadChunkCounter that is greater than 0xFFFFFFFFFFFFFFFFFFFFFF (i.e. the maximum integer value that can be stored in 11 bytes), this function will return Nothing.

maxPayloadChunkCounter :: Integer Source #

Maximum payload chunk counter value (0xFFFFFFFFFFFFFFFFFFFFFF, i.e. the maximum integer value that can be stored in 11 bytes).

data IsFinalChunk Source #

Whether this is the final payload chunk.

Constructors

IsFinalChunk

This is the final payload chunk.

IsNotFinalChunk

This is not the final payload chunk.

Instances

Instances details
Show IsFinalChunk Source # 
Instance details

Defined in Crypto.Age.Payload.Counter

Eq IsFinalChunk Source # 
Instance details

Defined in Crypto.Age.Payload.Counter