Blocks
public struct Blocks
This structure represents padded plaintext. Blocks are acutally a byte array which is a multiple of a given block size.
-
The size of a single block in bytes.
Declaration
Swift
public let blockSize: UInt32 -
The padded plaintext bytes.
Declaration
Swift
public let bytes: Bytes -
Constructs a
Blocksinstance from unpadded plaintext. This will add padding to the plaintext bytes.Postcondition
blocks.bytes.count%blocks.blockSize= 0Declaration
Swift
public init?(unpadded: Bytes, blockSize: UInt32)Parameters
unpaddedThe unpadded plaintext bytes.
blockSizeThe size of a single block in bytes.
Return Value
nilifblockSizeis 0. -
Constructs a
Blocksinstance from padded plaintext.Declaration
Swift
public init?(padded: Bytes, blockSize: UInt32)Parameters
paddedThe padded plaintext bytes.
blockSizeThe size of a single block in bytes.
-
Return the plaintext without the padding.
Declaration
Swift
public var withoutPadding: Bytes { get }
View on GitHub
Blocks Structure Reference