if (req->old)
return crypt(req);
- src = scatterwalk_ffwd(nreq->srcbuf, req->src,
- req->assoclen + req->cryptoff);
- dst = scatterwalk_ffwd(nreq->dstbuf, req->dst,
- req->assoclen + req->cryptoff);
+ src = scatterwalk_ffwd(nreq->srcbuf, req->src, req->assoclen);
+ dst = scatterwalk_ffwd(nreq->dstbuf, req->dst, req->assoclen);
aead_request_set_tfm(&nreq->subreq, aead);
aead_request_set_callback(&nreq->subreq, aead_request_flags(req),
aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->dst, req->dst,
req->cryptlen - ivsize, info);
- aead_request_set_ad(subreq, req->assoclen + ivsize, 0);
+ aead_request_set_ad(subreq, req->assoclen + ivsize);
crypto_xor(info, ctx->salt, ivsize);
scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1);
aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->src, req->dst,
req->cryptlen - ivsize, req->iv);
- aead_request_set_ad(subreq, req->assoclen + ivsize, 0);
+ aead_request_set_ad(subreq, req->assoclen + ivsize);
scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0);
if (req->src != req->dst)
aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, dst, dst,
req->cryptlen - ivsize, req->iv);
- aead_request_set_ad(subreq, req->assoclen, 0);
+ aead_request_set_ad(subreq, req->assoclen);
memcpy(buf, req->iv, ivsize);
crypto_xor(buf, ctx->salt, ivsize);
aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->dst, req->dst,
req->cryptlen - ivsize, info);
- aead_request_set_ad(subreq, req->assoclen + ivsize, 0);
+ aead_request_set_ad(subreq, req->assoclen + ivsize);
crypto_xor(info, ctx->salt, ivsize);
scatterwalk_map_and_copy(info, req->dst, req->assoclen, ivsize, 1);
aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, dst, dst,
req->cryptlen - ivsize, req->iv);
- aead_request_set_ad(subreq, req->assoclen, 0);
+ aead_request_set_ad(subreq, req->assoclen);
err = crypto_aead_decrypt(subreq);
if (req->assoclen > 8)
aead_request_set_callback(subreq, req->base.flags, compl, data);
aead_request_set_crypt(subreq, req->src, req->dst,
req->cryptlen - ivsize, req->iv);
- aead_request_set_ad(subreq, req->assoclen + ivsize, 0);
+ aead_request_set_ad(subreq, req->assoclen + ivsize);
scatterwalk_map_and_copy(req->iv, req->src, req->assoclen, ivsize, 0);
if (req->src != req->dst)
* @base: Common attributes for async crypto requests
* @assoclen: Length in bytes of associated data for authentication
* @cryptlen: Length of data to be encrypted or decrypted
- * @cryptoff: Bytes to skip after AD before plain/cipher text
* @iv: Initialisation vector
* @assoc: Associated data
* @src: Source data
unsigned int assoclen;
unsigned int cryptlen;
- unsigned int cryptoff;
u8 *iv;
* aead_request_set_ad - set associated data information
* @req: request handle
* @assoclen: number of bytes in associated data
- * @cryptoff: Number of bytes to skip after AD before plain/cipher text
*
* Setting the AD information. This function sets the length of
* the associated data and the number of bytes to skip after it to
* access the plain/cipher text.
*/
static inline void aead_request_set_ad(struct aead_request *req,
- unsigned int assoclen,
- unsigned int cryptoff)
+ unsigned int assoclen)
{
req->assoclen = assoclen;
- req->cryptoff = cryptoff;
req->old = false;
}