Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decrypt statements #348

Merged
merged 29 commits into from
Feb 20, 2024
Merged

Decrypt statements #348

merged 29 commits into from
Feb 20, 2024

Conversation

samtay
Copy link
Contributor

@samtay samtay commented Feb 15, 2024

Support "decryption statements", i.e. statements about ciphertexts that aren't fresh encryptions. These have the same format as symmetric statements in logproof, but the bounds are much more lax as errors can go up to $\Delta/2$ rather than being a fresh noise polynomial.

Add these as a separate variant from private key encryptions, since they
are created and bounded differently. Since we bound the error term by
half the ciphertext modulus, this commit also changes the bounds to be
specified by number of bits.
For polynomials with zero coefficients exceeding degree bound
Taking Self was weird. Call sites don't need to be updated as
calling associated `Log2::method(x)` is still valid, just a weird thing
to enforce.
This would previously give very large norms values for small negative values close to the negative cutoff
Silly mistake but easy to miss: we were storing the message to repeat as a _freshly encoded_ plaintext. The values match, but not the underlying messages! Fix to use the actual plaintext coming out of the decryption, which is not a fresh encoding.
As implemented, this would have almost never been used correctly. The
user would have had to ensure that the existing plaintext message had
the same plaintext polynomial encoding as the provided ciphertext. This
would generally only be true if both were fresh encryptions, in which
case this method is not even necessary.
But keep the AS=T debug assertion
Also use u32 over u64, as std::lib does for various "bit length" operations like Shl, log2, et.
@samtay samtay force-pushed the samtay/hack-decrypt-statements branch from e306358 to fd70d9b Compare February 20, 2024 19:02
@samtay samtay marked this pull request as ready for review February 20, 2024 20:28
examples/private_tx_linkedproof/src/main.rs Outdated Show resolved Hide resolved
logproof/src/bfv_statement.rs Outdated Show resolved Hide resolved
logproof/src/math.rs Show resolved Hide resolved
And fail fast if calculating the modulus overflows
@samtay samtay enabled auto-merge (squash) February 20, 2024 22:47
@samtay samtay merged commit cb20e8d into main Feb 20, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants