Skip to content

Commit

Permalink
added clearing of CKKS encoding after decryption (#859)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
  • Loading branch information
yspolyakov and Yuriy Polyakov authored Sep 9, 2024
1 parent ac00c37 commit 681553d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/pke/lib/encoding/ckkspackedencoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,9 @@ bool CKKSPackedEncoding::Decode(size_t noiseScaleDeg, double scalingFactor, Scal

curValues[i] = cur;
}

// clears the values containing information about the noise
GetElement<NativePoly>().SetValuesToZero();
}
else {
powP = pow(2, -p);
Expand Down Expand Up @@ -486,6 +489,9 @@ bool CKKSPackedEncoding::Decode(size_t noiseScaleDeg, double scalingFactor, Scal

curValues[i] = cur;
}

// clears the values containing information about the noise
GetElement<Poly>().SetValuesToZero();
}

// the code below adds a Gaussian noise to the decrypted result
Expand Down

0 comments on commit 681553d

Please sign in to comment.