SchemeNTRU::not_gate implemented

This commit is contained in:
hilder.vitor
2022-03-11 12:45:36 +01:00
parent 60c01e16d8
commit de62bcd412
2 changed files with 11 additions and 0 deletions

View File

@ -173,6 +173,13 @@ class SchemeNTRU
*/
void xor_gate(Ctxt_NTRU& ct_res, const Ctxt_NTRU& ct1, const Ctxt_NTRU& ct2) const;
/**
* Computes the NOT gate of a given ciphertext ct
* @param[out] ct_res encryption of the outuput of the NOT gate
* @param[in] ct encryption of the input bit
*/
void not_gate(Ctxt_NTRU& ct_res, const Ctxt_NTRU& ct) const;
};
#endif

View File

@ -296,4 +296,8 @@ void SchemeNTRU::xor_gate(Ctxt_NTRU& ct_res, const Ctxt_NTRU& ct1, const Ctxt_NT
bootstrap(ct_res);
}
void SchemeNTRU::not_gate(Ctxt_NTRU& ct_res, const Ctxt_NTRU& ct) const
{
nand_gate(ct_res, ct, ct);
}