1=pod
2
3=head1 NAME
4
5ossl_rsa_set0_all_params, ossl_rsa_get0_all_params
6- Internal routines for getting and setting data in an RSA object
7
8=head1 SYNOPSIS
9
10 #include "crypto/rsa.h"
11
12 int ossl_rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes,
13                              STACK_OF(BIGNUM_const) *exps,
14                              STACK_OF(BIGNUM_const) *coeffs);
15 int ossl_rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes,
16                              const STACK_OF(BIGNUM) *exps,
17                              const STACK_OF(BIGNUM) *coeffs);
18
19=head1 DESCRIPTION
20
21ossl_rsa_set0_all_params() sets all primes, CRT exponents and CRT coefficients
22in the B<RSA> object I<r> to the contents of the stacks of BIGNUMs I<primes>,
23I<exps> and I<coeffs>.  The B<RSA> object takes ownership of the BIGNUMs,
24but not of the stacks.
25
26ossl_rsa_get0_all_params() gets all primes, CRT exponents and CRT coefficients
27in the B<RSA> object I<r> and pushes them on the stacks of constant BIGNUMs
28I<primes>, I<exps> and I<coeffs>.  The B<RSA> object retains ownership of the
29BIGNUMs, but not of the stacks.
30
31=head1 NOTES
32
33For RSA_set0_all_params() and RSA_get0_all_params():
34
35=over 4
36
37=item *
38
39the I<primes> stack contains I<p>, I<q>, and then the rest of the primes
40if the B<RSA> object is a multi-prime RSA key.
41
42=item *
43
44the I<exps> stack contains I<dP>, I<dQ>, and then the rest of the exponents
45if the B<RSA> object is a multi-prime RSA key.
46
47=item *
48
49the I<coeffs> stack contains I<qInv>, and then the rest of the coefficients
50if the B<RSA> object is a multi-prime RSA key.
51
52=back
53
54The number of primes must always be equal to the number of exponents, and
55the number of coefficients must be one less than the number of primes.
56
57=head1 RETURN VALUES
58
59ossl_rsa_get0_all_params() and ossl_rsa_set0_all_params() return 1 on success,
60or 0 on failure.
61
62=head1 SEE ALSO
63
64L<RSA_set0_multi_prime_params(3)>
65
66=head1 COPYRIGHT
67
68Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
69
70Licensed under the Apache License 2.0 (the "License").  You may not use
71this file except in compliance with the License.  You can obtain a copy
72in the file LICENSE in the source distribution or at
73L<https://www.openssl.org/source/license.html>.
74
75=cut
76