summaryrefslogtreecommitdiffstats
path: root/crypto/userspace/ncr-pk.h
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-07-26 20:40:47 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-07-26 20:40:47 +0200
commita04fd1aa4f807e2f97632a46070306e1389264ed (patch)
treefc2511add6defbbcb3f5285ef78fd0c34ccc5512 /crypto/userspace/ncr-pk.h
parent16ace6317db2c47b36b08b0addfe91356151c08d (diff)
parent935be4945512eb37461a226c51ede5e8b05cbe24 (diff)
downloadkernel-crypto-a04fd1aa4f807e2f97632a46070306e1389264ed.tar.gz
kernel-crypto-a04fd1aa4f807e2f97632a46070306e1389264ed.tar.xz
kernel-crypto-a04fd1aa4f807e2f97632a46070306e1389264ed.zip
Merge branch 'standalone-master' into standalone-rename
Conflicts: crypto/userspace/ncr-data.c crypto/userspace/ncr_int.h examples/Makefile examples/ncr.c examples/pk.c examples/speed.c ncr-int.h ncr_int.h
Diffstat (limited to 'crypto/userspace/ncr-pk.h')
-rw-r--r--crypto/userspace/ncr-pk.h34
1 files changed, 20 insertions, 14 deletions
diff --git a/crypto/userspace/ncr-pk.h b/crypto/userspace/ncr-pk.h
index 11800175c3b..fdc5e1c005b 100644
--- a/crypto/userspace/ncr-pk.h
+++ b/crypto/userspace/ncr-pk.h
@@ -4,11 +4,11 @@
#include <tomcrypt.h>
struct ncr_pk_ctx {
- ncr_algorithm_t algorithm; /* algorithm */
+ const struct algo_properties_st *algorithm; /* algorithm */
- ncr_algorithm_t sign_hash; /* for verification */
+ const struct algo_properties_st *sign_hash; /* for verification */
- ncr_algorithm_t oaep_hash;
+ const struct algo_properties_st *oaep_hash;
int salt_len; /* for RSA-PSS signatures */
int type; /* libtomcrypt type */
@@ -19,7 +19,7 @@ struct ncr_pk_ctx {
/* PK */
void ncr_pk_clear(struct key_item_st* key);
-int ncr_pk_generate(ncr_algorithm_t algo,
+int ncr_pk_generate(const struct algo_properties_st *algo,
struct ncr_key_generate_params_st * params,
struct key_item_st* private, struct key_item_st* public);
int ncr_pk_pack( const struct key_item_st * key, uint8_t * packed, uint32_t * packed_size);
@@ -30,19 +30,25 @@ int ncr_pk_queue_init(void);
void ncr_pk_queue_deinit(void);
/* encryption/decryption */
-int ncr_pk_cipher_init(ncr_algorithm_t algo,
+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);
void ncr_pk_cipher_deinit(struct ncr_pk_ctx* ctx);
-int ncr_pk_cipher_encrypt(const struct ncr_pk_ctx* ctx, const void* input,
- size_t input_size, void* output, size_t *output_size);
-int ncr_pk_cipher_decrypt(const struct ncr_pk_ctx* ctx, const void* input,
- size_t input_size, void* output, size_t *output_size);
-int ncr_pk_cipher_sign(const struct ncr_pk_ctx* ctx, const void* input,
- size_t input_size, void* output, size_t *output_size);
+int ncr_pk_cipher_encrypt(const struct ncr_pk_ctx* ctx,
+ const struct scatterlist* isg, unsigned int isg_cnt, size_t isg_size,
+ struct scatterlist *osg, unsigned int osg_cnt, size_t* osg_size);
+
+int ncr_pk_cipher_decrypt(const struct ncr_pk_ctx* ctx,
+ const struct scatterlist* isg, unsigned int isg_cnt, size_t isg_size,
+ struct scatterlist *osg, unsigned int osg_cnt, size_t* osg_size);
+
+int ncr_pk_cipher_sign(const struct ncr_pk_ctx* ctx,
+ const struct scatterlist* isg, unsigned int isg_cnt, size_t isg_size,
+ struct scatterlist *osg, unsigned int osg_cnt, size_t* osg_size);
+
int ncr_pk_cipher_verify(const struct ncr_pk_ctx* ctx,
- const void* signature, size_t signature_size,
- const void* hash, size_t hash_size, ncr_error_t*);
+ const struct scatterlist* sign_sg, unsigned int sign_sg_cnt, size_t sign_sg_size,
+ const void* hash, size_t hash_size, ncr_error_t* err);
#endif