[#EVP_PBE_scrypt_ex]
= EVP&lowbar;PBE&lowbar;scrypt&lowbar;ex
:mrdocs:

Derive a key from a password using scrypt with an explicit library context&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
int
EVP&lowbar;PBE&lowbar;scrypt&lowbar;ex(
    char const* pass,
    size&lowbar;t passlen,
    unsigned char const* salt,
    size&lowbar;t saltlen,
    uint64&lowbar;t N,
    uint64&lowbar;t r,
    uint64&lowbar;t p,
    uint64&lowbar;t maxmem,
    unsigned char* key,
    size&lowbar;t keylen,
    xref:OSSL_LIB_CTX.adoc[OSSL&lowbar;LIB&lowbar;CTX]* ctx,
    char const* propq);
----

== Return Value

1 on success, or 0 on failure&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *pass*
| Password bytes, or NULL&period;
| *passlen*
| Length of `pass` in bytes&period;
| *salt*
| Salt bytes, or NULL when `saltlen` is 0&period;
| *saltlen*
| Length of `salt` in bytes&period;
| *N*
| CPU&sol;memory cost parameter (must be a power of two greater than 1)&period;
| *r*
| Block size parameter&period;
| *p*
| Parallelization parameter&period;
| *maxmem*
| Maximum memory in bytes the derivation may use, or 0 for the default limit&period;
| *key*
| Buffer that receives the derived key&period;
| *keylen*
| Desired derived key length in bytes&period;
| *ctx*
| Library context for provider selection, or NULL for the default&period;
| *propq*
| Property query string, or NULL&period;
|===


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