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

Name

Description

ctx

XTS context holding the two keys and block functions.

iv

16‐byte tweak / sector IV for this unit.

inp

Input plaintext or ciphertext of length len (at least 16).

out

Output buffer of length len (may equal inp).

len

Number of bytes to process (must be >= 16).

enc

Non‐zero to encrypt, zero to decrypt.

Created with MrDocs