diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 03:02:59 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 04:25:24 +0200 |
commit | 32e0115f32c75f0bffdea599734774376cdf097b (patch) | |
tree | 8cff55d57a65934e5103de6d2d28bcfab86e0ac1 | |
parent | 06520b6a96ac44d1c4c6e999c5d5ec725d11afa5 (diff) | |
download | cryptodev-linux-32e0115f32c75f0bffdea599734774376cdf097b.tar.gz cryptodev-linux-32e0115f32c75f0bffdea599734774376cdf097b.tar.xz cryptodev-linux-32e0115f32c75f0bffdea599734774376cdf097b.zip |
Use algo_properties_st in hash_is_valid
-rw-r--r-- | libtomcrypt/hashes/crypt_hash_is_valid.c | 4 | ||||
-rw-r--r-- | libtomcrypt/hashes/hash_memory.c | 2 | ||||
-rw-r--r-- | libtomcrypt/hashes/hash_memory_multi.c | 2 | ||||
-rw-r--r-- | libtomcrypt/headers/tomcrypt_hash.h | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/pkcs1/pkcs_1_mgf1.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/pkcs1/pkcs_1_oaep_decode.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/pkcs1/pkcs_1_oaep_encode.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/pkcs1/pkcs_1_pss_decode.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/pkcs1/pkcs_1_pss_encode.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/rsa/rsa_decrypt_key.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/rsa/rsa_encrypt_key.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/rsa/rsa_sign_hash.c | 2 | ||||
-rw-r--r-- | libtomcrypt/pk/rsa/rsa_verify_hash.c | 2 |
13 files changed, 14 insertions, 14 deletions
diff --git a/libtomcrypt/hashes/crypt_hash_is_valid.c b/libtomcrypt/hashes/crypt_hash_is_valid.c index 32e8699..d01d418 100644 --- a/libtomcrypt/hashes/crypt_hash_is_valid.c +++ b/libtomcrypt/hashes/crypt_hash_is_valid.c @@ -17,10 +17,10 @@ /* Test if a hash index is valid - @param idx The index of the hash to search for + @param idx The hash to search for @return CRYPT_OK if valid */ -int hash_is_valid(int idx) +int hash_is_valid(const struct algo_properties_st *hash) { return CRYPT_OK; } diff --git a/libtomcrypt/hashes/hash_memory.c b/libtomcrypt/hashes/hash_memory.c index 13e7d36..267957a 100644 --- a/libtomcrypt/hashes/hash_memory.c +++ b/libtomcrypt/hashes/hash_memory.c @@ -36,7 +36,7 @@ int hash_memory(const struct algo_properties_st *hash, const unsigned char *in, LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } diff --git a/libtomcrypt/hashes/hash_memory_multi.c b/libtomcrypt/hashes/hash_memory_multi.c index dd3b524..79cfd2b 100644 --- a/libtomcrypt/hashes/hash_memory_multi.c +++ b/libtomcrypt/hashes/hash_memory_multi.c @@ -42,7 +42,7 @@ int hash_memory_multi(const struct algo_properties_st *hash, unsigned char *out, LTC_ARGCHK(out != NULL); LTC_ARGCHK(outlen != NULL); - if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } diff --git a/libtomcrypt/headers/tomcrypt_hash.h b/libtomcrypt/headers/tomcrypt_hash.h index 380bf7d..e4e84e4 100644 --- a/libtomcrypt/headers/tomcrypt_hash.h +++ b/libtomcrypt/headers/tomcrypt_hash.h @@ -2,7 +2,7 @@ struct algo_properties_st; -int hash_is_valid(int idx); +int hash_is_valid(const struct algo_properties_st *hash); int hash_memory(const struct algo_properties_st *hash, const unsigned char *in, unsigned long inlen, diff --git a/libtomcrypt/pk/pkcs1/pkcs_1_mgf1.c b/libtomcrypt/pk/pkcs1/pkcs_1_mgf1.c index 983022d..e7971f7 100644 --- a/libtomcrypt/pk/pkcs1/pkcs_1_mgf1.c +++ b/libtomcrypt/pk/pkcs1/pkcs_1_mgf1.c @@ -40,7 +40,7 @@ int pkcs_1_mgf1(const struct algo_properties_st *hash, LTC_ARGCHK(mask != NULL); /* ensure valid hash */ - if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } diff --git a/libtomcrypt/pk/pkcs1/pkcs_1_oaep_decode.c b/libtomcrypt/pk/pkcs1/pkcs_1_oaep_decode.c index 4ca4e19..b44a1ed 100644 --- a/libtomcrypt/pk/pkcs1/pkcs_1_oaep_decode.c +++ b/libtomcrypt/pk/pkcs1/pkcs_1_oaep_decode.c @@ -50,7 +50,7 @@ int pkcs_1_oaep_decode(const unsigned char *msg, unsigned long msglen, *res = 0; /* test valid hash */ - if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } diff --git a/libtomcrypt/pk/pkcs1/pkcs_1_oaep_encode.c b/libtomcrypt/pk/pkcs1/pkcs_1_oaep_encode.c index 18a464f..43bd22e 100644 --- a/libtomcrypt/pk/pkcs1/pkcs_1_oaep_encode.c +++ b/libtomcrypt/pk/pkcs1/pkcs_1_oaep_encode.c @@ -44,7 +44,7 @@ int pkcs_1_oaep_encode(const unsigned char *msg, unsigned long msglen, LTC_ARGCHK(outlen != NULL); /* test valid hash */ - if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } diff --git a/libtomcrypt/pk/pkcs1/pkcs_1_pss_decode.c b/libtomcrypt/pk/pkcs1/pkcs_1_pss_decode.c index 7bcffe2..b8e126a 100644 --- a/libtomcrypt/pk/pkcs1/pkcs_1_pss_decode.c +++ b/libtomcrypt/pk/pkcs1/pkcs_1_pss_decode.c @@ -46,7 +46,7 @@ int pkcs_1_pss_decode(const unsigned char *msghash, unsigned long msghashlen, *res = 0; /* ensure hash is valid */ - if ((err = hash_is_valid(hash_algo->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash_algo)) != CRYPT_OK) { return err; } diff --git a/libtomcrypt/pk/pkcs1/pkcs_1_pss_encode.c b/libtomcrypt/pk/pkcs1/pkcs_1_pss_encode.c index 261709f..88963de 100644 --- a/libtomcrypt/pk/pkcs1/pkcs_1_pss_encode.c +++ b/libtomcrypt/pk/pkcs1/pkcs_1_pss_encode.c @@ -43,7 +43,7 @@ int pkcs_1_pss_encode(const unsigned char *msghash, unsigned long msghashlen, LTC_ARGCHK(outlen != NULL); /* ensure hash and PRNG are valid */ - if ((err = hash_is_valid(hash_algo->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash_algo)) != CRYPT_OK) { return err; } diff --git a/libtomcrypt/pk/rsa/rsa_decrypt_key.c b/libtomcrypt/pk/rsa/rsa_decrypt_key.c index af48678..989c935 100644 --- a/libtomcrypt/pk/rsa/rsa_decrypt_key.c +++ b/libtomcrypt/pk/rsa/rsa_decrypt_key.c @@ -59,7 +59,7 @@ int rsa_decrypt_key_ex(const unsigned char *in, unsigned long inlen, if (padding == LTC_LTC_PKCS_1_OAEP) { /* valid hash ? */ - if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } } diff --git a/libtomcrypt/pk/rsa/rsa_encrypt_key.c b/libtomcrypt/pk/rsa/rsa_encrypt_key.c index 9fea75a..4ce51a4 100644 --- a/libtomcrypt/pk/rsa/rsa_encrypt_key.c +++ b/libtomcrypt/pk/rsa/rsa_encrypt_key.c @@ -52,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->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } } diff --git a/libtomcrypt/pk/rsa/rsa_sign_hash.c b/libtomcrypt/pk/rsa/rsa_sign_hash.c index 8c6c9d9..5a32d33 100644 --- a/libtomcrypt/pk/rsa/rsa_sign_hash.c +++ b/libtomcrypt/pk/rsa/rsa_sign_hash.c @@ -50,7 +50,7 @@ int rsa_sign_hash_ex(const unsigned char *in, unsigned long inlen, } if (padding == LTC_LTC_PKCS_1_PSS) { - if ((err = hash_is_valid(hash->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash)) != CRYPT_OK) { return err; } } diff --git a/libtomcrypt/pk/rsa/rsa_verify_hash.c b/libtomcrypt/pk/rsa/rsa_verify_hash.c index 4036a09..20f852e 100644 --- a/libtomcrypt/pk/rsa/rsa_verify_hash.c +++ b/libtomcrypt/pk/rsa/rsa_verify_hash.c @@ -58,7 +58,7 @@ int rsa_verify_hash_ex(const unsigned char *sig, unsigned long siglen, if (padding == LTC_LTC_PKCS_1_PSS) { /* valid hash ? */ - if ((err = hash_is_valid(hash_algo->algo)) != CRYPT_OK) { + if ((err = hash_is_valid(hash_algo)) != CRYPT_OK) { return err; } } |