ddn.crypto.cipher.modes
Block Cipher Modes of Operation.
Types 8
Cipher Block Chaining (CBC) Mode.
Parameters
BlockCipherT | The block cipher implementation (e.g., AES). |
Fields
private BlockCipherT _cipherprivate Padding _paddingprivate CipherOperation _opprivate ubyte[] _bufferprivate ubyte[] _ivprivate ubyte[] _lastBlockprivate bool _initializedMethods
void init(CipherOperation op, Key key, const(ubyte)[] iv = null)ubyte[] update(const(ubyte)[] input)ubyte[] finish(const(ubyte)[] input = null)Constructors
this(Padding padding = new PKCS7Padding())Constructs a CBC mode cipher.Counter (CTR) Mode.
Turns a block cipher into a stream cipher.
Fields
private BlockCipherT _cipherprivate ubyte[] _counterprivate ubyte[] _keystreamprivate size_t _keystreamIdxprivate bool _initializedMethods
void init(CipherOperation op, Key key, const(ubyte)[] iv = null)ubyte[] update(const(ubyte)[] input)ubyte[] finish(const(ubyte)[] input = null)Electronic Codebook (ECB) Mode.
Fields
private BlockCipherT _cipherprivate Padding _paddingprivate CipherOperation _opprivate ubyte[] _bufferprivate bool _initializedMethods
void init(CipherOperation op, Key key, const(ubyte)[] iv = null)ubyte[] update(const(ubyte)[] input)ubyte[] finish(const(ubyte)[] input = null)Constructors
this(Padding padding = new PKCS7Padding())Cipher Feedback (CFB) Mode (CFB-BlockSize).
Fields
private BlockCipherT _cipherprivate CipherOperation _opprivate ubyte[] _ivprivate ubyte[] _feedbackprivate ubyte[] _bufferprivate bool _initializedprivate size_t _blockSizeMethods
void init(CipherOperation op, Key key, const(ubyte)[] iv = null)ubyte[] update(const(ubyte)[] input)ubyte[] finish(const(ubyte)[] input = null)Output Feedback (OFB) Mode.
Fields
private BlockCipherT _cipherprivate ubyte[] _ivprivate ubyte[] _keystreamprivate size_t _keystreamIdxprivate bool _initializedprivate size_t _blockSizeMethods
void init(CipherOperation op, Key key, const(ubyte)[] iv = null)ubyte[] update(const(ubyte)[] input)ubyte[] finish(const(ubyte)[] input = null)XEX-based Tweaked-codebook mode with ciphertext Stealing (XTS).
Used for disk encryption.
Fields
private BlockCipherT _cipher1private BlockCipherT _cipher2private CipherOperation _opprivate ubyte[] _tweakprivate ubyte[] _bufferprivate bool _initializedprivate size_t _blockSizeMethods
void init(CipherOperation op, Key key, const(ubyte)[] iv = null)private
void multiplyAlpha(ubyte[] tweak)ubyte[] update(const(ubyte)[] input)private
ubyte[] processBlock(ubyte[] block)ubyte[] finish(const(ubyte)[] input = null)classGCM(BlockCipherT) : AEADCipher
Galois/Counter Mode (GCM).
Methods
ubyte[] seal(const(ubyte)[] plaintext, const(ubyte)[] aad, const(ubyte)[] nonce, ubyte[] output = null)ubyte[] open(const(ubyte)[] ciphertext, const(ubyte)[] aad, const(ubyte)[] nonce, ubyte[] output = null)private
void inc32(ref ubyte[16] counter)private
void prepareJ0(const(ubyte)[] nonce)private
ubyte[16] calculateTag(const(ubyte)[] aad, const(ubyte)[] ciphertext)private
void processData(ref ubyte[16] y, const(ubyte)[] data)private
void ghashBlock(ref ubyte[16] y, const(ubyte)[] block)private
void gmult(ref ubyte[16] x, const(ubyte)[] y)classCCM(BlockCipherT) : AEADCipher
Counter with CBC-MAC (CCM).
Methods
ubyte[] seal(const(ubyte)[] plaintext, const(ubyte)[] aad, const(ubyte)[] nonce, ubyte[] output = null)ubyte[] open(const(ubyte)[] ciphertext, const(ubyte)[] aad, const(ubyte)[] nonce, ubyte[] output = null)private
void processCTR(const(ubyte)[] input, const(ubyte)[] nonce, ubyte[] output)private
ubyte[16] formatCounter(const(ubyte)[] nonce, size_t counterVal)private
ubyte[16] calculateMac(const(ubyte)[] plaintext, const(ubyte)[] aad, const(ubyte)[] nonce)