[#PKCS5_pbe2_set_scrypt]
= PKCS5&lowbar;pbe2&lowbar;set&lowbar;scrypt
:mrdocs:

Build a PBES2 AlgorithmIdentifier that derives the key with scrypt&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:X509_ALGOR.adoc[X509&lowbar;ALGOR]*
PKCS5&lowbar;pbe2&lowbar;set&lowbar;scrypt(
    xref:EVP_CIPHER-07.adoc[EVP&lowbar;CIPHER] const* cipher,
    unsigned char const* salt,
    int saltlen,
    unsigned char* aiv,
    uint64&lowbar;t N,
    uint64&lowbar;t r,
    uint64&lowbar;t p);
----

== Return Value

New X509&lowbar;ALGOR describing the PBES2&sol;scrypt parameters, or NULL on error&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *cipher*
| Content&hyphen;encryption cipher wrapped by PBES2&period;
| *salt*
| Salt octets for scrypt, or NULL to generate a default&hyphen;length salt&period;
| *saltlen*
| Length of `salt` in bytes&semi; ignored when `salt` is NULL&period;
| *aiv*
| Optional IV octets for `cipher,` or NULL to generate a suitable IV&period;
| *N*
| scrypt CPU&sol;memory cost parameter&period;
| *r*
| scrypt block size parameter&period;
| *p*
| scrypt parallelization parameter&period;
|===


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