-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.c
More file actions
39 lines (25 loc) · 740 Bytes
/
test.c
File metadata and controls
39 lines (25 loc) · 740 Bytes
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
#include<stdio.h>
#include<strings.h>
#include"api.h"
main()
{
unsigned char sk[2048];
unsigned char pk[2048];
unsigned char m[32];
unsigned char sig[2048];
int sig_len;
memset(sk,0,sizeof(sk));
memset(pk,0,sizeof(pk));
int r = PQCLEAN_FALCON512_CLEAN_crypto_sign_keypair(pk,sk);
if(r==0){
printf("Key pair gen ok.\n");
}
r = PQCLEAN_FALCON512_CLEAN_crypto_sign_signature(sig,&sig_len,m,32,sk);
if(r==0){
printf("Signature is ok, the signature length is %d.\n",sig_len);
}
r = PQCLEAN_FALCON512_CLEAN_crypto_sign_verify(sig,sig_len,m,32,pk);
if(r==0){
printf("Signature verification is ok.\n");
}
}