int64 * encrypt(const char *chaine, int64 s, int64 n)
encrypt a message using modular exponentiation and a public RSA key (s,n).
Definition: rsa.c:162
Key * str_to_key(const char *str)
parses a string of the form " (v, n) " into a Key struct
Definition: rsa.c:94
Key * copy_key(const Key *o)
copies key
Definition: rsa.c:37
void init_key(Key *key, int64 val, int64 n)
initializes a key struct
Definition: rsa.c:22
char * decrypt(const int64 *crypted, int size, int64 u, int64 n)
decrypt a message using modular exponentiation and a RSA key (u,n).
Definition: rsa.c:188
char * key_to_str(const Key *key)
converts a Key to string of the form " (v, n) "
Definition: rsa.c:81
bool generate_key_values(int64 p, int64 q, int64 *n, int64 *s, int64 *u)
generates public and private RSA keys public = (s, n) ; private = (u, n)
Definition: rsa.c:123
void init_pair_keys(Key *pKey, Key *sKey, int low_size, int up_size)
initializes a key struct
Definition: rsa.c:55
int64 n
Definition: rsa.h:17
a file with comfy aliases for long type signatures
#define int64
alias for long long int
Definition: types.h:17