Polynomial Commitments代码实现【2】——lovesh/kzg-poly-commit

与博客Polynomial Commitments代码实现【1】——scipr-lab/poly-commit(含不同曲线性能对比)中类似,lovesh/kzg-poly-commit也是基于论文《Polynomial Commitments∗》的代码实现。

1. finite域及group element运算

https://github.com/lovesh/amcl_rust_wrapper是在https://github.com/miracl/amcl基础上进行了二次封装,同时:

  • 重载了+, -, *, +=, -=运算,保证方法运行为constant time。对于scalar multiplication,也提供了variable time算法实现。
  • 抽象了field元素和group元素vector的创建方法,支持scale,add,inner product和Hadamard product运算。
  • 通过serde进行序列化。
  • 实用clear_on_drop来清理不用的field和group元素。
  • 提供了wNAF variable time scalar multiplication方法,以及其它constant time和variable time multi-scalar multiplication方法,提供了batch(simultaneous)inversion 和Barrett reduction方法。

Cargo.toml中配置features来指定所需使用的曲线(支持bls381/secp256k1等等曲线):

[dependencies.amcl_wrapper]
git = "https://github.com/lovesh/amcl_rust_wrapper"
branch = "master"
features = ["bls381"]

目前https://github.com/miracl/amcl仅做bug维护,不做新功能更新。最新的库见https://github.com/miracl/core,该库为多曲线多语言实现,MIRACL Core was designed from the ground up with side-channel attack resistance in mind.

参考资料:
[1] 论文《Polynomial Commitments∗
[2] 代码库:https://github.com/lovesh/kzg-poly-commit
[3] 博客polynomial commitment及实现方式对比
[4] 博客椭圆曲线形式下的Pedersen commitment——vector commitmnt和polynomial commitment

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值