diff options
author | Niels Möller <nisse@lysator.liu.se> | 2018-12-26 11:30:21 +0100 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2018-12-26 11:30:21 +0100 |
commit | fc30c4d8276db2802d844be0c6c2cc67ff2d43cf (patch) | |
tree | 24ce9f3a3cb7225ec63d6631df8e432ced079cf7 /rsa.h | |
parent | 16d8133bec6d196ce3c5d02349a6475efaccf6c0 (diff) | |
parent | 350d87626235a20ec299ea851ef0b81218f1a5ec (diff) | |
download | nettle-fc30c4d8276db2802d844be0c6c2cc67ff2d43cf.tar.gz |
Merge branch 'release-3.4-fixes' into master
Diffstat (limited to 'rsa.h')
-rw-r--r-- | rsa.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -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, |