diff options
| author | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 02:14:38 +0200 |
|---|---|---|
| committer | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 04:25:24 +0200 |
| commit | 52e90afd006bec2a072c00cae8945e606f43da66 (patch) | |
| tree | 9c5720d01c2f779319931e31603e3e953bf9f8a0 /libtomcrypt/pk | |
| parent | d11063f50e61ba5880324908ea6cccb0314f0d46 (diff) | |
Use algo_properties_st in rsa_encrypt_key_ex
Diffstat (limited to 'libtomcrypt/pk')
| -rw-r--r-- | libtomcrypt/pk/rsa/rsa_encrypt_key.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libtomcrypt/pk/rsa/rsa_encrypt_key.c b/libtomcrypt/pk/rsa/rsa_encrypt_key.c index d59699c..9e4573b 100644 --- a/libtomcrypt/pk/rsa/rsa_encrypt_key.c +++ b/libtomcrypt/pk/rsa/rsa_encrypt_key.c @@ -9,6 +9,7 @@ * Tom St Denis, tomstdenis@gmail.com, http://libtom.org */ #include "tomcrypt.h" +#include "ncr_int.h" /** @file rsa_encrypt_key.c @@ -25,7 +26,7 @@ @param outlen [in/out] The max size and resulting size of the ciphertext @param lparam The system "lparam" for the encryption @param lparamlen The length of lparam (octets) - @param hash_idx The index of the desired hash + @param hash The desired hash @param padding Type of padding (LTC_LTC_PKCS_1_OAEP or LTC_LTC_PKCS_1_V1_5) @param key The RSA key to encrypt to @return CRYPT_OK if successful @@ -33,7 +34,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen, const unsigned char *lparam, unsigned long lparamlen, - int hash_idx, int padding, rsa_key *key) + const struct algo_properties_st *hash, int padding, rsa_key *key) { unsigned long modulus_bitlen, modulus_bytelen, x; int err; @@ -51,7 +52,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, if (padding == LTC_LTC_PKCS_1_OAEP) { /* valid hash? */ - if ((err = hash_is_valid(hash_idx)) != CRYPT_OK) { + if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { return err; } } @@ -70,7 +71,7 @@ int rsa_encrypt_key_ex(const unsigned char *in, unsigned long inlen, /* OAEP pad the key */ x = *outlen; if ((err = pkcs_1_oaep_encode(in, inlen, lparam, - lparamlen, modulus_bitlen, hash_idx, + lparamlen, modulus_bitlen, hash->algo, out, &x)) != CRYPT_OK) { return err; } |
