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 support for vmp_prepare_dblptr #49

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

Conversation

Pro7ech
Copy link

@Pro7ech Pro7ech commented Feb 10, 2025

Comments

Originally the signature for vmp_prepare_dblptr had the comments

/** @brief prepares a vmp matrix (mat[row*ncols+col] points to the item) */

I'm not sure if this indexing was intentional or not, as it would mean the matrix has row*col rows and each column is of size N. After using spqlios for things such as circuit bootstrapping, it is much more convenient to have the indexing done as mat[row]+col*N, or equivalently, each row is a vec_znx and each column a limb of the vec_znx indexed by the row. This allow to prepare a matrix (e.g. RGSW) from a set of vec_znx (a e.g. set of RLWE) by simply constructing an array pointing to each of their data.

Changes

  • Added vmp_prepare_row which enables to prepare the i-th row of a vmp_pmat for vec_znx, vec_rnx, vec_zn32. This enables to prepare a vmp_pmat with a buffer as small as one row (a vec_znx).
  • Added support for vmp_prepare_dblptr for vec_znx, vec_rnx, vec_zn32. vmp_prepare_dblptr sequentially calls vmp_prepare_row.
  • Added tests for vmp_prepare_dblptr for vec_znx, vec_rnx, vec_zn32 (which also directly tests vmp_prepare_row).
  • Renamed vmp_prepare_contiguous_tmp_bytes to vmp_preapre_tmp_bytes.
  • Removed some duplicates in module API.

Related Issues

#46, #47

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.

1 participant