summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Sutter <phil.sutter@viprinet.com>2010-06-15 18:24:16 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2010-06-16 12:14:19 +0200
commit87e8dbad0ea89d6b95542cd380f27015c2cc9dea (patch)
tree68b7899985a82d44267074f90caf8339335a0960
parent3f9fef758f04527c063156ed039f61ac575bf379 (diff)
downloadcryptodev-linux-87e8dbad0ea89d6b95542cd380f27015c2cc9dea.tar.gz
cryptodev-linux-87e8dbad0ea89d6b95542cd380f27015c2cc9dea.tar.xz
cryptodev-linux-87e8dbad0ea89d6b95542cd380f27015c2cc9dea.zip
whitespace cleanup
-rw-r--r--cryptodev.h6
-rw-r--r--cryptodev_cipher.c26
-rw-r--r--cryptodev_int.h2
-rw-r--r--cryptodev_main.c12
4 files changed, 23 insertions, 23 deletions
diff --git a/cryptodev.h b/cryptodev.h
index fc94149..f749311 100644
--- a/cryptodev.h
+++ b/cryptodev.h
@@ -39,7 +39,7 @@ typedef enum {
CRYPTO_SHA2_512_HMAC=20,
CRYPTO_AES_CTR=21,
CRYPTO_AES_XTS=22,
-
+
CRYPTO_CAMELLIA_CBC=101,
CRYPTO_RIPEMD160,
CRYPTO_SHA2_256,
@@ -53,7 +53,7 @@ typedef enum {
#define DES_BLOCK_LEN 8
#define DES3_BLOCK_LEN 8
#define RIJNDAEL128_BLOCK_LEN 16
-#define AES_BLOCK_LEN RIJNDAEL128_BLOCK_LEN
+#define AES_BLOCK_LEN RIJNDAEL128_BLOCK_LEN
#define CAMELLIA_BLOCK_LEN
#define BLOWFISH_BLOCK_LEN 8
#define SKIPJACK_BLOCK_LEN 8
@@ -141,7 +141,7 @@ typedef enum {
#define CRF_DH_COMPUTE_KEY (1 << CRK_DH_COMPUTE_KEY)
-/* ioctl's. Compatible with old linux cryptodev.h
+/* ioctl's. Compatible with old linux cryptodev.h
*/
#define CRIOGET _IOWR('c', 101, uint32_t)
#define CIOCGSESSION _IOWR('c', 102, struct session_op)
diff --git a/cryptodev_cipher.c b/cryptodev_cipher.c
index 2436803..25ef44e 100644
--- a/cryptodev_cipher.c
+++ b/cryptodev_cipher.c
@@ -74,7 +74,7 @@ int cryptodev_cipher_init(struct cipher_data* out, const char* alg_name, uint8_t
}
alg = crypto_ablkcipher_alg(out->async.s);
-
+
if (alg != NULL) {
/* Was correct key length supplied? */
if (alg->max_keysize > 0 && unlikely((keylen < alg->min_keysize) ||
@@ -122,7 +122,7 @@ error:
crypto_free_ablkcipher(out->async.s);
kfree(out->async.result);
ablkcipher_request_free(out->async.request);
-
+
return ret;
}
@@ -163,26 +163,26 @@ static inline int waitfor (struct cryptodev_result* cr, ssize_t ret)
default:
return ret;
}
-
+
return 0;
}
ssize_t cryptodev_cipher_encrypt( struct cipher_data* cdata, struct scatterlist *sg1, struct scatterlist *sg2, size_t len)
{
int ret;
-
+
INIT_COMPLETION(cdata->async.result->completion);
ablkcipher_request_set_crypt(cdata->async.request, sg1, sg2,
len, cdata->async.iv);
ret = crypto_ablkcipher_encrypt(cdata->async.request);
-
+
return waitfor(cdata->async.result,ret);
}
ssize_t cryptodev_cipher_decrypt( struct cipher_data* cdata, struct scatterlist *sg1, struct scatterlist *sg2, size_t len)
{
int ret;
-
+
INIT_COMPLETION(cdata->async.result->completion);
ablkcipher_request_set_crypt(cdata->async.request, sg1, sg2,
len, cdata->async.iv);
@@ -206,7 +206,7 @@ uint8_t hkeyp[CRYPTO_HMAC_MAX_KEY_LEN];
return -EINVAL;
}
copy_from_user(hkeyp, mackey, mackeylen);
-
+
hdata->async.s = crypto_alloc_ahash(alg_name, 0, 0);
if (unlikely(IS_ERR(hdata->async.s))) {
dprintk(1,KERN_DEBUG,"%s: Failed to load transform for %s\n", __func__,
@@ -270,7 +270,7 @@ int ret;
"error in crypto_hash_init()\n");
return ret;
}
-
+
return 0;
}
@@ -282,9 +282,9 @@ ssize_t cryptodev_hash_update( struct hash_data* hdata, struct scatterlist *sg,
INIT_COMPLETION(hdata->async.result->completion);
ahash_request_set_crypt(hdata->async.request, sg, NULL,
len);
-
+
ret = crypto_ahash_update(hdata->async.request);
-
+
return waitfor(hdata->async.result,ret);
}
@@ -292,11 +292,11 @@ ssize_t cryptodev_hash_update( struct hash_data* hdata, struct scatterlist *sg,
int cryptodev_hash_final( struct hash_data* hdata, void* output)
{
int ret;
-
+
INIT_COMPLETION(hdata->async.result->completion);
ahash_request_set_crypt(hdata->async.request, NULL, output, 0);
-
+
ret = crypto_ahash_final(hdata->async.request);
-
+
return waitfor(hdata->async.result,ret);
}
diff --git a/cryptodev_int.h b/cryptodev_int.h
index 19cd6a3..bad332c 100644
--- a/cryptodev_int.h
+++ b/cryptodev_int.h
@@ -14,7 +14,7 @@
#define PFX "cryptodev: "
#define dprintk(level,severity,format,a...) \
- do { \
+ do { \
if (level <= cryptodev_verbosity) \
printk(severity PFX "%s[%u]: " format, \
current->comm, current->pid, \
diff --git a/cryptodev_main.c b/cryptodev_main.c
index f5a2635..d462a08 100644
--- a/cryptodev_main.c
+++ b/cryptodev_main.c
@@ -200,7 +200,7 @@ crypto_create_session(struct fcrypt *fcr, struct session_op *sop)
goto error;
}
}
-
+
if (hash_name) {
ret = cryptodev_hash_init(&ses_new->hdata, hash_name, hmac_mode, sop->mackey, sop->mackeylen);
if (ret != 0) {
@@ -370,7 +370,7 @@ crypto_run(struct fcrypt *fcr, struct crypt_op *cop)
bufsize = PAGE_SIZE < nbytes ? PAGE_SIZE : nbytes;
nbytes = cop->len;
-
+
if (ses_ptr->hdata.init != 0) {
ret = cryptodev_hash_reset(&ses_ptr->hdata);
if (unlikely(ret)) {
@@ -455,7 +455,7 @@ crypto_run(struct fcrypt *fcr, struct crypt_op *cop)
nbytes -= current_len;
src += current_len;
}
-
+
if (ses_ptr->hdata.init != 0) {
ret = cryptodev_hash_final(&ses_ptr->hdata, hash_output);
if (unlikely(ret)) {
@@ -514,7 +514,7 @@ cryptodev_release(struct inode *inode, struct file *filp)
kfree(fcr);
filp->private_data = NULL;
}
-
+
return 0;
}
@@ -555,7 +555,7 @@ cryptodev_ioctl(struct inode *inode, struct file *filp,
fd = clonefd(filp);
put_user(fd, p);
return 0;
-
+
case CIOCGSESSION:
copy_from_user(&sop, (void*)arg, sizeof(sop));
ret = crypto_create_session(fcr, &sop);
@@ -713,7 +713,7 @@ cryptodev_deregister(void)
int __init init_cryptodev(void)
{
int rc;
-
+
rc = cryptodev_register();
if (unlikely(rc))
return rc;