X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfcrypt.c;h=4724c0fab024cf88ab10fa8492dfce05c0cbeb76;hb=e0d3bb48cd0cd079f9d1bd5555a52f450db452ac;hp=363e3c4825c8735dcae93c7e10cf338fbcb49056;hpb=630fb7d8dc740715cdc52114d736d64bf14f0798;p=tfcrypt.git diff --git a/tfcrypt.c b/tfcrypt.c index 363e3c4..4724c0f 100644 --- a/tfcrypt.c +++ b/tfcrypt.c @@ -903,11 +903,12 @@ _xts2genkey: if (xwrite(krfd, pblk, TF_FROM_BITS(TFC_KEY_BITS)) == NOSIZE) xerro if (!tweakf) skein(key+TF_FROM_BITS(TF_MAX_BITS)+TF_SIZE_UNIT, 2*TF_UNIT_BITS, NULL, key, TF_FROM_BITS(TFC_KEY_BITS)); tf_key_tweak_compat(key); } - if (ctr_mode == TFC_MODE_STREAM) tfe_init_iv(&tfe, key, ctr); if (ctr_mode == TFC_MODE_ECB) goto _ctrskip2; tfc_data_to_words64(&iseek_blocks, sizeof(iseek_blocks)); tf_ctr_set(ctr, &iseek_blocks, sizeof(iseek_blocks)); + if (ctr_mode == TFC_MODE_STREAM) tfe_init_iv(&tfe, key, ctr); + switch (counter_opt) { case TFC_CTR_SHOW: switch (do_outfmt) {