您当前的位置: 首页 > 

mutourend

暂无认证

  • 2浏览

    0关注

    661博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

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

mutourend 发布时间:2019-11-18 10:52:58 ,浏览量:2

与博客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

关注
打赏
1664532908
查看更多评论
立即登录/注册

微信扫码登录

0.0407s