Cryptographic implementation

I want to implement an algorithm where I set all the cryptographic parameters from scratch. Can you give one complete example for this?! Or share the link of the example if you have already uploaded somewhere?

Hello @divyesh

If you want to do that with core crypto you are already free to do so.

Fort shortint/integer/High Level API you can just fill your own custom ClassicPBSParameters structure and use that. For the High Level API you will have to call ConfigBuilder in tfhe - Rust with that custom parameter set.

Do note that determining one’s own parameters (for any application and API layer) is a very hard task and you need to make sure the parameters are secure (using e.g. the lattice estimator to evaluate LWE security GitHub - malb/lattice-estimator: An attempt at a new LWE estimator) and have a very low failure probability ), our default parameters starting in 0.7 have 2^-64 failure probability or better and a 132 bits of security. If you are not a cryptographer you most likely should not be doing that.

We don’t have a guide to share to select parameters and ensure security but a paper was a published by our team a while ago : https://eprint.iacr.org/2022/704.pdf

Cheers

Thanks, can you provide one example code if possible?

To do what @divyesh ?

Say I have lwe_dimensiom as 512, coeff modulus as 1<<20, for 128 bit security N =10260 how should I generate keys and ciphertext?

That’s what I was saying, there is more to it and it’s very hard to do, the paper I linked discusses the parameter optimization.

We don’t have tutorials for that and it’s the reason we provide ready to use parameter sets