Initial commit
This commit is contained in:
11
inc/crypt_utils.h
Normal file
11
inc/crypt_utils.h
Normal 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
20
inc/key_utils.h
Normal 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
|
||||
Reference in New Issue
Block a user