Lines Matching refs:mres

640     ctx->mres = 0;  in CRYPTO_gcm128_setiv()
777 unsigned int n, ctr, mres; in CRYPTO_gcm128_encrypt() local
788 mres = ctx->mres; in CRYPTO_gcm128_encrypt()
801 mres = sizeof(ctx->Xi); in CRYPTO_gcm128_encrypt()
817 n = mres % 16; in CRYPTO_gcm128_encrypt()
824 ctx->Xn[mres++] = *(out++) = *(in++) ^ ctx->EKi.c[n]; in CRYPTO_gcm128_encrypt()
829 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_encrypt()
830 mres = 0; in CRYPTO_gcm128_encrypt()
832 ctx->mres = mres; in CRYPTO_gcm128_encrypt()
843 mres = 0; in CRYPTO_gcm128_encrypt()
845 ctx->mres = n; in CRYPTO_gcm128_encrypt()
855 if (len >= 16 && mres) { in CRYPTO_gcm128_encrypt()
856 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_encrypt()
857 mres = 0; in CRYPTO_gcm128_encrypt()
948 ctx->Xn[mres++] = out[n] = in[n] ^ ctx->EKi.c[n]; in CRYPTO_gcm128_encrypt()
956 mres = n; in CRYPTO_gcm128_encrypt()
960 ctx->mres = mres; in CRYPTO_gcm128_encrypt()
979 ctx->Xn[mres++] = out[i] = in[i] ^ ctx->EKi.c[n]; in CRYPTO_gcm128_encrypt()
981 if (mres == sizeof(ctx->Xn)) { in CRYPTO_gcm128_encrypt()
983 mres = 0; in CRYPTO_gcm128_encrypt()
987 mres = n = (n + 1) % 16; in CRYPTO_gcm128_encrypt()
993 ctx->mres = mres; in CRYPTO_gcm128_encrypt()
1002 unsigned int n, ctr, mres; in CRYPTO_gcm128_decrypt() local
1013 mres = ctx->mres; in CRYPTO_gcm128_decrypt()
1026 mres = sizeof(ctx->Xi); in CRYPTO_gcm128_decrypt()
1042 n = mres % 16; in CRYPTO_gcm128_decrypt()
1049 *(out++) = (ctx->Xn[mres++] = *(in++)) ^ ctx->EKi.c[n]; in CRYPTO_gcm128_decrypt()
1054 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_decrypt()
1055 mres = 0; in CRYPTO_gcm128_decrypt()
1057 ctx->mres = mres; in CRYPTO_gcm128_decrypt()
1070 mres = 0; in CRYPTO_gcm128_decrypt()
1072 ctx->mres = n; in CRYPTO_gcm128_decrypt()
1082 if (len >= 16 && mres) { in CRYPTO_gcm128_decrypt()
1083 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_decrypt()
1084 mres = 0; in CRYPTO_gcm128_decrypt()
1176 out[n] = (ctx->Xn[mres++] = in[n]) ^ ctx->EKi.c[n]; in CRYPTO_gcm128_decrypt()
1186 mres = n; in CRYPTO_gcm128_decrypt()
1190 ctx->mres = mres; in CRYPTO_gcm128_decrypt()
1210 out[i] = (ctx->Xn[mres++] = c = in[i]) ^ ctx->EKi.c[n]; in CRYPTO_gcm128_decrypt()
1212 if (mres == sizeof(ctx->Xn)) { in CRYPTO_gcm128_decrypt()
1214 mres = 0; in CRYPTO_gcm128_decrypt()
1220 mres = n = (n + 1) % 16; in CRYPTO_gcm128_decrypt()
1226 ctx->mres = mres; in CRYPTO_gcm128_decrypt()
1238 unsigned int n, ctr, mres; in CRYPTO_gcm128_encrypt_ctr32()
1248 mres = ctx->mres; in CRYPTO_gcm128_encrypt_ctr32()
1261 mres = sizeof(ctx->Xi); in CRYPTO_gcm128_encrypt_ctr32()
1277 n = mres % 16; in CRYPTO_gcm128_encrypt_ctr32()
1281 ctx->Xn[mres++] = *(out++) = *(in++) ^ ctx->EKi.c[n]; in CRYPTO_gcm128_encrypt_ctr32()
1286 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_encrypt_ctr32()
1287 mres = 0; in CRYPTO_gcm128_encrypt_ctr32()
1289 ctx->mres = mres; in CRYPTO_gcm128_encrypt_ctr32()
1300 mres = 0; in CRYPTO_gcm128_encrypt_ctr32()
1302 ctx->mres = n; in CRYPTO_gcm128_encrypt_ctr32()
1308 if (len >= 16 && mres) { in CRYPTO_gcm128_encrypt_ctr32()
1309 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_encrypt_ctr32()
1310 mres = 0; in CRYPTO_gcm128_encrypt_ctr32()
1371 ctx->Xn[mres++] = out[n] = in[n] ^ ctx->EKi.c[n]; in CRYPTO_gcm128_encrypt_ctr32()
1373 ctx->Xi.c[mres++] ^= out[n] = in[n] ^ ctx->EKi.c[n]; in CRYPTO_gcm128_encrypt_ctr32()
1379 ctx->mres = mres; in CRYPTO_gcm128_encrypt_ctr32()
1392 unsigned int n, ctr, mres; in CRYPTO_gcm128_decrypt_ctr32()
1402 mres = ctx->mres; in CRYPTO_gcm128_decrypt_ctr32()
1415 mres = sizeof(ctx->Xi); in CRYPTO_gcm128_decrypt_ctr32()
1431 n = mres % 16; in CRYPTO_gcm128_decrypt_ctr32()
1435 *(out++) = (ctx->Xn[mres++] = *(in++)) ^ ctx->EKi.c[n]; in CRYPTO_gcm128_decrypt_ctr32()
1440 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_decrypt_ctr32()
1441 mres = 0; in CRYPTO_gcm128_decrypt_ctr32()
1443 ctx->mres = mres; in CRYPTO_gcm128_decrypt_ctr32()
1456 mres = 0; in CRYPTO_gcm128_decrypt_ctr32()
1458 ctx->mres = n; in CRYPTO_gcm128_decrypt_ctr32()
1464 if (len >= 16 && mres) { in CRYPTO_gcm128_decrypt_ctr32()
1465 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_decrypt_ctr32()
1466 mres = 0; in CRYPTO_gcm128_decrypt_ctr32()
1530 out[n] = (ctx->Xn[mres++] = in[n]) ^ ctx->EKi.c[n]; in CRYPTO_gcm128_decrypt_ctr32()
1533 ctx->Xi.c[mres++] ^= c; in CRYPTO_gcm128_decrypt_ctr32()
1540 ctx->mres = mres; in CRYPTO_gcm128_decrypt_ctr32()
1554 unsigned int mres = ctx->mres; in CRYPTO_gcm128_finish() local
1556 if (mres) { in CRYPTO_gcm128_finish()
1557 unsigned blocks = (mres + 15) & -16; in CRYPTO_gcm128_finish()
1559 memset(ctx->Xn + mres, 0, blocks - mres); in CRYPTO_gcm128_finish()
1560 mres = blocks; in CRYPTO_gcm128_finish()
1561 if (mres == sizeof(ctx->Xn)) { in CRYPTO_gcm128_finish()
1562 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_finish()
1563 mres = 0; in CRYPTO_gcm128_finish()
1569 if (ctx->mres || ctx->ares) in CRYPTO_gcm128_finish()
1591 memcpy(ctx->Xn + mres, &bitlen, sizeof(bitlen)); in CRYPTO_gcm128_finish()
1592 mres += sizeof(bitlen); in CRYPTO_gcm128_finish()
1593 GHASH(ctx, ctx->Xn, mres); in CRYPTO_gcm128_finish()