Padding

public enum Padding

The padding mode for encryption and decryption. The same padding mode has to be used for encryption and decryption, else the decryption will fail.

  • This indicates that no padding should be used.

    Warning

    If messages are encrypted without padding, the size of the message is disclosed. If that is unintended, use padding instead.

    Declaration

    Swift

    case none
  • This indicates that padding should be used. Padding is based on the given blockSize. The padded plaintext is a multiple of block size. If the unpadded plaintext is already a multiple of block size, an empty padding block is added.

    Declaration

    Swift

    case padded(blockSize: UInt32)

    Parameters

    blockSize

    The block size in bytes.