26
26
#include <crypto/internal/hash.h>
27
27
#include <linux/dma-mapping.h>
28
28
#include <crypto/algapi.h>
29
+ #include <crypto/aead.h>
29
30
#include <crypto/aes.h>
30
31
#include <crypto/sha.h>
31
32
#include <crypto/ctr.h>
@@ -83,7 +84,7 @@ int crypto4xx_encrypt(struct ablkcipher_request *req)
83
84
crypto4xx_memcpy_to_le32 (iv , req -> info , ivlen );
84
85
85
86
return crypto4xx_build_pd (& req -> base , ctx , req -> src , req -> dst ,
86
- req -> nbytes , iv , ivlen , ctx -> sa_out , ctx -> sa_len );
87
+ req -> nbytes , iv , ivlen , ctx -> sa_out , ctx -> sa_len , 0 );
87
88
}
88
89
89
90
int crypto4xx_decrypt (struct ablkcipher_request * req )
@@ -97,7 +98,7 @@ int crypto4xx_decrypt(struct ablkcipher_request *req)
97
98
crypto4xx_memcpy_to_le32 (iv , req -> info , ivlen );
98
99
99
100
return crypto4xx_build_pd (& req -> base , ctx , req -> src , req -> dst ,
100
- req -> nbytes , iv , ivlen , ctx -> sa_in , ctx -> sa_len );
101
+ req -> nbytes , iv , ivlen , ctx -> sa_in , ctx -> sa_len , 0 );
101
102
}
102
103
103
104
/**
@@ -213,7 +214,7 @@ int crypto4xx_rfc3686_encrypt(struct ablkcipher_request *req)
213
214
214
215
return crypto4xx_build_pd (& req -> base , ctx , req -> src , req -> dst ,
215
216
req -> nbytes , iv , AES_IV_SIZE ,
216
- ctx -> sa_out , ctx -> sa_len );
217
+ ctx -> sa_out , ctx -> sa_len , 0 );
217
218
}
218
219
219
220
int crypto4xx_rfc3686_decrypt (struct ablkcipher_request * req )
@@ -227,7 +228,7 @@ int crypto4xx_rfc3686_decrypt(struct ablkcipher_request *req)
227
228
228
229
return crypto4xx_build_pd (& req -> base , ctx , req -> src , req -> dst ,
229
230
req -> nbytes , iv , AES_IV_SIZE ,
230
- ctx -> sa_out , ctx -> sa_len );
231
+ ctx -> sa_out , ctx -> sa_len , 0 );
231
232
}
232
233
233
234
/**
@@ -239,11 +240,13 @@ static int crypto4xx_hash_alg_init(struct crypto_tfm *tfm,
239
240
unsigned char hm )
240
241
{
241
242
struct crypto_alg * alg = tfm -> __crt_alg ;
242
- struct crypto4xx_alg * my_alg = crypto_alg_to_crypto4xx_alg ( alg ) ;
243
+ struct crypto4xx_alg * my_alg ;
243
244
struct crypto4xx_ctx * ctx = crypto_tfm_ctx (tfm );
244
245
struct dynamic_sa_hash160 * sa ;
245
246
int rc ;
246
247
248
+ my_alg = container_of (__crypto_ahash_alg (alg ), struct crypto4xx_alg ,
249
+ alg .u .hash );
247
250
ctx -> dev = my_alg -> dev ;
248
251
249
252
/* Create SA */
@@ -300,7 +303,7 @@ int crypto4xx_hash_update(struct ahash_request *req)
300
303
301
304
return crypto4xx_build_pd (& req -> base , ctx , req -> src , & dst ,
302
305
req -> nbytes , NULL , 0 , ctx -> sa_in ,
303
- ctx -> sa_len );
306
+ ctx -> sa_len , 0 );
304
307
}
305
308
306
309
int crypto4xx_hash_final (struct ahash_request * req )
@@ -319,7 +322,7 @@ int crypto4xx_hash_digest(struct ahash_request *req)
319
322
320
323
return crypto4xx_build_pd (& req -> base , ctx , req -> src , & dst ,
321
324
req -> nbytes , NULL , 0 , ctx -> sa_in ,
322
- ctx -> sa_len );
325
+ ctx -> sa_len , 0 );
323
326
}
324
327
325
328
/**
@@ -330,5 +333,3 @@ int crypto4xx_sha1_alg_init(struct crypto_tfm *tfm)
330
333
return crypto4xx_hash_alg_init (tfm , SA_HASH160_LEN , SA_HASH_ALG_SHA1 ,
331
334
SA_HASH_MODE_HASH );
332
335
}
333
-
334
-
0 commit comments