Replace ugly tweak size computation with explicit tweak clean API.
[tfcrypt.git] / tfc_error.c
index 7c001dacf0c52859b974e38e288733ff06e2cc06..53753674915966d88e635d8500fd723a23c9bd64 100644 (file)
@@ -69,6 +69,7 @@ void xexit(int status)
        memset(ctr, 0, sizeof(ctr));
        memset(mackey, 0, sizeof(mackey));
        memset(xtskey, 0, sizeof(xtskey));
+       memset(tweak, 0, sizeof(tweak));
        memset(&sk, 0, sizeof(struct skein));
        memset(&tfe, 0, sizeof(struct tfe_stream));
 
@@ -151,6 +152,10 @@ void usage(void)
        tfc_say("convert encrypted data into ASCII format to ease transmission.");
        tfc_say("\n");
        tfc_say("  -e, -d: encrypt, decrypt (it maybe required).");
+       tfc_say("  -L <file>: load tfcrypt defaults from file.");
+       tfc_say("    defaults is text file which defines salt, nr_turns and default mode.");
+       tfc_say("  -s <file>: load tfcrypt salt from file.");
+       tfc_say("  -s disable: disable key salting at all.");
        tfc_say("  -p: instead of using key, ask for password.");
        tfc_say("  -k: use raw (%u byte) key instead of deriving it from arbitrary data.", TFC_U(TF_KEY_SIZE));
        tfc_say("  -z: ask for key in plain C string form through password asker.");
@@ -167,6 +172,7 @@ void usage(void)
        tfc_say("    show: do default action, then dump CTR value to stderr,");
        tfc_say("    head: when decrypting, read CTR from beginning of stream,");
        tfc_say("    rand: generate random CTR and write it to beginning of stream,");
+       tfc_say("    zero: assume zero CTR is used, do not read from and write it to stream,");
        tfc_say("    <file>: read CTR from given file (both when encrypting/decrypting).");
        tfc_say("      default is to derive CTR from user provided password or keyfile with");
        tfc_say("      a single Skein function turn over derived, %u byte raw key", TFC_U(TF_KEY_SIZE));
@@ -210,12 +216,17 @@ void usage(void)
        tfc_say("    cont: print error if not quiet, then continue,");
        tfc_say("      no action to pad missing data is attempted.");
        tfc_say("      may be dangerous when working with block devices.");
-       tfc_say("    sync: print error if not quiet, then continue.");
+       tfc_say("    sync: print error if not quiet, then continue,");
        tfc_say("      pad missing data block with zeroes.");
-       tfc_say("      note that sync works only with read errors!");
+       tfc_say("    lsync: same as sync, but does not use SEEK_SET logic,");
+       tfc_say("      lsync uses only relative seek operations, and does not prequery");
+       tfc_say("      the current file position for exact offsets, which maybe unsafe.");
+       tfc_say("      For this reason, it is HIGHLY recommended to use sync instead!");
+       tfc_say("      Note that both sync and lsync work only with read errors!");
        tfc_say("  default error action is exit with printing status if not quiet.");
        tfc_say("  -E xall: turn on error actions above for all errors, not just EIO errors.");
-       tfc_say("    This must be a separate option given before usual -E how option.");
+       tfc_say("  -E xseek: ignore positioning and other seek related errors.");
+       tfc_say("    Multiple -E specifiers may be given in separate options.");
        tfc_say("  -O opts: set options (comma separated list):");
        tfc_say("    sync: request a synchronous I/O for a output,");
        tfc_say("    fsync: on each write() call a corresponding fsync(fd),");
@@ -246,6 +257,7 @@ void usage(void)
        tfc_say("    oseek=val: seek destination file/device by these val bytes.");
        tfc_say("    count=val: process only these val bytes, both input and output.");
        tfc_say("    xkey=val: take only val bytes from user keyfile.");
+       tfc_say("    okey=val: seek the key before reading it (usually a device).");
        tfc_say("    xctr=val: specify size in bytes of initial counter prepended or read.");
        tfc_say("  -P: plain IO mode: disable encryption/decryption code at all.");
        tfc_say("\n");