[#CRYPTO_128_wrap]
= CRYPTO&lowbar;128&lowbar;wrap
:mrdocs:

Wrap a key with AES Key Wrap (RFC 3394) using `block&period;`

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
size&lowbar;t
CRYPTO&lowbar;128&lowbar;wrap(
    void* key,
    unsigned char const* iv,
    unsigned char* out,
    unsigned char const* in,
    size&lowbar;t inlen,
    xref:block128_f.adoc[block128&lowbar;f] block);
----

== Return Value

Length of wrapped data written to `out,` or 0 on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *key*
| Cipher&hyphen;specific expanded key for `block&period;`
| *iv*
| Optional 8&hyphen;byte IV, or NULL for the RFC 3394 default IV&period;
| *out*
| Buffer for the wrapped key (at least `inlen` &plus; 8 bytes)&period;
| *in*
| Key material as n 64&hyphen;bit blocks with n &gt;&equals; 2&period;
| *inlen*
| Length of `in` in bytes (multiple of 8, at least 16)&period;
| *block*
| Block&hyphen;encrypt function used by the wrap algorithm&period;
|===


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