Lines Matching refs:req
48 static int chacha_stream_xor(struct skcipher_request *req, in chacha_stream_xor() argument
56 err = skcipher_walk_virt(&walk, req, false); in chacha_stream_xor()
79 static int crypto_chacha_crypt_generic(struct skcipher_request *req) in crypto_chacha_crypt_generic() argument
81 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in crypto_chacha_crypt_generic()
84 return chacha_stream_xor(req, ctx, req->iv, false); in crypto_chacha_crypt_generic()
87 static int crypto_chacha_crypt_arch(struct skcipher_request *req) in crypto_chacha_crypt_arch() argument
89 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in crypto_chacha_crypt_arch()
92 return chacha_stream_xor(req, ctx, req->iv, true); in crypto_chacha_crypt_arch()
95 static int crypto_xchacha_crypt(struct skcipher_request *req, bool arch) in crypto_xchacha_crypt() argument
97 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in crypto_xchacha_crypt()
104 chacha_init(&state, ctx->key, req->iv); in crypto_xchacha_crypt()
112 memcpy(&real_iv[0], req->iv + 24, 8); /* stream position */ in crypto_xchacha_crypt()
113 memcpy(&real_iv[8], req->iv + 16, 8); /* remaining 64 nonce bits */ in crypto_xchacha_crypt()
116 return chacha_stream_xor(req, &subctx, real_iv, arch); in crypto_xchacha_crypt()
119 static int crypto_xchacha_crypt_generic(struct skcipher_request *req) in crypto_xchacha_crypt_generic() argument
121 return crypto_xchacha_crypt(req, false); in crypto_xchacha_crypt_generic()
124 static int crypto_xchacha_crypt_arch(struct skcipher_request *req) in crypto_xchacha_crypt_arch() argument
126 return crypto_xchacha_crypt(req, true); in crypto_xchacha_crypt_arch()