Debian Codegraph @

upstream/debian-unstable/man3/EVP_PKEY_CTX_set_scrypt_N.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "EVP_PKEY_CTX_SET_SCRYPT_N 3SSL"
58 .TH EVP_PKEY_CTX_SET_SCRYPT_N 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 EVP_PKEY_CTX_set1_scrypt_salt,
65 EVP_PKEY_CTX_set_scrypt_N,
66 EVP_PKEY_CTX_set_scrypt_r,
67 EVP_PKEY_CTX_set_scrypt_p,
68 EVP_PKEY_CTX_set_scrypt_maxmem_bytes
69 \&\- EVP_PKEY scrypt KDF support functions
70 .SH SYNOPSIS
71 .IX Header "SYNOPSIS"
72 .Vb 1
73 \& #include <openssl/kdf.h>
74 \&
75 \& int EVP_PKEY_CTX_set1_scrypt_salt(EVP_PKEY_CTX *pctx, unsigned char *salt,
76 \& int saltlen);
77 \&
78 \& int EVP_PKEY_CTX_set_scrypt_N(EVP_PKEY_CTX *pctx, uint64_t N);
79 \&
80 \& int EVP_PKEY_CTX_set_scrypt_r(EVP_PKEY_CTX *pctx, uint64_t r);
81 \&
82 \& int EVP_PKEY_CTX_set_scrypt_p(EVP_PKEY_CTX *pctx, uint64_t p);
83 \&
84 \& int EVP_PKEY_CTX_set_scrypt_maxmem_bytes(EVP_PKEY_CTX *pctx,
85 \& uint64_t maxmem);
86 .Ve
87 .SH DESCRIPTION
88 .IX Header "DESCRIPTION"
89 These functions are used to set up the necessary data to use the
90 scrypt KDF.
91 For more information on scrypt, see \fBEVP_KDF\-SCRYPT\fR\|(7).
92 .PP
93 \&\fBEVP_PKEY_CTX_set1_scrypt_salt()\fR sets the \fBsaltlen\fR bytes long salt
94 value.
95 .PP
96 \&\fBEVP_PKEY_CTX_set_scrypt_N()\fR, \fBEVP_PKEY_CTX_set_scrypt_r()\fR and
97 \&\fBEVP_PKEY_CTX_set_scrypt_p()\fR configure the work factors N, r and p.
98 .PP
99 \&\fBEVP_PKEY_CTX_set_scrypt_maxmem_bytes()\fR sets how much RAM key
100 derivation may maximally use, given in bytes.
101 If RAM is exceeded because the load factors are chosen too high, the
102 key derivation will fail.
103 .SH "STRING CTRLS"
104 .IX Header "STRING CTRLS"
105 scrypt also supports string based control operations via
106 \&\fBEVP_PKEY_CTX_ctrl_str\fR\|(3).
107 Similarly, the \fBsalt\fR can either be specified using the \fBtype\fR
108 parameter "salt" or in hex encoding by using the "hexsalt" parameter.
109 The work factors \fBN\fR, \fBr\fR and \fBp\fR as well as \fBmaxmem_bytes\fR can be
110 set by using the parameters "N", "r", "p" and "maxmem_bytes",
111 respectively.
112 .SH NOTES
113 .IX Header "NOTES"
114 There is a newer generic API for KDFs, \fBEVP_KDF\fR\|(3), which is
115 preferred over the EVP_PKEY method.
116 .PP
117 The scrypt KDF also uses \fBEVP_PKEY_CTX_set1_pbe_pass()\fR as well as
118 the value from the string controls "pass" and "hexpass".
119 See \fBEVP_PKEY_CTX_set1_pbe_pass\fR\|(3).
120 .SH "RETURN VALUES"
121 .IX Header "RETURN VALUES"
122 All these functions return 1 for success and 0 or a negative value for
123 failure.
124 In particular a return value of \-2 indicates the operation is not
125 supported by the public key algorithm.
126 .SH "SEE ALSO"
127 .IX Header "SEE ALSO"
128 \&\fBEVP_KDF\fR\|(3)
129 \&\fBEVP_PKEY_CTX_new\fR\|(3),
130 \&\fBEVP_PKEY_CTX_ctrl_str\fR\|(3),
131 \&\fBEVP_PKEY_derive\fR\|(3)
132 .SH HISTORY
133 .IX Header "HISTORY"
134 All of the functions described here were converted from macros to functions in
135 OpenSSL 3.0.
136 .SH COPYRIGHT
137 .IX Header "COPYRIGHT"
138 Copyright 2017\-2020 The OpenSSL Project Authors. All Rights Reserved.
139 .PP
140 Licensed under the Apache License 2.0 (the "License"). You may not use
141 this file except in compliance with the License. You can obtain a copy
142 in the file LICENSE in the source distribution or at
143 <https://www.openssl.org/source/license.html>.