Pike v8.0 release 1738

Class Nettle.BufferedCipher()->Buffer.State

Inheritance graph
Nettle.BufferedCipher.Buffer.State SSL.Cipher.DES SSL.Cipher.DES3 SSL.Cipher.RC2
Description

Acts as a buffer so that data can be fed to the cipher in blocks that don't correspond to cipher block sizes.

Example

class Encrypter { protected Crypto.Cipher buffer;

void create(string key) { buffer = Crypto.AES.CBC.Buffer(); buffer->set_encrypt_key(key); }

string feed(string data) { return buffer->crypt(data); }

string drain() { return buffer->pad(Crypto.PAD_PKCS7); } }

See also

BlockCipher.CBC, BlockCipher16.GCM


Method create

Nettle.BufferedCipher.Buffer.State Nettle.BufferedCipher.Buffer.State()

Description

Initialize the buffer with the Cipher::State object returned by substate_factory(). This is usually the State for the cipher implemented in the parent module.