|
|
@@ -1,12 +1,13 @@
|
|
|
#include "Trapdoor.h"
|
|
|
+#include "DCRTPoly.h"
|
|
|
#include "openfhe/core/lattice/trapdoor.h"
|
|
|
+#include "openfhe/core/lattice/dgsampling.h"
|
|
|
|
|
|
namespace openfhe
|
|
|
{
|
|
|
|
|
|
std::unique_ptr<TrapdoorOutput> DCRTPolyTrapdoorGen(
|
|
|
const ILDCRTParams& params,
|
|
|
- double stddev,
|
|
|
int64_t base,
|
|
|
bool balanced)
|
|
|
{
|
|
|
@@ -15,7 +16,7 @@ std::unique_ptr<TrapdoorOutput> DCRTPolyTrapdoorGen(
|
|
|
|
|
|
auto result = lbcrypto::RLWETrapdoorUtility<lbcrypto::DCRTPoly>::TrapdoorGen(
|
|
|
params_ptr,
|
|
|
- stddev,
|
|
|
+ lbcrypto::SIGMA,
|
|
|
base,
|
|
|
balanced
|
|
|
);
|
|
|
@@ -26,4 +27,22 @@ std::unique_ptr<TrapdoorOutput> DCRTPolyTrapdoorGen(
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+void DCRTPolyGaussSamp(size_t n, size_t k, base)
|
|
|
+{
|
|
|
+ DCRTPolyImpl::DggType dgg(lbcrypto::SIGMA);
|
|
|
+
|
|
|
+ double c = (base + 1) * lbcrypto::SIGMA;
|
|
|
+ double s = lbcrypto::SPECTRAL_BOUND(n, k, base);
|
|
|
+ DCRTPolyImpl::DggType dggLargeSigma(sqrt(s * s - c * c));
|
|
|
+}
|
|
|
+
|
|
|
+// [x] n
|
|
|
+// [x] k
|
|
|
+// [ ] trapPair.first
|
|
|
+// [ ] trapPair.second
|
|
|
+// [ ] u
|
|
|
+// [x] dgg
|
|
|
+// [x] dggLargeSigma
|
|
|
+// [x] base
|
|
|
+
|
|
|
} // openfhe
|