Initial commit

This commit is contained in:
2024-04-06 14:13:39 +02:00
commit bbca46bf0b
12 changed files with 3375 additions and 0 deletions

11
inc/crypt_utils.h Normal file
View File

@@ -0,0 +1,11 @@
#ifndef CRYPT_UTILS_H
#define CRYPT_UTILS_H
#include "../lib/big.h"
#include "key_utils.h"
void big_pow_mod(big_n a, big_n b, big_n n, big_n result);
void encrypt(public_key pub_key, big_n input, big_n output);
void decrypt(private_key priv_key, big_n input, big_n output);
#endif

20
inc/key_utils.h Normal file
View File

@@ -0,0 +1,20 @@
#ifndef KEY_UTILS_H
#define KEY_UTILS_H
#include "../lib/big.h"
typedef struct {
big_n n;
big_n e;
big_n d;
} private_key;
typedef struct {
big_n n;
big_n e;
} public_key;
private_key private_key_read(const char *file);
public_key public_key_read(const char *file);
#endif