From c3a4fa4cb849ba300d4691154c0c12ac19d24710 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Tue, 15 Oct 2019 20:28:02 +0200 Subject: Added internal functions for easy getting and setting all RSA parameters. rsa_set0_all_params() is used to set all the primes, exponents and coefficients. rsa_get0_all_params() is used to get all the primes, exponents and coefficients. "All" includes p, q, dP, dQ and qInv without making them separate. All arrays of numbers are implemented as stacks to make dynamic use easier. Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/10190) --- include/crypto/rsa.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/crypto/rsa.h (limited to 'include/crypto/rsa.h') diff --git a/include/crypto/rsa.h b/include/crypto/rsa.h new file mode 100644 index 0000000000..6d2e7ffb53 --- /dev/null +++ b/include/crypto/rsa.h @@ -0,0 +1,21 @@ +/* + * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the Apache License 2.0 (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef OSSL_INTERNAL_RSA_H +# define OSSL_INTERNAL_RSA_H + +#include + +int rsa_set0_all_params(RSA *r, const STACK_OF(BIGNUM) *primes, + const STACK_OF(BIGNUM) *exps, + const STACK_OF(BIGNUM) *coeffs); +int rsa_get0_all_params(RSA *r, STACK_OF(BIGNUM_const) *primes, + STACK_OF(BIGNUM_const) *exps, + STACK_OF(BIGNUM_const) *coeffs); +#endif -- cgit v1.2.3