-
Notifications
You must be signed in to change notification settings - Fork 8
/
srp_simple.h
45 lines (22 loc) · 934 Bytes
/
srp_simple.h
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
#ifndef _simple_h
#define _simple_h
#include <t_pwd.h>
#include <srp.h>
#include <assert.h>
#define PREPARAM_1024 4
#define PREPARAM_2048 8
#define PREPARAM_4096 10
void ssrp_setup(int pindex, cstr **out_mod, cstr **out_gen);
SRP *ssrp_server_new();
cstr *ssrp_server_start(SRP *srps, cstr *modulus, cstr *generator,
cstr *salt, cstr *auth, const char * user);
cstr *ssrp_server_verify(SRP *srps, cstr *client_pub, cstr *client_proof);
SRP *ssrp_client_new();
cstr *ssrp_client_start(SRP *srpc, cstr *modulus, cstr *generator, cstr *salt, const char *user);
cstr *ssrp_client_respond(SRP *srpc, cstr *server_pub, const char *pass);
int ssrp_client_verify(SRP *srpc, cstr *server_proof);
int ssrp_client_auth(SRP *srpc, const char *pass, int len);
int ssrp_make_pass(const char *username, const char *password, struct t_num *salt,
cstr **out_pass, cstr **out_salt);
void ssrp_terminate();
#endif