X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfcrypt.c;h=d673d386e7757cf739ffc35fbf35283476b39e3b;hb=f761a53231d1a023e2d3e5efcc5591b04a34f98a;hp=8ee577dbca6d5728614c4e79f9109042446e47c2;hpb=2c4332df1b3e6eb765ecb5206c864f163cf62258;p=tfcrypt.git diff --git a/tfcrypt.c b/tfcrypt.c index 8ee577d..d673d38 100644 --- a/tfcrypt.c +++ b/tfcrypt.c @@ -2,7 +2,7 @@ * tfcrypt -- high security Threefish encryption tool. * * tfcrypt is copyrighted: - * Copyright (C) 2012-2018 Andrey Rys. All rights reserved. + * Copyright (C) 2012-2019 Andrey Rys. All rights reserved. * * tfcrypt is licensed to you under the terms of std. MIT/X11 license: * @@ -149,6 +149,29 @@ _baddfname: counter_opt = TFC_CTR_RAND; else if (!strcasecmp(optarg, "zero")) counter_opt = TFC_CTR_ZERO; + else if (strchr(optarg, ':')) { + char *ss, chr; + + counter_opt = TFC_CTR_SSET; + n = sizeof(ctr); + + s = d = optarg; t = NULL; + while ((s = strtok_r(d, ",", &t))) { + if (d) d = NULL; + + if (n == 0) break; + ss = strchr(s, ':'); + if (!ss) continue; + *ss = 0; ss++; + chr = (char)strtoul(s, &stoi, 16); + if (!str_empty(stoi)) continue; + x = (size_t)strtoul(ss, &stoi, 10); + if (!str_empty(stoi)) continue; + if (x > n) x = n; + memset(ctr+(sizeof(ctr)-n), (int)chr, x); + n -= x; + } + } else counter_file = sksum_hashlist_file = optarg; break; case 'C': @@ -512,6 +535,7 @@ _baddfname: case 'q': quiet = YES; verbose = NO; + do_full_hexdump = NO; status_timer = 0; break; case 'v':