CRYPTO_ctr128_encrypt

Encrypt or decrypt with a 128-bit block cipher in CTR mode.

Synopsis

Declared in <openssl/modes.h>

void
CRYPTO_ctr128_encrypt(
    unsigned char const* in,
    unsigned char* out,
    size_t len,
    void const* key,
    unsigned char ivec[],
    unsigned char ecount_buf[],
    unsigned int* num,
    block128_f block);

Parameters

NameDescription
inInput bytes of length len.
outOutput buffer of length len (may equal in).
lenNumber of bytes to process.
keyCipher-specific expanded key for block.
ivec16-byte counter block updated as encryption proceeds.
ecount_buf16-byte buffer holding the current encrypted counter block.
numOffset into ecount_buf for residual keystream (updated; start at 0).
blockBlock-encrypt function for the underlying cipher.