Created
June 6, 2017 13:07
-
-
Save fionser/08b5253f53a782023e01ad551d48aed2 to your computer and use it in GitHub Desktop.
Find good parameter for HElib.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "PAlgebra.h" | |
#include <NTL/ZZ.h> | |
#include <iostream> | |
const long MAX_PRIME_BIT = 20; | |
void search(long m) { | |
long p = 2; | |
do { | |
if ((m % p) != 0) { | |
PAlgebra zMStar(m, p); | |
/// Best | |
if (zMStar.numOfGens() == 1 && zMStar.SameOrd(0)) | |
std::cout << "Best " << m << " " << p << std::endl; | |
/// Somehow ok to use | |
else if (zMStar.numOfGens() <= 2) | |
std::cout << "Somehow ok " << m << " " << p << std::endl; | |
} | |
p = NTL::NextPrime(p + 1); | |
} while (NTL::NumBits(p) < MAX_PRIME_BIT); | |
} | |
int main() { | |
search(4096); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment