Lines Matching refs:tweak
510 mbedtls_aes_init(&ctx->tweak);
520 mbedtls_aes_free(&ctx->tweak);
796 /* Set the tweak key. Always set tweak key for the encryption mode. */
797 ret = mbedtls_aes_setkey_enc(&ctx->tweak, key2, key2bits);
820 /* Set the tweak key. Always set tweak key for encryption. */
821 ret = mbedtls_aes_setkey_enc(&ctx->tweak, key2, key2bits);
1199 unsigned char tweak[16];
1217 /* Compute the tweak. */
1218 ret = mbedtls_aes_crypt_ecb(&ctx->tweak, MBEDTLS_AES_ENCRYPT,
1219 data_unit, tweak);
1227 * leftover bytes, so we need to use the next tweak for this block,
1228 * and this tweak for the leftover bytes. Save the current tweak for
1229 * the leftovers and then update the current tweak for use on this,
1231 memcpy(prev_tweak, tweak, sizeof(tweak));
1232 mbedtls_gf128mul_x_ble(tweak, tweak);
1235 mbedtls_xor(tmp, input, tweak, 16);
1242 mbedtls_xor(output, tmp, tweak, 16);
1244 /* Update the tweak for the next block. */
1245 mbedtls_gf128mul_x_ble(tweak, tweak);
1253 * use the previous tweak for these bytes (as saved in prev_tweak). */
1254 unsigned char *t = mode == MBEDTLS_AES_DECRYPT ? prev_tweak : tweak;