summaryrefslogtreecommitdiff
path: root/pkcs1.h
diff options
context:
space:
mode:
authorNiels Möller <nisse@lysator.liu.se>2012-05-18 21:29:34 +0200
committerNiels Möller <nisse@lysator.liu.se>2012-05-18 21:29:34 +0200
commit6a0bed19285910c9c67a10766c7814dc336e4e17 (patch)
tree7cb62077d4b1bc9177ccf2e389e0a1a886dfa831 /pkcs1.h
parent4d73f83e9335f35ff323beda862e4dab549d8488 (diff)
downloadnettle-6a0bed19285910c9c67a10766c7814dc336e4e17.tar.gz
Extracted padding code from rsa_encrypt to new function pkcs1_encrypt.
Diffstat (limited to 'pkcs1.h')
-rw-r--r--pkcs1.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/pkcs1.h b/pkcs1.h
index 95a6a835..68de0b7d 100644
--- a/pkcs1.h
+++ b/pkcs1.h
@@ -43,6 +43,7 @@ extern "C" {
#define pkcs1_rsa_sha256_encode_digest nettle_pkcs1_rsa_sha256_encode_digest
#define pkcs1_rsa_sha512_encode nettle_pkcs1_rsa_sha512_encode
#define pkcs1_rsa_sha512_encode_digest nettle_pkcs1_rsa_sha512_encode_digest
+#define pkcs1_encrypt nettle_pkcs1_encrypt
#define pkcs1_decrypt nettle_pkcs1_decrypt
struct md5_ctx;
@@ -58,6 +59,13 @@ pkcs1_signature_prefix(unsigned size,
unsigned digest_size);
int
+pkcs1_encrypt (unsigned key_size,
+ /* For padding */
+ void *random_ctx, nettle_random_func random,
+ unsigned length, const uint8_t *message,
+ mpz_t m);
+
+int
pkcs1_decrypt (unsigned key_size,
const mpz_t m,
unsigned *length, uint8_t *message);