2
$\begingroup$

Reading many papers in the Homomorphic Encryption domain and in Cryptography, a lot of schemes operate on bits as 1 and 0.

If I wanted to implement a scheme, for example Gentry's FHE, would I have to encode inputs as "bits" or just use bytes (C & C++ (char), Golang(byte), etc) ?

$\endgroup$
  • $\begingroup$ Using natural numbers should probably also be an option for FHE. Implementations are generally using bytes or words; when encoding a number you can always leave the most significant bits set to zero. Not answering, there are better experts on FHE on this site. $\endgroup$ – Maarten Bodewes Jun 27 '18 at 13:07
2
$\begingroup$

That issue is not really relevant when one implements such schemes, because the plaintexts are typically used only in the encryption, where they are combined with big values that need to be encoded as big integers anyway.

All the homomorphic operations should not depend on the plaintext, so, the chosen encoding is irrelevant here.

And even if the decryption outputs a single bit, all the operations done in the decryption function are performed also over big integers.

As an example, the scheme implemented by Leo Ducas uses a regular C integer to encode input bits, as you can see in lines 29 and 30 of file LWE.h from his Github repository.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.