展示 HN:基于超图的 LPN 安全 PVAC 全同态加密
Show HN: PVAC FHE over hypergraphs with LPN security

原始链接: https://github.com/octra-labs/pvac_hfhe_cpp

本文详细介绍了一种全同态加密方案pvac-hfhe的概念验证实现。它利用二进制奇偶校验进行带噪声学习,并在127位素数域上执行算术运算。该系统的核心依赖于由密集随机超图构建的综合征图,参数选择参考了莫斯科物理技术学院(MIPT)关于超图属性的研究。 这是首次实现,于2024年初发布,并以C++代码(需要C++17或更高版本)的形式提供,地址为[https://github.com/octra-labs/pvac_hfhe_cpp](https://github.com/octra-labs/pvac_hfhe_cpp)。提供的示例演示了密钥生成、加密、同态加法、减法和乘法,然后进行解密以验证正确的结果。为了获得最佳性能,建议使用支持PCLMUL的x86-64 CPU。该代码包含各种功能的全面测试。

黑客新闻 新 | 过去 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Show HN: PVAC FHE 在超图上,具有 LPN 安全性 (github.com/octra-labs) 5 分,由 0x0ffh_local 1 天前发布 | 隐藏 | 过去 | 收藏 | 讨论 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文


proof of concept implementation of pvac-hfhe, which is based on the assumption of binary parity for learning with noise and arithmetic on a 127-bit prime field.

we rely on a syndrome graph constructed from a dense random k-uniform hypergraph, and the choice of parameters is based on results on threshold behavior and fractional colorability of random hypergraphs from the works of the moscow institute of physics and technology (MIPT), this is the very first implementation of the beginning of 2024 in its original form.

ps: look at the attachments.

requirement ver
c++ stand C++17 or later
compiler GCC 9+, Clang 10+, MSVC 2019+
cpu x86-64 with PCLMUL (recommended)
git clone https://github.com/octra-labs/pvac_hfhe_cpp.git
cd pvac-hfhe-cpp

build and run:

make test # 42 tests
make examples # usage examples
make test-prf 
make test-sigma
make test-depth
make test-ct
make test-hg
#include <iostream>
#include <pvac/pvac.hpp>

using namespace pvac;

int main() {
    // key generation
    Params prm;
    PubKey pk;
    SecKey sk;
    keygen(prm, pk, sk);

    // encrypt values (client-side)
    Cipher a = enc_value(pk, sk, 42);
    Cipher b = enc_value(pk, sk, 17);

    // homo ops (server-side)
    Cipher sum  = ct_add(pk, a, b); // 42 + 17
    Cipher diff = ct_sub(pk, a, b); // 42 - 17
    Cipher prod = ct_mul(pk, a, b); // 42 * 17

    // decrypt results (client-side)
    std::cout << "42 + 17 = " << IsOne(dec_value(pk, sk, sum) == fp_from_u64(59)) << "\n";
    std::cout << "42 - 17 = " << fp_IsOne(dec_value(pk, sk, diff) == fp_from_u64(25)) << "\n";
    std::cout << "42 * 17 = " << fp_IsOne(dec_value(pk, sk, prod) == fp_from_u64(714)) << "\n";

    return 0;
}
g++ -std=c++17 -O2 -march=native -I./include example.cpp -o example
./example
联系我们 contact @ memedata.com