summaryrefslogtreecommitdiffstats
path: root/include/crypto/rsa.h
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-10-15 20:28:02 +0200
committerRichard Levitte <levitte@openssl.org>2019-10-17 18:07:45 +0200
commitc3a4fa4cb849ba300d4691154c0c12ac19d24710 (patch)
treede8a929f7bb54e51a6fa3c9058a3686cd5857777 /include/crypto/rsa.h
parentb75d6310857bc44ef2851bde68a1979c18bb4807 (diff)
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 <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10190)
Diffstat (limited to 'include/crypto/rsa.h')
-rw-r--r--include/crypto/rsa.h21
1 files changed, 21 insertions, 0 deletions
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 <openssl/rsa.h>
+
+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