summaryrefslogtreecommitdiff
path: root/set5/task36.c
blob: 5fc05af926063a0459c412ad884432a07aa7d448 (plain)
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
#include "../lib/lib.h"
#include "../lib/lib2.h"
#include "../lib/lib3.h"
#include "../lib/lib4.h"
#include "../lib/lib5.h"
#include <time.h>

int main()
{
	struct srp_context srpc;	
	char *email = "test@example.com";
	char *password = "123456";
	char sK[41];
	char cK[41];
	out = BIO_new(BIO_s_file());
	BIO_set_fp(out, stdout, BIO_NOCLOSE);

	ctx = BN_CTX_new();
	
	srp_context_init(&srpc);
	srp_server_init(email, password, &srpc);
	srp_client_send1(email, &srpc);
	srp_server_send1(&srpc);
	srp_compute_uH(&srpc);
	srp_client_prepare_k(&srpc, password);
	srp_server_prepare_k(&srpc);
	hex_binary_to_string(srpc.client_K, cK, 20);
	hex_binary_to_string(srpc.server_K, sK, 20);
	printf("cK: %s\n", cK);
	printf("sK: %s\n", sK);
}