@@ -87,11 +87,8 @@ static int crypto_authenc_esn_genicv_tail(struct aead_request *req,
87
87
unsigned int flags )
88
88
{
89
89
struct crypto_aead * authenc_esn = crypto_aead_reqtfm (req );
90
- struct crypto_authenc_esn_ctx * ctx = crypto_aead_ctx (authenc_esn );
91
90
struct authenc_esn_request_ctx * areq_ctx = aead_request_ctx (req );
92
- struct crypto_ahash * auth = ctx -> auth ;
93
- u8 * hash = PTR_ALIGN ((u8 * )areq_ctx -> tail ,
94
- crypto_ahash_alignmask (auth ) + 1 );
91
+ u8 * hash = areq_ctx -> tail ;
95
92
unsigned int authsize = crypto_aead_authsize (authenc_esn );
96
93
unsigned int assoclen = req -> assoclen ;
97
94
unsigned int cryptlen = req -> cryptlen ;
@@ -122,8 +119,7 @@ static int crypto_authenc_esn_genicv(struct aead_request *req,
122
119
struct authenc_esn_request_ctx * areq_ctx = aead_request_ctx (req );
123
120
struct crypto_authenc_esn_ctx * ctx = crypto_aead_ctx (authenc_esn );
124
121
struct crypto_ahash * auth = ctx -> auth ;
125
- u8 * hash = PTR_ALIGN ((u8 * )areq_ctx -> tail ,
126
- crypto_ahash_alignmask (auth ) + 1 );
122
+ u8 * hash = areq_ctx -> tail ;
127
123
struct ahash_request * ahreq = (void * )(areq_ctx -> tail + ctx -> reqoff );
128
124
unsigned int authsize = crypto_aead_authsize (authenc_esn );
129
125
unsigned int assoclen = req -> assoclen ;
@@ -224,8 +220,7 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
224
220
struct skcipher_request * skreq = (void * )(areq_ctx -> tail +
225
221
ctx -> reqoff );
226
222
struct crypto_ahash * auth = ctx -> auth ;
227
- u8 * ohash = PTR_ALIGN ((u8 * )areq_ctx -> tail ,
228
- crypto_ahash_alignmask (auth ) + 1 );
223
+ u8 * ohash = areq_ctx -> tail ;
229
224
unsigned int cryptlen = req -> cryptlen - authsize ;
230
225
unsigned int assoclen = req -> assoclen ;
231
226
struct scatterlist * dst = req -> dst ;
@@ -272,8 +267,7 @@ static int crypto_authenc_esn_decrypt(struct aead_request *req)
272
267
struct ahash_request * ahreq = (void * )(areq_ctx -> tail + ctx -> reqoff );
273
268
unsigned int authsize = crypto_aead_authsize (authenc_esn );
274
269
struct crypto_ahash * auth = ctx -> auth ;
275
- u8 * ohash = PTR_ALIGN ((u8 * )areq_ctx -> tail ,
276
- crypto_ahash_alignmask (auth ) + 1 );
270
+ u8 * ohash = areq_ctx -> tail ;
277
271
unsigned int assoclen = req -> assoclen ;
278
272
unsigned int cryptlen = req -> cryptlen ;
279
273
u8 * ihash = ohash + crypto_ahash_digestsize (auth );
@@ -344,8 +338,7 @@ static int crypto_authenc_esn_init_tfm(struct crypto_aead *tfm)
344
338
ctx -> enc = enc ;
345
339
ctx -> null = null ;
346
340
347
- ctx -> reqoff = ALIGN (2 * crypto_ahash_digestsize (auth ),
348
- crypto_ahash_alignmask (auth ) + 1 );
341
+ ctx -> reqoff = 2 * crypto_ahash_digestsize (auth );
349
342
350
343
crypto_aead_set_reqsize (
351
344
tfm ,
@@ -431,8 +424,7 @@ static int crypto_authenc_esn_create(struct crypto_template *tmpl,
431
424
inst -> alg .base .cra_priority = enc -> base .cra_priority * 10 +
432
425
auth_base -> cra_priority ;
433
426
inst -> alg .base .cra_blocksize = enc -> base .cra_blocksize ;
434
- inst -> alg .base .cra_alignmask = auth_base -> cra_alignmask |
435
- enc -> base .cra_alignmask ;
427
+ inst -> alg .base .cra_alignmask = enc -> base .cra_alignmask ;
436
428
inst -> alg .base .cra_ctxsize = sizeof (struct crypto_authenc_esn_ctx );
437
429
438
430
inst -> alg .ivsize = enc -> ivsize ;
0 commit comments