src_coreop.txt

Core operations (coreop.c, coreop.h)
[NOTE: this file is not a Diff file!]

Task: providing functionality specific to XOR-FD.

>>> coreop.c

--- char * encrypt_static(char *data, size_t length)
	* used to encrypt `data' when key is from Standard Input stream (stdin)
	* it uses global variables `_global_padding_' and `_global_padding_length_'
	* it loops the key data if needed
	* function will return NULL if `data' points to NULL

--- char * encrypt_normal(char *data, const char *padding, size_t length)
	* used to encrypt `data' when key if from dedicated key file
	* because it XOR's `data' together with `padding', their `length' must be the same
	* function will return NULL if `data' and/or `padding' point to NULL

--- int compute_case1(const char *argument1)
	* manages usage case 1, Standard Input stream (stdin) data as key, `argument1' is filename of file to be read and overwritten (no auxiliary file is used)
	* returns EXIT_SUCCESS or EXIT_FAILURE

--- int compute_case2(const char *argument1, const char *argument2)
	* manages usage case 2, stdin data as key, `argument1' is input file name, `argument2' is output file name
	* returns EXIT_SUCCESS or EXIT_FAILURE

--- int compute_case3(const char *argument1, const char *argument2, const char *argument3)
	* manages usage case 3, `argument1' is input file name, `argument2' is output file name, `argument3' is key file name
	* returns EXIT_SUCCESS or EXIT_FAILURE

NOTE:
- the three "compute" functions above used to be one in earlier versions up until Version 2 Beta 1
- I'm still unsure whether I did the right thing by splitting it up

>>> coreop.h

--- n/a
