"Fossies" - the Fresh Open Source Software Archive

Member "mikrolock-1.2.1/src/minilock.h" (2 Sep 2019, 1233 Bytes) of package /linux/privat/mikrolock-1.2.1.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "minilock.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.2_vs_1.2.1.

    1 #ifndef _MINILOCK_H
    2 #define _MINILOCK_H
    3 
    4 #define MIKROLOCK_VERSION "1.2.1"
    5 
    6 // for ftelloo: off_t
    7 #define _FILE_OFFSET_BITS 64
    8 
    9 #include "utils.h"
   10 
   11 enum error_code { 
   12   err_ok, err_failed, err_open, err_box,  
   13   err_file_open, err_file_read, err_file_write, 
   14   err_hash, err_format, err_no_rcpt, err_not_allowed, 
   15   err_file_empty, err_file_exists
   16 };
   17 typedef enum error_code error_code;
   18 
   19 struct rcpt_list {
   20   char id[50];
   21   struct rcpt_list* next;
   22 };
   23 
   24 error_code file_encode(FILE* output_file, uint8_t* b_file_nonce_prefix, uint8_t* b_file_key, uint8_t *c_input_file, struct output_options* out_opts);
   25 
   26 error_code file_decode(FILE* input_file, off_t crypt_start_pos, off_t eof_pos, uint8_t* b_file_nonce_prefix,
   27                 uint8_t* b_file_key, struct output_options* out_opts);
   28 
   29 error_code minilock_encode(uint8_t* c_filename, uint8_t* c_sender_id, uint8_t* b_my_sk, struct rcpt_list** id_list, struct output_options* out_opts);
   30 
   31 error_code minilock_decode(uint8_t* c_filename, uint8_t* b_my_sk, uint8_t* b_my_pk, struct output_options* out_opts);
   32 
   33 int rcpt_list_add(struct rcpt_list** list, char* new_id);
   34 
   35 void rcpt_list_free(struct rcpt_list** list);
   36 
   37 void rcpt_list_validate (struct rcpt_list** list, char* own_id);
   38 
   39 #endif