Hello again,

After rethinking it, I refactored the new functions to be consistent with how Nettle functions are designed, now there's one encrypt/decrypt function per hash.

https://git.lysator.liu.se/nettle/nettle/-/merge_requests/20

The new functions are the following:

Encryption:
int
rsa_oaep_sha1_encrypt(const struct rsa_public_key *key,
            void *random_ctx, nettle_random_func *random,
            size_t label_length, const uint8_t *label,
            size_t length, const uint8_t *message,
            mpz_t gibberish);

int
rsa_oaep_sha256_encrypt(const struct rsa_public_key *key,
            void *random_ctx, nettle_random_func *random,
            size_t label_length, const uint8_t *label,
            size_t length, const uint8_t *message,
            mpz_t gibberish);

int
rsa_oaep_sha384_encrypt(const struct rsa_public_key *key,
            void *random_ctx, nettle_random_func *random,
            size_t label_length, const uint8_t *label,
            size_t length, const uint8_t *message,
            mpz_t gibberish);

int
rsa_oaep_sha512_encrypt(const struct rsa_public_key *key,
            void *random_ctx, nettle_random_func *random,
            size_t label_length, const uint8_t *label,
            size_t length, const uint8_t *message,
            mpz_t gibberish);

Decryption:
int
rsa_oaep_sha1_decrypt(const struct rsa_private_key *key,
            size_t label_length, const uint8_t *label,
            size_t *length, uint8_t *message,
            const mpz_t gibberish);

int
rsa_oaep_sha256_decrypt(const struct rsa_private_key *key,
            size_t label_length, const uint8_t *label,
            size_t *length, uint8_t *message,
            const mpz_t gibberish);

int
rsa_oaep_sha384_decrypt(const struct rsa_private_key *key,
            size_t label_length, const uint8_t *label,
            size_t *length, uint8_t *message,
            const mpz_t gibberish);

int
rsa_oaep_sha512_decrypt(const struct rsa_private_key *key,
            size_t label_length, const uint8_t *label,
            size_t *length, uint8_t *message,
            const mpz_t gibberish);

The tests are updated too

/Nicolas

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

_______________________________________________
nettle-bugs mailing list
nettle-bugs@lists.lysator.liu.se
http://lists.lysator.liu.se/mailman/listinfo/nettle-bugs

Reply via email to