added sk encryption

This commit is contained in:
Jean-Philippe Bossuat
2025-05-07 12:05:12 +02:00
parent 240884db8d
commit 6ce525e5a1
6 changed files with 333 additions and 299 deletions

View File

@@ -1,5 +1,5 @@
use base2k::{
AddNormal, Encoding, FFT64, FillUniform, Module, Scalar, ScalarAlloc, ScalarZnxDft, ScalarZnxDftAlloc, ScalarZnxDftOps,
AddNormal, Encoding, FFT64, FillUniform, Module, ScalarZnx, ScalarZnxAlloc, ScalarZnxDft, ScalarZnxDftAlloc, ScalarZnxDftOps,
ScratchOwned, VecZnx, VecZnxAlloc, VecZnxBig, VecZnxBigAlloc, VecZnxBigOps, VecZnxBigScratch, VecZnxDft, VecZnxDftAlloc,
VecZnxDftOps, VecZnxOps, ZnxInfos,
};
@@ -20,7 +20,7 @@ fn main() {
let mut source: Source = Source::new(seed);
// s <- Z_{-1, 0, 1}[X]/(X^{N}+1)
let mut s: Scalar<Vec<u8>> = module.new_scalar(1);
let mut s: ScalarZnx<Vec<u8>> = module.new_scalar(1);
s.fill_ternary_prob(0, 0.5, &mut source);
// Buffer to store s in the DFT domain