各种同态加密(FHE)模式,如果使用带错误的环学习(RLWE)问题(以及一般的基于格型的后量子密码),需要对系数执行多项式模,然后执行标量模。
对于多项式和多项式模,我使用了polynom包。
有办法对系数执行标量模吗?
发布于 2022-10-10 14:43:09
多义词是没有办法的。这是一个简单的解决办法。
# define a helper function
CoefMod <- function(x, k)
polynom::polynomial(as.vector(x)%%k)
# create a polynomial
library(polynom)
polynomial = polynomial(c(5, 3, 6))
# apply the helper function (mod 5)
CoefMod(polynomial, 5)我创建了一个小的R包,它也使函数可用:
install.packages('remotes')
remotes::install_github('bquast/HEtools')https://stackoverflow.com/questions/74016677
复制相似问题