28 #ifndef TRONCONNEUSE_HPP 29 #define TRONCONNEUSE_HPP 31 #include "../my_config.h" 119 void inherited_read_ahead(
const infinint & amount);
122 U_I inherited_read(
char *a, U_I size);
127 void inherited_write(
const char *a, U_I size);
130 void inherited_sync_write() { flush(); };
133 void inherited_flush_read() { buf_byte_data = 0; };
136 void inherited_terminate() {};
169 const char *clear_buf,
const U_32 clear_size,
const U_32 clear_allocated,
170 char *crypt_buf, U_32 crypt_size) = 0;
181 const char *crypt_buf,
const U_32 crypt_size,
182 char *clear_buf, U_32 clear_size) = 0;
185 const archive_version & get_reading_version()
const {
return reading_ver; };
196 U_32 clear_block_size;
201 U_32 encrypted_buf_size;
202 U_32 encrypted_buf_data;
230 void position_clear2crypt(
const infinint & pos,
240 bool check_current_position() {
return fill_buf() < buf_byte_data; };
246 void remove_trailing_clear_data_from_encrypted_buf(
const infinint & crypt_offset);
bool skip_relative(S_I x)
inherited from generic_file
bool skip_to_eof()
inherited from generic_file
virtual ~tronconneuse()
destructor
void set_initial_shift(const infinint &x)
this method to modify the initial shift. This overrides the constructor "no_initial_shift" of the con...
void set_callback_trailing_clear_data(infinint(*call_back)(generic_file &below, const archive_version &reading_ver))
this is a partial implementation of the generic_file interface to cypher/decypher data block by block...
virtual U_32 encrypt_data(const infinint &block_num, const char *clear_buf, const U_32 clear_size, const U_32 clear_allocated, char *crypt_buf, U_32 crypt_size)=0
this method encrypts the clear data given
class generic_file is defined here as well as class fichierthe generic_file interface is widely used ...
U_32 get_clear_block_size() const
returns the block size give to constructor
const tronconneuse & operator=(const tronconneuse &ref)
assignment operator
bool skip(const infinint &pos)
inherited from generic_file
void write_end_of_file()
in write_only mode indicate that end of file is reached
virtual U_32 clear_block_allocated_size_for(U_32 clear_block_size)=0
it may be necessary by the inherited class have few more bytes allocated after the clear data given f...
virtual U_32 encrypted_block_size_for(U_32 clear_block_size)=0
defines the size necessary to encrypt a given amount of clear data
virtual U_32 decrypt_data(const infinint &block_num, const char *crypt_buf, const U_32 crypt_size, char *clear_buf, U_32 clear_size)=0
this method decyphers data
bool is_terminated() const
tronconneuse(U_32 block_size, generic_file &encrypted_side, bool no_initial_shift, const archive_version &reading_ver)
This is the constructor.
switch module to limitint (32 ou 64 bits integers) or infinint
this is the interface class from which all other data transfer classes inherit
class archive_version that rules which archive format to follow
the arbitrary large positive integer class
tronconneuse(const tronconneuse &ref)
copy constructor
libdar namespace encapsulate all libdar symbols
infinint get_position() const
inherited from generic_file
bool skippable(skippability direction, const infinint &amount)
inherited from generic_file