summaryrefslogtreecommitdiff
path: root/rsa.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2018-12-26 11:30:21 +0100
committerNiels Möller <nisse@lysator.liu.se>2018-12-26 11:30:21 +0100
commitfc30c4d8276db2802d844be0c6c2cc67ff2d43cf (patch)
tree24ce9f3a3cb7225ec63d6631df8e432ced079cf7 /rsa.h
parent16d8133bec6d196ce3c5d02349a6475efaccf6c0 (diff)
parent350d87626235a20ec299ea851ef0b81218f1a5ec (diff)
downloadnettle-fc30c4d8276db2802d844be0c6c2cc67ff2d43cf.tar.gz
Merge branch 'release-3.4-fixes' into master
Diffstat (limited to 'rsa.h')
-rw-r--r--rsa.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/rsa.h b/rsa.h
index 7d66d004..3b10155f 100644
--- a/rsa.h
+++ b/rsa.h
@@ -88,6 +88,7 @@ extern "C" {
#define rsa_encrypt nettle_rsa_encrypt
#define rsa_decrypt nettle_rsa_decrypt
#define rsa_decrypt_tr nettle_rsa_decrypt_tr
+#define rsa_sec_decrypt nettle_rsa_sec_decrypt
#define rsa_compute_root nettle_rsa_compute_root
#define rsa_compute_root_tr nettle_rsa_compute_root_tr
#define rsa_generate_keypair nettle_rsa_generate_keypair
@@ -418,6 +419,15 @@ rsa_decrypt_tr(const struct rsa_public_key *pub,
size_t *length, uint8_t *message,
const mpz_t gibberish);
+/* like rsa_decrypt_tr but with additional side-channel resistance.
+ * NOTE: the length of the final message must be known in advance. */
+int
+rsa_sec_decrypt(const struct rsa_public_key *pub,
+ const struct rsa_private_key *key,
+ void *random_ctx, nettle_random_func *random,
+ size_t length, uint8_t *message,
+ const mpz_t gibberish);
+
/* Compute x, the e:th root of m. Calling it with x == m is allowed. */
void
rsa_compute_root(const struct rsa_private_key *key,