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

Fix: comparison less or equal then #1775

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Tuditi
Copy link

@Tuditi Tuditi commented Nov 13, 2024

PR content/description

There was an equality sign missing in the scalar comparisons.

Check-list:

  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • Relevant issues are marked as resolved/closed, related issues are linked in the description
  • Check for breaking changes (including serialization changes) and add them to commit message following the conventional commit specification

Copy link

cla-bot bot commented Nov 13, 2024

Thank you for your pull request. We require contributors to sign our Contributor License Agreement / Terms and Conditions, and we don't seem to have the users @Tuditi on file. In order for us to review and merge your code, please sign:

  • For individual contribution: our CLA
  • for Bounty submission, if you are an individual: our T&C
  • for Bounty submission, if you are a company: our T&C
    to get yourself added.

If you already signed one of this document, just wait to be added to the bot config.

@aquint-zama
Copy link
Contributor

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Nov 13, 2024
Copy link

cla-bot bot commented Nov 13, 2024

The cla-bot has been summoned, and re-checked this pull request!

Copy link

cla-bot bot commented Nov 13, 2024

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Tuditi.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@cla-bot cla-bot bot removed the cla-signed label Nov 13, 2024
@zama-ai zama-ai deleted a comment from sonarcloud bot Nov 13, 2024
let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix);

let scalar = 0 as u64;
let ct: BaseRadixCiphertext<Ciphertext> = sks.create_trivial_radix(scalar, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use ct: RadixCiphetext instead

@@ -398,6 +398,38 @@ fn integer_unchecked_scalar_comparisons_edge(param: ClassicPBSParameters) {
}
}

// Tests whether equality holds for greater/less or equal than, but fails for greater/lesser than.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is no longer really valid

fn integer_comparisons_for_empty_blocks(param: ClassicPBSParameters) {
let (cks, sks) = KEY_CACHE.get_from_params(param, IntegerKeyKind::Radix);

let scalar = 0 as u64;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scalar should be picked at random, and in the assert compare the decrypted value with the clear comparison result e.g. scalar < 0

Comment on lines +772 to +774
create_parametrized_test!(integer_comparisons_for_empty_blocks {
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
create_parametrized_test!(integer_comparisons_for_empty_blocks {
PARAM_MESSAGE_2_CARRY_2_KS_PBS_TUNIFORM_2M64,
});
create_parametrized_test!(integer_comparisons_for_empty_blocks)

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.

3 participants