[#CRYPTO_xts128_encrypt]
= CRYPTO&lowbar;xts128&lowbar;encrypt
:mrdocs:

Encrypt or decrypt data with a 128&hyphen;bit block cipher in XTS mode&period;

== Synopsis

Declared in `&lt;openssl&sol;modes&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
CRYPTO&lowbar;xts128&lowbar;encrypt(
    xref:XTS128_CONTEXT-02.adoc[XTS128&lowbar;CONTEXT] const* ctx,
    unsigned char const iv[],
    unsigned char const* inp,
    unsigned char* out,
    size&lowbar;t len,
    int enc);
----

== Return Value

0 on success, or &hyphen;1 if `len` is invalid&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *ctx*
| XTS context holding the two keys and block functions&period;
| *iv*
| 16&hyphen;byte tweak &sol; sector IV for this unit&period;
| *inp*
| Input plaintext or ciphertext of length `len` (at least 16)&period;
| *out*
| Output buffer of length `len` (may equal `inp)&period;`
| *len*
| Number of bytes to process (must be &gt;&equals; 16)&period;
| *enc*
| Non&hyphen;zero to encrypt, zero to decrypt&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
