Lines Matching refs:nbytes
369 int nbytes = walk.nbytes; in gcm_encrypt() local
373 if (unlikely(nbytes > 0 && nbytes < AES_BLOCK_SIZE)) { in gcm_encrypt()
374 src = dst = memcpy(buf + sizeof(buf) - nbytes, in gcm_encrypt()
375 src, nbytes); in gcm_encrypt()
376 } else if (nbytes < walk.total) { in gcm_encrypt()
377 nbytes &= ~(AES_BLOCK_SIZE - 1); in gcm_encrypt()
382 pmull_gcm_encrypt(nbytes, dst, src, ctx->ghash_key.h, in gcm_encrypt()
387 if (unlikely(!nbytes)) in gcm_encrypt()
390 if (unlikely(nbytes > 0 && nbytes < AES_BLOCK_SIZE)) in gcm_encrypt()
392 buf + sizeof(buf) - nbytes, nbytes); in gcm_encrypt()
394 err = skcipher_walk_done(&walk, walk.nbytes - nbytes); in gcm_encrypt()
395 } while (walk.nbytes); in gcm_encrypt()
397 while (walk.nbytes >= AES_BLOCK_SIZE) { in gcm_encrypt()
398 int blocks = walk.nbytes / AES_BLOCK_SIZE; in gcm_encrypt()
416 walk.nbytes % AES_BLOCK_SIZE); in gcm_encrypt()
420 if (walk.nbytes) { in gcm_encrypt()
424 buf, walk.nbytes); in gcm_encrypt()
426 memcpy(buf, walk.dst.virt.addr, walk.nbytes); in gcm_encrypt()
427 memset(buf + walk.nbytes, 0, sizeof(buf) - walk.nbytes); in gcm_encrypt()
432 walk.nbytes ? buf : NULL); in gcm_encrypt()
434 if (walk.nbytes) in gcm_encrypt()
490 int nbytes = walk.nbytes; in gcm_decrypt() local
494 if (unlikely(nbytes > 0 && nbytes < AES_BLOCK_SIZE)) { in gcm_decrypt()
495 src = dst = memcpy(buf + sizeof(buf) - nbytes, in gcm_decrypt()
496 src, nbytes); in gcm_decrypt()
497 } else if (nbytes < walk.total) { in gcm_decrypt()
498 nbytes &= ~(AES_BLOCK_SIZE - 1); in gcm_decrypt()
503 ret = pmull_gcm_decrypt(nbytes, dst, src, in gcm_decrypt()
509 if (unlikely(!nbytes)) in gcm_decrypt()
512 if (unlikely(nbytes > 0 && nbytes < AES_BLOCK_SIZE)) in gcm_decrypt()
514 buf + sizeof(buf) - nbytes, nbytes); in gcm_decrypt()
516 err = skcipher_walk_done(&walk, walk.nbytes - nbytes); in gcm_decrypt()
517 } while (walk.nbytes); in gcm_decrypt()
524 while (walk.nbytes >= AES_BLOCK_SIZE) { in gcm_decrypt()
525 int blocks = walk.nbytes / AES_BLOCK_SIZE; in gcm_decrypt()
542 walk.nbytes % AES_BLOCK_SIZE); in gcm_decrypt()
546 if (walk.nbytes) { in gcm_decrypt()
547 memcpy(buf, walk.src.virt.addr, walk.nbytes); in gcm_decrypt()
548 memset(buf + walk.nbytes, 0, sizeof(buf) - walk.nbytes); in gcm_decrypt()
553 walk.nbytes ? buf : NULL); in gcm_decrypt()
555 if (walk.nbytes) { in gcm_decrypt()
559 buf, walk.nbytes); in gcm_decrypt()