30 lines
499 B
C
30 lines
499 B
C
#ifndef _RSA_H
|
|
#define _RSA_H 1
|
|
|
|
#include <math.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <time.h>
|
|
#include <sys/mman.h>
|
|
#include <fcntl.h>
|
|
|
|
// TODO remove bytes bits helper
|
|
#define RSA_SIZE 1024
|
|
#define RSA_SIZE_BYTES 1024 / 8
|
|
|
|
#define ERROR 0
|
|
#define WARNING 1
|
|
#define INFO 2
|
|
|
|
void ft_log(int level, char *s);
|
|
|
|
char *ft_itoa(int n);
|
|
|
|
void generate_keys(int *p, int *q, int *e);
|
|
int *random_bits(int n);
|
|
void generate_prime(int *p);
|
|
int *phi(int *p, int *q);
|
|
|
|
#endif
|