-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.c
47 lines (37 loc) · 1.04 KB
/
main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/************************************
* *
* License: GNU GPL *
* Date : 01-02-2019 *
* Author : Piotr Wawryka *
* Email : piotrwpwsz@gmail.com *
* *
************************************/
#include "header.h"
#include "file.c" // order of include matters
#include "rsa.c"
#include "dialog.c"
#ifdef COLOR_CONSOLE
#include "colors.c"
#endif // COLOR_CONSOLE
extern char bufor[];
extern num n;
// ----------------------------------------------------------------------------
int main( int argc, char * argv[] ) {
rsa_util rsa = { 0 };
string msg = calloc(BUFSIZ, sizeof(*msg));
int len = 0;
num *encrypted;
if ( argc > 1 ) // jesli podano argumenty do programu
{
decrypt(argv[1], &rsa, &len, encrypted);
}
else
{
encrypt(msg, &rsa, &len, encrypted);
}
free(encrypted);
free(msg);
puts("\n");
system("pause");
return 0;
}