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