1
0
mirror of https://github.com/biergaizi/codecrypt synced 2024-06-27 09:18:16 +00:00

lib/ dir filled with stuff

This commit is contained in:
Mirek Kratochvil 2012-03-24 22:17:13 +01:00
parent 78400e4f6f
commit ce93665905
14 changed files with 48 additions and 7 deletions

@ -38,6 +38,9 @@ extern "C" {
/* parity check matrix */
ccr_mtx h;
/* TODO: also consider storing the squareroot-mod-poly mtx,
* although it's derivable from poly. */
};
struct ccr_nd_pubkey {
@ -62,6 +65,7 @@ extern "C" {
ccr_perm pinv;
};
/* actual functions */
int ccr_mce_gen (struct ccr_mce_pubkey*, struct ccr_mce_privkey*);
int ccr_mce_encrypt (struct ccr_mce_pubkey*, const char*, char*);
int ccr_mce_decrypt (struct ccr_mce_privkey*, const char*, char*);

0
lib/goppa.c Normal file

0
lib/goppa.h Normal file

@ -1,7 +0,0 @@
#include "codecrypt.h"
int libf()
{
return 4;
}

16
lib/log.c Normal file

@ -0,0 +1,16 @@
#include "codecrypt.h"
#include "log.h"
typedef void(*)(const char*) logfunc;
static logfunc global_log=NULL;
//TODO export
void ccr_set_log_func(logfunc x) {
global_log=x;
}
void ccr_log(const char*, ...) {
}

8
lib/log.h Normal file

@ -0,0 +1,8 @@
#ifndef _CCR_LOG_H_
#define _CCR_LOG_H_
void ccr_log(const char*, ...);
#endif

0
lib/math.c Normal file

11
lib/math.h Normal file

@ -0,0 +1,11 @@
#ifndef _CCR_MATH_H_
#define _CCR_MATH_H_
#include "codecrypt.h"
void ccr_mtx_add(int, int, const ccr_mtx, const ccr_mtx, ccr_mtx);
void ccr_mtx_multiply(int, int, int, const ccr_mtx, const ccr_mtx, ccr_mtx);
#endif

0
lib/mce.c Normal file

0
lib/nd.c Normal file

0
lib/prng.c Normal file

9
lib/prng.h Normal file

@ -0,0 +1,9 @@
#ifndef _CCR_PRNG_H_
#define _CCR_PRNG_H_
int ccr_prng_bit();
int ccr_prng_int(int);
#endif

0
lib/tools.c Normal file

0
lib/tools.h Normal file