CRYPTO_xts128_encrypt

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

Synopsis

Declared in <openssl/modes.h>

int
CRYPTO_xts128_encrypt(
    XTS128_CONTEXT const* ctx,
    unsigned char const iv[],
    unsigned char const* inp,
    unsigned char* out,
    size_t len,
    int enc);

Return Value

0 on success, or -1 if len is invalid.

Parameters

NameDescription
ctxXTS context holding the two keys and block functions.
iv16-byte tweak / sector IV for this unit.
inpInput plaintext or ciphertext of length len (at least 16).
outOutput buffer of length len (may equal inp).
lenNumber of bytes to process (must be >= 16).
encNon-zero to encrypt, zero to decrypt.