Lines Matching refs:nbytes
41 unsigned int nbytes; in sm4_ecb_do_crypt() local
46 while ((nbytes = walk.nbytes) > 0) { in sm4_ecb_do_crypt()
51 nblocks = nbytes / SM4_BLOCK_SIZE; in sm4_ecb_do_crypt()
60 err = skcipher_walk_done(&walk, nbytes % SM4_BLOCK_SIZE); in sm4_ecb_do_crypt()
87 unsigned int nbytes; in sm4_cbc_encrypt() local
92 while ((nbytes = walk.nbytes) > 0) { in sm4_cbc_encrypt()
97 while (nbytes >= SM4_BLOCK_SIZE) { in sm4_cbc_encrypt()
103 nbytes -= SM4_BLOCK_SIZE; in sm4_cbc_encrypt()
108 err = skcipher_walk_done(&walk, nbytes); in sm4_cbc_encrypt()
119 unsigned int nbytes; in sm4_cbc_decrypt() local
124 while ((nbytes = walk.nbytes) > 0) { in sm4_cbc_decrypt()
129 nblocks = nbytes / SM4_BLOCK_SIZE; in sm4_cbc_decrypt()
139 err = skcipher_walk_done(&walk, nbytes % SM4_BLOCK_SIZE); in sm4_cbc_decrypt()
150 unsigned int nbytes; in sm4_cfb_encrypt() local
155 while ((nbytes = walk.nbytes) > 0) { in sm4_cfb_encrypt()
161 while (nbytes >= SM4_BLOCK_SIZE) { in sm4_cfb_encrypt()
167 nbytes -= SM4_BLOCK_SIZE; in sm4_cfb_encrypt()
173 if (walk.nbytes == walk.total && nbytes > 0) { in sm4_cfb_encrypt()
175 crypto_xor_cpy(dst, src, keystream, nbytes); in sm4_cfb_encrypt()
176 nbytes = 0; in sm4_cfb_encrypt()
179 err = skcipher_walk_done(&walk, nbytes); in sm4_cfb_encrypt()
190 unsigned int nbytes; in sm4_cfb_decrypt() local
195 while ((nbytes = walk.nbytes) > 0) { in sm4_cfb_decrypt()
200 nblocks = nbytes / SM4_BLOCK_SIZE; in sm4_cfb_decrypt()
211 nbytes -= nblocks * SM4_BLOCK_SIZE; in sm4_cfb_decrypt()
215 if (walk.nbytes == walk.total && nbytes > 0) { in sm4_cfb_decrypt()
219 crypto_xor_cpy(dst, src, keystream, nbytes); in sm4_cfb_decrypt()
220 nbytes = 0; in sm4_cfb_decrypt()
223 err = skcipher_walk_done(&walk, nbytes); in sm4_cfb_decrypt()
234 unsigned int nbytes; in sm4_ctr_crypt() local
239 while ((nbytes = walk.nbytes) > 0) { in sm4_ctr_crypt()
244 nblocks = nbytes / SM4_BLOCK_SIZE; in sm4_ctr_crypt()
255 nbytes -= nblocks * SM4_BLOCK_SIZE; in sm4_ctr_crypt()
259 if (walk.nbytes == walk.total && nbytes > 0) { in sm4_ctr_crypt()
264 crypto_xor_cpy(dst, src, keystream, nbytes); in sm4_ctr_crypt()
265 nbytes = 0; in sm4_ctr_crypt()
268 err = skcipher_walk_done(&walk, nbytes); in sm4_ctr_crypt()