Whamcloud - gitweb
LU-2800 compat: remove crypto shims
[fs/lustre-release.git] / lustre / obdclass / capa.c
index 3872d85..8f67dc7 100644 (file)
@@ -245,7 +245,7 @@ EXPORT_SYMBOL(capa_lookup);
 
 int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key)
 {
-        struct ll_crypto_hash *tfm;
+       struct crypto_hash *tfm;
         struct capa_hmac_alg  *alg;
         int keylen;
         struct scatterlist sl;
@@ -257,7 +257,7 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key)
 
         alg = &capa_hmac_algs[capa_alg(capa)];
 
-        tfm = ll_crypto_alloc_hash(alg->ha_name, 0, 0);
+       tfm = crypto_alloc_hash(alg->ha_name, 0, 0);
         if (!tfm) {
                 CERROR("crypto_alloc_tfm failed, check whether your kernel"
                        "has crypto support!\n");
@@ -270,7 +270,7 @@ int capa_hmac(__u8 *hmac, struct lustre_capa *capa, __u8 *key)
                    (unsigned long)(capa) % PAGE_CACHE_SIZE);
 
         ll_crypto_hmac(tfm, key, &keylen, &sl, sl.length, hmac);
-        ll_crypto_free_hash(tfm);
+       crypto_free_hash(tfm);
 
         return 0;
 }
@@ -278,7 +278,7 @@ EXPORT_SYMBOL(capa_hmac);
 
 int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
 {
-        struct ll_crypto_cipher *tfm;
+       struct crypto_blkcipher *tfm;
         struct scatterlist sd;
         struct scatterlist ss;
         struct blkcipher_desc desc;
@@ -289,7 +289,7 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
 
        /* passing "aes" in a variable instead of a constant string keeps gcc
         * 4.3.2 happy */
-       tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
+       tfm = crypto_alloc_blkcipher(alg, 0, 0 );
        if (IS_ERR(tfm)) {
                CERROR("failed to load transform for aes\n");
                RETURN(PTR_ERR(tfm));
@@ -301,7 +301,7 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
                 GOTO(out, rc = -EINVAL);
         }
 
-        rc = ll_crypto_blkcipher_setkey(tfm, key, min);
+       rc = crypto_blkcipher_setkey(tfm, key, min);
         if (rc) {
                 CERROR("failed to setting key for aes\n");
                 GOTO(out, rc);
@@ -315,7 +315,7 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
         desc.tfm   = tfm;
         desc.info  = NULL;
         desc.flags = 0;
-        rc = ll_crypto_blkcipher_encrypt(&desc, &sd, &ss, 16);
+       rc = crypto_blkcipher_encrypt(&desc, &sd, &ss, 16);
         if (rc) {
                 CERROR("failed to encrypt for aes\n");
                 GOTO(out, rc);
@@ -324,14 +324,14 @@ int capa_encrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
         EXIT;
 
 out:
-        ll_crypto_free_blkcipher(tfm);
+       crypto_free_blkcipher(tfm);
         return rc;
 }
 EXPORT_SYMBOL(capa_encrypt_id);
 
 int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
 {
-        struct ll_crypto_cipher *tfm;
+       struct crypto_blkcipher *tfm;
         struct scatterlist sd;
         struct scatterlist ss;
         struct blkcipher_desc desc;
@@ -342,7 +342,7 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
 
        /* passing "aes" in a variable instead of a constant string keeps gcc
         * 4.3.2 happy */
-       tfm = ll_crypto_alloc_blkcipher(alg, 0, 0 );
+       tfm = crypto_alloc_blkcipher(alg, 0, 0 );
        if (IS_ERR(tfm)) {
                CERROR("failed to load transform for aes\n");
                RETURN(PTR_ERR(tfm));
@@ -354,7 +354,7 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
                 GOTO(out, rc = -EINVAL);
         }
 
-        rc = ll_crypto_blkcipher_setkey(tfm, key, min);
+       rc = crypto_blkcipher_setkey(tfm, key, min);
         if (rc) {
                 CERROR("failed to setting key for aes\n");
                 GOTO(out, rc);
@@ -369,7 +369,7 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
         desc.tfm   = tfm;
         desc.info  = NULL;
         desc.flags = 0;
-        rc = ll_crypto_blkcipher_decrypt(&desc, &sd, &ss, 16);
+       rc = crypto_blkcipher_decrypt(&desc, &sd, &ss, 16);
         if (rc) {
                 CERROR("failed to decrypt for aes\n");
                 GOTO(out, rc);
@@ -378,7 +378,7 @@ int capa_decrypt_id(__u32 *d, __u32 *s, __u8 *key, int keylen)
         EXIT;
 
 out:
-        ll_crypto_free_blkcipher(tfm);
+       crypto_free_blkcipher(tfm);
         return rc;
 }
 EXPORT_SYMBOL(capa_decrypt_id);