diff options
author | Aris Adamantiadis <aris@0xbadc0de.be> | 2005-10-04 22:11:19 +0000 |
---|---|---|
committer | Aris Adamantiadis <aris@0xbadc0de.be> | 2005-10-04 22:11:19 +0000 |
commit | 5f7c84f900b81e3bbff55378f8170ddf150daf9c (patch) | |
tree | 2076a6416e087eb5870c2217873ae76e85451f6b /include/libssh/crypto.h | |
parent | c0525750fd090bca0f1ab1884cc26ecd227addb7 (diff) | |
download | libssh-5f7c84f900b81e3bbff55378f8170ddf150daf9c.tar.gz libssh-5f7c84f900b81e3bbff55378f8170ddf150daf9c.tar.xz libssh-5f7c84f900b81e3bbff55378f8170ddf150daf9c.zip |
added the gcrypt patch (without gcrypt as default library).
still needs tests.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@38 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'include/libssh/crypto.h')
-rw-r--r-- | include/libssh/crypto.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/libssh/crypto.h b/include/libssh/crypto.h index 3b8426c..0714f3d 100644 --- a/include/libssh/crypto.h +++ b/include/libssh/crypto.h @@ -33,15 +33,30 @@ MA 02111-1307, USA. */ #ifdef des_set_key #undef des_set_key #endif +#ifdef GCRYPT +#include <gcrypt.h> +#endif + struct crypto_struct { char *name; /* ssh name of the algorithm */ unsigned int blocksize; /* blocksize of the algo */ unsigned int keylen; /* length of the key structure */ +#ifdef HAVE_LIBGCRYPT + gcry_cipher_hd_t *key; +#elif defined HAVE_LIBCRYPTO void *key; /* a key buffer allocated for the algo */ +#endif unsigned int keysize; /* bytes of key used. != keylen */ +#ifdef HAVE_LIBGCRYPT + void (*set_encrypt_key)(struct crypto_struct *cipher, void *key, void *IV); /* sets the new key for immediate use */ + void (*set_decrypt_key)(struct crypto_struct *cipher, void *key, void *IV); + void (*cbc_encrypt)(struct crypto_struct *cipher, void *in, void *out,unsigned long len); + void (*cbc_decrypt)(struct crypto_struct *cipher, void *in, void *out,unsigned long len); +#elif defined HAVE_LIBCRYPTO void (*set_encrypt_key)(struct crypto_struct *cipher, void *key); /* sets the new key for immediate use */ void (*set_decrypt_key)(struct crypto_struct *cipher, void *key); void (*cbc_encrypt)(struct crypto_struct *cipher, void *in, void *out,unsigned long len,void *IV); void (*cbc_decrypt)(struct crypto_struct *cipher, void *in, void *out,unsigned long len,void *IV); +#endif }; |