Skip to content

Enabling ring.Poly argument to bgv.Encoder.Encode#572

Open
ChristianMct wants to merge 2 commits intotuneinsight:mainfrom
ChristianMct:dev_bgv_poly_encode
Open

Enabling ring.Poly argument to bgv.Encoder.Encode#572
ChristianMct wants to merge 2 commits intotuneinsight:mainfrom
ChristianMct:dev_bgv_poly_encode

Conversation

@ChristianMct
Copy link
Copy Markdown
Collaborator

I stumbled over these two limitations with the current BGV encoder:

  1. It fails silently on unsupported input types when the flag pt.IsBatched=false.
  2. It only allows for IntegerSlice parameters, while it could be useful to many applications to encrypt ring.Poly directly. It is possible with the current API but is quite tricky and undocumented.

This PR address these issues by defining the missing cases and encoder semantic. It is currently done as a minimal change, but a more sequential implementation of the Encoding workflow could be considered. The PR also adds a ckks test case for issue 1, even though ckks.Encoder currently behaves as expected in this case.

Copy link
Copy Markdown
Contributor

@lehugueni lehugueni left a comment

Choose a reason for hiding this comment

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

thanks!

Comment thread schemes/bgv/test_utils.go
Comment on lines +90 to +91
// fmt.Println("have", values[:10])
// fmt.Println("want", want[:10])
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
// fmt.Println("have", values[:10])
// fmt.Println("want", want[:10])

@lehugueni lehugueni requested a review from MGeorgie April 14, 2026 12:03
Copy link
Copy Markdown
Contributor

@MGeorgie MGeorgie left a comment

Choose a reason for hiding this comment

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

good

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