Lines Matching refs:chunk
338 size_t chunk; in padlock_cfb_cipher() local
340 if ((chunk = EVP_CIPHER_CTX_get_num(ctx))) { /* borrow chunk variable */ in padlock_cfb_cipher()
343 if (chunk >= AES_BLOCK_SIZE) in padlock_cfb_cipher()
347 while (chunk < AES_BLOCK_SIZE && nbytes != 0) { in padlock_cfb_cipher()
348 ivp[chunk] = *(out_arg++) = *(in_arg++) ^ ivp[chunk]; in padlock_cfb_cipher()
349 chunk++, nbytes--; in padlock_cfb_cipher()
351 while (chunk < AES_BLOCK_SIZE && nbytes != 0) { in padlock_cfb_cipher()
353 *(out_arg++) = c ^ ivp[chunk]; in padlock_cfb_cipher()
354 ivp[chunk++] = c, nbytes--; in padlock_cfb_cipher()
357 EVP_CIPHER_CTX_set_num(ctx, chunk % AES_BLOCK_SIZE); in padlock_cfb_cipher()
365 if ((chunk = nbytes & ~(AES_BLOCK_SIZE - 1))) { in padlock_cfb_cipher()
366 if (!padlock_cfb_encrypt(out_arg, in_arg, cdata, chunk)) in padlock_cfb_cipher()
368 nbytes -= chunk; in padlock_cfb_cipher()
374 out_arg += chunk; in padlock_cfb_cipher()
375 in_arg += chunk; in padlock_cfb_cipher()
409 size_t chunk; in padlock_ofb_cipher() local
414 if ((chunk = EVP_CIPHER_CTX_get_num(ctx))) { /* borrow chunk variable */ in padlock_ofb_cipher()
417 if (chunk >= AES_BLOCK_SIZE) in padlock_ofb_cipher()
420 while (chunk < AES_BLOCK_SIZE && nbytes != 0) { in padlock_ofb_cipher()
421 *(out_arg++) = *(in_arg++) ^ ivp[chunk]; in padlock_ofb_cipher()
422 chunk++, nbytes--; in padlock_ofb_cipher()
425 EVP_CIPHER_CTX_set_num(ctx, chunk % AES_BLOCK_SIZE); in padlock_ofb_cipher()
433 if ((chunk = nbytes & ~(AES_BLOCK_SIZE - 1))) { in padlock_ofb_cipher()
434 if (!padlock_ofb_encrypt(out_arg, in_arg, cdata, chunk)) in padlock_ofb_cipher()
436 nbytes -= chunk; in padlock_ofb_cipher()
442 out_arg += chunk; in padlock_ofb_cipher()
443 in_arg += chunk; in padlock_ofb_cipher()