X-Git-Url: https://jxself.org/git/?a=blobdiff_plain;f=tfcrypt.h;h=19aa726ee022dda096fd8d6a76d2612232e50c75;hb=429747d78e7e60b3dc44fd8b23f1626c386663e0;hp=9b1caf05180f13a047154cf306e1882bff599913;hpb=efa545d64b910923248233618e774ca3b87efebb;p=tfcrypt.git diff --git a/tfcrypt.h b/tfcrypt.h index 9b1caf0..19aa726 100644 --- a/tfcrypt.h +++ b/tfcrypt.h @@ -38,6 +38,9 @@ #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif +#ifndef _FILE_OFFSET_BITS +#define _FILE_OFFSET_BITS 64 +#endif #ifndef _TFCRYPT_VERSION #error Version number may help you to identify missing functionality. @@ -72,18 +75,14 @@ typedef TF_BYTE_TYPE tfc_byte; typedef unsigned long long tfc_fsize; typedef unsigned long long tfc_useconds; -#ifndef TFC_NR_TURNS -#define TFC_NR_TURNS 262144 -#endif - -#ifndef TFC_CTR_MODE -#define TFC_CTR_MODE TFC_MODE_XTS -#endif - #ifndef TFC_BLKSIZE #define TFC_BLKSIZE 65536 #endif +#ifndef TFC_MAX_SALT +#define TFC_MAX_SALT (2048 + TF_KEY_SIZE) +#endif + #ifndef TFC_XTSBLOCKS #define TFC_XTSBLOCKS 32 #endif @@ -117,11 +116,14 @@ int xmhexdump(int to, const void *data, size_t szdata, int hgroup, int hexstr, i #define mhexdump(data, szdata, group, newline) xmhexdump(1, data, szdata, group, do_full_hexdump, newline) #define mehexdump(data, szdata, group, newline) xmhexdump(2, data, szdata, group, do_full_hexdump, newline) -extern char *progname; -extern int exitcode; extern size_t nr_turns; extern int ctr_mode; extern size_t macbits; +extern size_t tfc_saltsz; +extern tfc_byte tfc_salt[TFC_MAX_SALT]; + +extern char *progname; +extern int exitcode; extern tfc_byte key[TF_KEY_SIZE], ctr[TF_BLOCK_SIZE], xtskey[TF_KEY_SIZE], mackey[TF_FROM_BITS(TF_MAX_BITS)]; extern struct skein sk; extern struct tfe_stream tfe; @@ -133,6 +135,7 @@ extern tfc_fsize iseek_blocks, iseek, oseek, maxlen; extern tfc_fsize total_processed_src, total_processed_dst; extern tfc_fsize delta_processed; extern tfc_fsize genrandom_nr_bytes, genzero_nr_bytes; +extern tfc_fsize rdpos; extern int sfd, kfd, dfd; extern struct stat s_stat; extern size_t blksize, xtsblocks; @@ -148,12 +151,15 @@ extern tfc_yesno catch_all_errors, password, overwrite_source, do_fsync, do_pad, extern tfc_yesno do_preserve_time, do_stats_in_gibs, do_statline_dynamic, do_less_stats; extern tfc_yesno no_repeat, do_full_hexdump, verbose, statline_was_shown; extern char *srcfname, *dstfname, *do_mac_file, *counter_file, *sksum_hashlist_file; -extern char *genkeyf, *mackeyf, *tweakf; +extern char *saltf, *genkeyf, *mackeyf, *tweakf; extern char *pw_prompt, *mac_pw_prompt; extern tfc_useconds status_timer, bench_timer; extern tfc_useconds current_time, delta_time; extern struct getpasswd_state getps; +size_t xread(int fd, void *data, size_t szdata); +size_t xwrite(int fd, const void *data, size_t szdata); + void xerror(tfc_yesno noexit, tfc_yesno noerrno, tfc_yesno nostats, const char *fmt, ...); void xexit(int status); void usage(void); @@ -175,6 +181,7 @@ void xclose(int fd); const char *tfc_modename(int mode); void tfc_getcurtime(tfc_useconds *tx); tfc_fsize tfc_fdsize(int fd); +tfc_fsize tfc_fdgetpos(int fd); tfc_fsize tfc_fnamesize(char *fname, tfc_yesno noexit); tfc_fsize tfc_modifysize(tfc_fsize szmodify, const char *szspec); void fcopy_matime(int fd, const struct stat *st); @@ -199,7 +206,7 @@ void do_benchmark(tfc_useconds useconds, double dseconds); enum { NO, YES }; -enum { TFC_ERRACT_EXIT, TFC_ERRACT_CONT, TFC_ERRACT_SYNC }; +enum { TFC_ERRACT_EXIT, TFC_ERRACT_CONT, TFC_ERRACT_SYNC, TFC_ERRACT_LSYNC }; enum { TFC_STOP_BEGAN = 1, TFC_STOP_FULL }; enum { TFC_DO_PLAIN, TFC_DO_ENCRYPT, TFC_DO_DECRYPT }; enum { TFC_MAC_DROP = -1, TFC_MAC_SIGN = 1, TFC_MAC_VRFY, TFC_MAC_JUST_VRFY };