-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzkp_no_small_factors.h
executable file
·48 lines (40 loc) · 1.52 KB
/
zkp_no_small_factors.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
46
47
48
/**
*
* Name:
* zkp_paillier_blum_modulus
*
* Description:
* Paillier Blum Modulus Zero Knowledge Proof for modulus of PAILLIER_MODULUS_BYTES byte length (hardcoded in verification).
*
* Usage:
* Constructor and destructor for zkp_<...>_t don't set any values and handles only proof fields.
* When using <...>_prove, all public and secret fields of zkp_<...>_t needs to be already populated (externally).
* Calling <...>_prove sets only the proof fields.
* When using <...>_verify, all public and proof fields of zkp_<...>_t need to be already populated.
* Calling <...>_verify return 0/1 (fail/pass).
*
*/
#ifndef __ASYMOFF_ZKP_NO_SMALL_FACTORS_H__
#define __ASYMOFF_ZKP_NO_SMALL_FACTORS_H__
#include "zkp_common.h"
#include "ring_pedersen_parameters.h"
typedef struct
{
scalar_t P;
scalar_t Q;
scalar_t A;
scalar_t B;
scalar_t T;
scalar_t z_1;
scalar_t z_2;
scalar_t w_1;
scalar_t w_2;
scalar_t v;
} zkp_no_small_factors_t;
zkp_no_small_factors_t *
zkp_no_small_factors_new ();
void zkp_no_small_factors_free (zkp_no_small_factors_t *proof);
void zkp_no_small_factors_prove (zkp_no_small_factors_t *proof, const paillier_private_key_t *paillier_priv, const ring_pedersen_public_t *rped_pub, const zkp_aux_info_t *aux);
int zkp_no_small_factors_verify (zkp_no_small_factors_t *proof, const paillier_public_key_t *paillier_pub, const ring_pedersen_public_t *rped_pub, const zkp_aux_info_t *aux);
uint64_t zkp_no_small_factors_proof_bytelen();
#endif