X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfc_skein.c;h=e05927da18385375aa61ea314737b65e9f2890be;hb=72672c5cb76597fdc07cbc9bc190394d1c1d3ee1;hp=fe86c20de71b1c595aa15e5e2d489223d1766d71;hpb=a7a8ae5408eed270854e69adf40ccaf3a401f830;p=tfcrypt.git diff --git a/tfc_skein.c b/tfc_skein.c index fe86c20..e05927d 100644 --- a/tfc_skein.c +++ b/tfc_skein.c @@ -39,16 +39,6 @@ void skein(void *hash, size_t bits, const void *key, const void *data, size_t sz skein_final(hash, &sk); } -void tf_key_tweak_compat(void *key) -{ - TF_UNIT_TYPE *ukey = key, c = THREEFISH_CONST; - size_t x; - - for (x = 0; x < TF_NR_BLOCK_UNITS; x++) c ^= ukey[x]; - ukey[x] = c; - ukey[TF_TWEAK_WORD3] = ukey[TF_TWEAK_WORD1] ^ ukey[TF_TWEAK_WORD2]; -} - tfc_yesno skeinfd(void *hash, size_t bits, const void *key, int fd, tfc_fsize offset, tfc_fsize readto) { static tfc_byte skblk[TFC_BLKSIZE]; @@ -68,7 +58,9 @@ tfc_yesno skeinfd(void *hash, size_t bits, const void *key, int fd, tfc_fsize of if (readto == NOFSIZE) goto _fail; } if (offset != 0 && offset != NOFSIZE) { - if (lseek(fd, (off_t)offset, SEEK_SET) == -1) goto _fail; + if (lseek(fd, (off_t)offset, SEEK_SET) == -1) { + if (ignore_seek_errors == NO) goto _fail; + } } } @@ -202,8 +194,7 @@ _dothat: while (1) { memset(sksblk, 0, sizeof(sksblk)); - x = xfgets(sksblk, sizeof(sksblk), f); - if (x == 0) break; + if (xfgets(sksblk, sizeof(sksblk), f) != YES) break; s = d = sksblk; t = NULL; shash = fname = NULL;