summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMiloslav Trmač <mitr@redhat.com>2010-10-05 17:25:37 +0200
committerMiloslav Trmač <mitr@redhat.com>2010-10-05 17:25:37 +0200
commit8a0e6e168da0c9efed8810725af5c593a8edf7cf (patch)
tree557c812a0e195894a9a5f2bde4d2aac1456d5efd /include
parent1aab511f2b436ceee221233ba36c0e5a38311b82 (diff)
downloadncrypto-8a0e6e168da0c9efed8810725af5c593a8edf7cf.tar.gz
ncrypto-8a0e6e168da0c9efed8810725af5c593a8edf7cf.tar.xz
ncrypto-8a0e6e168da0c9efed8810725af5c593a8edf7cf.zip
Add symmetric ciphers
Diffstat (limited to 'include')
-rw-r--r--include/ncrypto/ncrypto.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/ncrypto/ncrypto.h b/include/ncrypto/ncrypto.h
index af4f518..8da49c0 100644
--- a/include/ncrypto/ncrypto.h
+++ b/include/ncrypto/ncrypto.h
@@ -53,4 +53,45 @@ CK_RV ncr_digest_standalone (CK_MECHANISM_TYPE mech, void *dest,
size_t *dest_size_ptr, const void *data,
size_t data_size);
+struct ncr_symm_cipher_session;
+
+struct ncr_symm_key;
+
+CK_RV ncr_symm_key_create (struct ncr_symm_key **key, CK_KEY_TYPE type,
+ const void *value, size_t value_size);
+CK_RV ncr_symm_key_destroy (struct ncr_symm_key *key);
+
+/* Session lifetime management. */
+CK_RV ncr_symm_cipher_alloc (struct ncr_symm_cipher_session **sess,
+ CK_MECHANISM_TYPE mech);
+CK_RV ncr_symm_cipher_free (struct ncr_symm_cipher_session *sess);
+/* Use either ncr_symm_cipher_encrypt_{init,update,final} (), or
+ ncr_symm_cipher_{encrypt_init,encrypt} (). After finishing such a call
+ sequence, a new sequence can be started within the same session. Same for
+ decryption sequences. */
+CK_RV ncr_symm_cipher_encrypt_init (struct ncr_symm_cipher_session *sess,
+ struct ncr_symm_key *key,
+ const void *param, size_t param_size);
+CK_RV ncr_symm_cipher_encrypt_update (struct ncr_symm_cipher_session *sess,
+ void *dest, size_t *dest_size_ptr,
+ const void *src, size_t src_size);
+CK_RV ncr_symm_cipher_encrypt_final (struct ncr_symm_cipher_session *sess,
+ void *dest, size_t *dest_size_ptr,
+ const void *src, size_t src_size);
+CK_RV ncr_symm_cipher_encrypt (struct ncr_symm_cipher_session *sess, void *dest,
+ size_t *dest_size_ptr, const void *src,
+ size_t src_size);
+CK_RV ncr_symm_cipher_decrypt_init (struct ncr_symm_cipher_session *sess,
+ struct ncr_symm_key *key,
+ const void *param, size_t param_size);
+CK_RV ncr_symm_cipher_decrypt_update (struct ncr_symm_cipher_session *sess,
+ void *dest, size_t *dest_size_ptr,
+ const void *src, size_t src_size);
+CK_RV ncr_symm_cipher_decrypt_final (struct ncr_symm_cipher_session *sess,
+ void *dest, size_t *dest_size_ptr,
+ const void *src, size_t src_size);
+CK_RV ncr_symm_cipher_decrypt (struct ncr_symm_cipher_session *sess, void *dest,
+ size_t *dest_size_ptr, const void *src,
+ size_t src_size);
+
#endif