mirror of
https://github.com/mii443/FINAL.git
synced 2025-08-22 23:15:28 +00:00
Removed some blank lines
This commit is contained in:
@ -152,7 +152,6 @@ class SchemeLWE
|
|||||||
*/
|
*/
|
||||||
void xor_gate(Ctxt_LWE& ct_res, const Ctxt_LWE& ct1, const Ctxt_LWE& ct2) const;
|
void xor_gate(Ctxt_LWE& ct_res, const Ctxt_LWE& ct1, const Ctxt_LWE& ct2) const;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Computes the NOT gate of a given ciphertext ct
|
* Computes the NOT gate of a given ciphertext ct
|
||||||
* @param[out] ct_res encryption of the outuput of the NOT gate
|
* @param[out] ct_res encryption of the outuput of the NOT gate
|
||||||
@ -161,8 +160,4 @@ class SchemeLWE
|
|||||||
void not_gate(Ctxt_LWE& ct_res, const Ctxt_LWE& ct) const;
|
void not_gate(Ctxt_LWE& ct_res, const Ctxt_LWE& ct) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
16
test.cpp
16
test.cpp
@ -353,18 +353,14 @@ void test_ntruhe_nand(SchemeNTRU& s)
|
|||||||
void test_ntruhe_and(SchemeNTRU& s)
|
void test_ntruhe_and(SchemeNTRU& s)
|
||||||
{
|
{
|
||||||
GateType g = AND;
|
GateType g = AND;
|
||||||
|
|
||||||
test_ntru_gate(s, g);
|
test_ntru_gate(s, g);
|
||||||
|
|
||||||
cout << "AND IS OK" << endl;
|
cout << "AND IS OK" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_ntruhe_or(SchemeNTRU& s)
|
void test_ntruhe_or(SchemeNTRU& s)
|
||||||
{
|
{
|
||||||
GateType g = OR;
|
GateType g = OR;
|
||||||
|
|
||||||
test_ntru_gate(s, g);
|
test_ntru_gate(s, g);
|
||||||
|
|
||||||
cout << "OR IS OK" << endl;
|
cout << "OR IS OK" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -378,12 +374,10 @@ void test_ntruhe_xor(SchemeNTRU& s)
|
|||||||
void test_ntruhe_not(SchemeNTRU& s)
|
void test_ntruhe_not(SchemeNTRU& s)
|
||||||
{
|
{
|
||||||
GateType g = NOT;
|
GateType g = NOT;
|
||||||
|
|
||||||
for(int i = 0; i < 5; i++){
|
for(int i = 0; i < 5; i++){
|
||||||
int bit = binary_sampler(rand_engine);
|
int bit = binary_sampler(rand_engine);
|
||||||
test_ntruhe_gate_helper(bit, 0, s, g);
|
test_ntruhe_gate_helper(bit, 0, s, g);
|
||||||
}
|
}
|
||||||
|
|
||||||
cout << "NOT GATE IS OK" << endl;
|
cout << "NOT GATE IS OK" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -460,9 +454,6 @@ void test_ntruhe_composition_of_gates(SchemeNTRU& s)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// ----- LWE tests
|
// ----- LWE tests
|
||||||
|
|
||||||
void test_lwehe_gate_helper(int in1, int in2, SchemeLWE& s, GateType g)
|
void test_lwehe_gate_helper(int in1, int in2, SchemeLWE& s, GateType g)
|
||||||
@ -543,27 +534,21 @@ void test_lwe_gate(SchemeLWE& s, GateType g)
|
|||||||
void test_lwehe_nand(SchemeLWE& s)
|
void test_lwehe_nand(SchemeLWE& s)
|
||||||
{
|
{
|
||||||
GateType g = NAND;
|
GateType g = NAND;
|
||||||
|
|
||||||
test_lwe_gate(s, g);
|
test_lwe_gate(s, g);
|
||||||
|
|
||||||
cout << "NAND IS OK" << endl;
|
cout << "NAND IS OK" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_lwehe_and(SchemeLWE& s)
|
void test_lwehe_and(SchemeLWE& s)
|
||||||
{
|
{
|
||||||
GateType g = AND;
|
GateType g = AND;
|
||||||
|
|
||||||
test_lwe_gate(s, g);
|
test_lwe_gate(s, g);
|
||||||
|
|
||||||
cout << "AND IS OK" << endl;
|
cout << "AND IS OK" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_lwehe_or(SchemeLWE& s)
|
void test_lwehe_or(SchemeLWE& s)
|
||||||
{
|
{
|
||||||
GateType g = OR;
|
GateType g = OR;
|
||||||
|
|
||||||
test_lwe_gate(s, g);
|
test_lwe_gate(s, g);
|
||||||
|
|
||||||
cout << "OR IS OK" << endl;
|
cout << "OR IS OK" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -577,7 +562,6 @@ void test_lwehe_xor(SchemeLWE& s)
|
|||||||
void test_lwehe_not(SchemeLWE& s)
|
void test_lwehe_not(SchemeLWE& s)
|
||||||
{
|
{
|
||||||
GateType g = NOT;
|
GateType g = NOT;
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++){
|
for(int i = 0; i < 4; i++){
|
||||||
int bit = binary_sampler(rand_engine);
|
int bit = binary_sampler(rand_engine);
|
||||||
test_lwehe_gate_helper(bit, 0, s, g);
|
test_lwehe_gate_helper(bit, 0, s, g);
|
||||||
|
Reference in New Issue
Block a user