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

Add a new key switch method and support q>2N #135

Merged
merged 21 commits into from
Aug 19, 2024
Merged

Add a new key switch method and support q>2N #135

merged 21 commits into from
Aug 19, 2024

Conversation

serendipity-crypto
Copy link
Collaborator

  • fix FheField macro
  • fix default-features
  • fix modulus switch
  • add more parameters checking


let sk = secret_key_pack.lwe_secret_key();

let key: Vec<Vec<Vec<LWE<C>>>> = (0..len)
Copy link
Member

Choose a reason for hiding this comment

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

Can we parallelize this process?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Rng makes it unable to parallelize.

Comment on lines +14 to +15
/// - `Modulus Switch`: `q > 2N`, `2N|q`
/// - `Scale`:`q < 2N`, `q|2N`
Copy link
Member

Choose a reason for hiding this comment

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

I think these two cases are essentially the same. Scale is actually a modulus switch process.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, but their operations are a little different. I need to make them into two types.

Comment on lines 62 to 63
/// cryptographically secure random number generator
csrng: RefCell<Prg>,
Copy link
Member

@xiangxiecrypto xiangxiecrypto Aug 18, 2024

Choose a reason for hiding this comment

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

Maybe we should move this csrng out of SecretKeyPack, we could explicitly use rng as an input to a randomized function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, some optimization possibilities are limited to a certain extent. However, if you need to change it, another PR is better.

Copy link
Member

@xiangxiecrypto xiangxiecrypto left a comment

Choose a reason for hiding this comment

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

minor changes.

@xiangxiecrypto xiangxiecrypto merged commit eb8e633 into main Aug 19, 2024
8 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