memset(ln, 0, sizeof(ln));
fclose(f);
}
+
+void hash_defaults(char *uhash, size_t szuhash)
+{
+ struct skein sk;
+ char shash[56];
+ const char *mode;
+ tfc_byte hash[TF_FROM_BITS(256)];
+
+ skein_init(&sk, 256);
+
+ skein_update(&sk, tfc_salt, tfc_saltsz);
+
+ memset(shash, 0, sizeof(shash));
+ sprintf(shash, "%zu", nr_turns);
+ skein_update(&sk, shash, strlen(shash));
+
+ mode = tfc_modename(ctr_mode);
+ skein_update(&sk, mode, strlen(mode));
+
+ memset(shash, 0, sizeof(shash));
+ sprintf(shash, "%zu", macbits);
+ skein_update(&sk, shash, strlen(shash));
+
+ skein_update(&sk, do_full_key ? "1" : "0", 1);
+
+ skein_final(hash, &sk);
+ memset(shash, 0, sizeof(shash));
+ base64_encode(shash, (const char *)hash, sizeof(hash));
+ memset(hash, 0, sizeof(hash));
+
+ xstrlcpy(uhash, shash, szuhash);
+}
tfc_yesno is_embedded_prog = NO;
if (optopt == 'V') {
+ char shash[64];
tfc_say("tfcrypt toolkit, version %s.", _TFCRYPT_VERSION);
+ hash_defaults(shash, sizeof(shash));
+ tfc_say("Defaults hash: %s", shash);
+ memset(shash, 0, sizeof(shash));
xexit(0);
}
tfc_yesno skeinfd(void *hash, size_t bits, const void *key, int fd, tfc_fsize offset, tfc_fsize readto);
void read_defaults(const char *path, tfc_yesno noerr);
+void hash_defaults(char *uhash, size_t szuhash);
void gen_write_bytes(const char *foutname, tfc_fsize offset, tfc_fsize nrbytes);
void do_edbase64(char **fargv);
#ifndef _TFCRYPT_DEFAULTS_HEADER
#define _TFCRYPT_DEFAULTS_HEADER
+/* 5uouFzawL37Un6RtVqWbv0SOX48ew/xntAG5sNaOSlk= */
+
size_t nr_turns = 262144;
int ctr_mode = TFC_MODE_XTS;
size_t macbits = TF_MAX_BITS;