aboutsummaryrefslogtreecommitdiff
path: root/src/libgcrypt.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2011-09-17 00:20:45 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2011-09-18 20:34:16 +0200
commitaf09313eac20e91e7e70336c3b8a45688a73d146 (patch)
tree0b731e2b25bb0307af0e47433a3f535451461b36 /src/libgcrypt.c
parentac41a083efd64d94dfb15845c6c25ba5667ba8b8 (diff)
downloadlibssh-af09313eac20e91e7e70336c3b8a45688a73d146.tar.gz
libssh-af09313eac20e91e7e70336c3b8a45688a73d146.tar.xz
libssh-af09313eac20e91e7e70336c3b8a45688a73d146.zip
crypto: rename crypto_struct -> ssh_cipher_struct
Diffstat (limited to 'src/libgcrypt.c')
-rw-r--r--src/libgcrypt.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/libgcrypt.c b/src/libgcrypt.c
index b31ac709..70ce828d 100644
--- a/src/libgcrypt.c
+++ b/src/libgcrypt.c
@@ -36,7 +36,7 @@ struct ssh_mac_ctx_struct {
gcry_md_hd_t ctx;
};
-static int alloc_key(struct crypto_struct *cipher) {
+static int alloc_key(struct ssh_cipher_struct *cipher) {
cipher->key = malloc(cipher->keylen);
if (cipher->key == NULL) {
return -1;
@@ -166,7 +166,7 @@ void hmac_final(HMACCTX c, unsigned char *hashmacbuf, unsigned int *len) {
}
/* the wrapper functions for blowfish */
-static int blowfish_set_key(struct crypto_struct *cipher, void *key, void *IV){
+static int blowfish_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV){
if (cipher->key == NULL) {
if (alloc_key(cipher) < 0) {
return -1;
@@ -190,17 +190,17 @@ static int blowfish_set_key(struct crypto_struct *cipher, void *key, void *IV){
return 0;
}
-static void blowfish_encrypt(struct crypto_struct *cipher, void *in,
+static void blowfish_encrypt(struct ssh_cipher_struct *cipher, void *in,
void *out, unsigned long len) {
gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
}
-static void blowfish_decrypt(struct crypto_struct *cipher, void *in,
+static void blowfish_decrypt(struct ssh_cipher_struct *cipher, void *in,
void *out, unsigned long len) {
gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
}
-static int aes_set_key(struct crypto_struct *cipher, void *key, void *IV) {
+static int aes_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV) {
int mode=GCRY_CIPHER_MODE_CBC;
if (cipher->key == NULL) {
if (alloc_key(cipher) < 0) {
@@ -252,17 +252,17 @@ static int aes_set_key(struct crypto_struct *cipher, void *key, void *IV) {
return 0;
}
-static void aes_encrypt(struct crypto_struct *cipher, void *in, void *out,
+static void aes_encrypt(struct ssh_cipher_struct *cipher, void *in, void *out,
unsigned long len) {
gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
}
-static void aes_decrypt(struct crypto_struct *cipher, void *in, void *out,
+static void aes_decrypt(struct ssh_cipher_struct *cipher, void *in, void *out,
unsigned long len) {
gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
}
-static int des3_set_key(struct crypto_struct *cipher, void *key, void *IV) {
+static int des3_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV) {
if (cipher->key == NULL) {
if (alloc_key(cipher) < 0) {
return -1;
@@ -285,17 +285,17 @@ static int des3_set_key(struct crypto_struct *cipher, void *key, void *IV) {
return 0;
}
-static void des3_encrypt(struct crypto_struct *cipher, void *in,
+static void des3_encrypt(struct ssh_cipher_struct *cipher, void *in,
void *out, unsigned long len) {
gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
}
-static void des3_decrypt(struct crypto_struct *cipher, void *in,
+static void des3_decrypt(struct ssh_cipher_struct *cipher, void *in,
void *out, unsigned long len) {
gcry_cipher_decrypt(cipher->key[0], out, len, in, len);
}
-static int des3_1_set_key(struct crypto_struct *cipher, void *key, void *IV) {
+static int des3_1_set_key(struct ssh_cipher_struct *cipher, void *key, void *IV) {
if (cipher->key == NULL) {
if (alloc_key(cipher) < 0) {
return -1;
@@ -346,14 +346,14 @@ static int des3_1_set_key(struct crypto_struct *cipher, void *key, void *IV) {
return 0;
}
-static void des3_1_encrypt(struct crypto_struct *cipher, void *in,
+static void des3_1_encrypt(struct ssh_cipher_struct *cipher, void *in,
void *out, unsigned long len) {
gcry_cipher_encrypt(cipher->key[0], out, len, in, len);
gcry_cipher_decrypt(cipher->key[1], in, len, out, len);
gcry_cipher_encrypt(cipher->key[2], out, len, in, len);
}
-static void des3_1_decrypt(struct crypto_struct *cipher, void *in,
+static void des3_1_decrypt(struct ssh_cipher_struct *cipher, void *in,
void *out, unsigned long len) {
gcry_cipher_decrypt(cipher->key[2], out, len, in, len);
gcry_cipher_encrypt(cipher->key[1], in, len, out, len);
@@ -361,7 +361,7 @@ static void des3_1_decrypt(struct crypto_struct *cipher, void *in,
}
/* the table of supported ciphers */
-static struct crypto_struct ssh_ciphertab[] = {
+static struct ssh_cipher_struct ssh_ciphertab[] = {
{
.name = "blowfish-cbc",
.blocksize = 8,
@@ -474,7 +474,7 @@ static struct crypto_struct ssh_ciphertab[] = {
}
};
-struct crypto_struct *ssh_get_ciphertab(void)
+struct ssh_cipher_struct *ssh_get_ciphertab(void)
{
return ssh_ciphertab;
}