diff options
author | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 04:30:14 +0200 |
---|---|---|
committer | Miloslav Trmač <mitr@redhat.com> | 2010-07-24 04:30:14 +0200 |
commit | d750b60952619af570ac4d91cd650ffa6bbe311d (patch) | |
tree | 894b9abfd9eaaa8e241994136c06700a38fcd991 /ncr-pk.c | |
parent | 6c29ce243f2d106648d93bc3cf44060db38fdf9a (diff) | |
download | kernel-crypto-d750b60952619af570ac4d91cd650ffa6bbe311d.tar.gz kernel-crypto-d750b60952619af570ac4d91cd650ffa6bbe311d.tar.xz kernel-crypto-d750b60952619af570ac4d91cd650ffa6bbe311d.zip |
Only look up the sign_hash algorithm once
Diffstat (limited to 'ncr-pk.c')
-rw-r--r-- | ncr-pk.c | 8 |
1 files changed, 2 insertions, 6 deletions
@@ -335,7 +335,7 @@ void ncr_pk_cipher_deinit(struct ncr_pk_ctx* ctx) int ncr_pk_cipher_init(const struct algo_properties_st *algo, struct ncr_pk_ctx* ctx, struct ncr_key_params_st* params, - struct key_item_st *key) + struct key_item_st *key, const struct algo_properties_st *sign_hash) { memset(ctx, 0, sizeof(*ctx)); @@ -346,11 +346,7 @@ int ncr_pk_cipher_init(const struct algo_properties_st *algo, ctx->algorithm = algo; ctx->key = key; - ctx->sign_hash = ncr_key_params_get_sign_hash(algo, params); - if (IS_ERR(ctx->sign_hash)) { - err(); - return PTR_ERR(ctx->sign_hash); - } + ctx->sign_hash = sign_hash; switch(algo->algo) { case NCR_ALG_RSA: |