-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsa_peks.h
More file actions
27 lines (19 loc) · 914 Bytes
/
sa_peks.h
File metadata and controls
27 lines (19 loc) · 914 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
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <pbc/pbc.h>
#include <openssl/sha.h>
#define STS_OK 0
#define STS_EQU 1
#define STS_ERR 2
#define GT_LEN 384
#define HASH_LEN 32
#define REPS 10 // Miller-Rabin testing round
static int hash_keyword(mpz_t hash, const char * w);
static int ks_derived(mpz_t ksw, mpz_t N, mpz_t e, mpz_t d, const char * w);
int fdh_rsa_setup(int N_bits, mpz_t N, mpz_t e, mpz_t d);
int sa_peks_setup(int ec_param, int N_bits, pairing_t pairing, element_t g, element_t pk, element_t sk, mpz_t N, mpz_t e, mpz_t d);
int sa_peks_encrypt(element_t Ca, unsigned char * Cb, pairing_t pairing, element_t g, element_t pk, mpz_t N, mpz_t e, mpz_t d, const char * w);
int sa_peks_trapdoor(element_t Tw, element_t sk, mpz_t N, mpz_t e, mpz_t d, const char * w);
int sa_peks_test(pairing_t pairing, element_t Tw, element_t A, const unsigned char * B);