Skip to content

6 : libenoch Details

rosietastic edited this page May 9, 2021 · 1 revision

libenoch Summary

Dynamic library providing core OTP cryptography functions supporting encryption, decryption, generation and assessment.

A typedef "options_t" structure object is used as a library interface for applications:

typedef struct{

int verbose;

char devname[DEV_PATH_MAX];

char sizestr[SIZE_LEN];

char errmsg[ERR_MSG_MAXLEN];

unsigned long long int size;

int cmd_index;

int cmd_mode;

int pyx_binary;

int padout_pdotp;

FILE *input;

FILE *output;

FILE *otp;

FILE *encrypted;

int device;

char input_fsp[MAX_FSP_PATH];

char output_fsp[MAX_FSP_PATH];

char otp_fsp[MAX_FSP_PATH];

char encrypted_fsp[MAX_FSP_PATH];

} options_t;

External functions summarised

Selecting the RNG device by default

extern void set_default_device(options_t *options);

Generating an OTP

extern int g_generate(options_t *options);

Encrypting a file with an OTP/device

extern int e_encrypt(options_t *options);

Decrypting an encrypted file with an OTP

extern int d_decrypt(options_t *options);

Performing the Pyx Assessment

extern int p_pyx(options_t *options);

Getting libenoch version details

extern int enoch(char *version);

Internal Pyx Assessment functions summarised

static double poz (const double z)

double pochisq (const double ax, const int df)

static double pyx_log2(double x)

void pyx_init (int binmode)

void pyx_add (void *buf, int bufl)

void pyx_end (double *r_ent, double *r_chisq, double *r_mean, double *r_montepicalc, double *r_scc)

Clone this wiki locally