您当前的位置: 首页 > 

mutourend

暂无认证

  • 0浏览

    0关注

    661博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

ristretto255对外API抽象及基于Curve25519的ristretto255层实现

mutourend 发布时间:2019-07-19 18:59:52 ,浏览量:0

1. API接口

ristretto255用于实现对cofactor不为1曲线的抽象,对外主要提供以下API接口:

  • 1)“Encode”:将internal representations编码为bytestrings,使相同的ristretto255 element上所有相同的repsentations被编码为完全相同的bytestrings;
  • 2)“DECODE”:将bytestrings解码为internal representations,且可对这些internal representations进行built-in validation,保证仅接受由有效ristretto255 elements编码的bytestrings;
  • 3)“EQUALS”:对internal representations进行比对,对于相同ristretto255 element的不同internal representations表示,这些representations也被认为是等效的。
  • 4)“FROM_UNIFORM_BYTES":为hash-to-group和random-point运算提供一致的映射关系(由bytestrings到ristretto255 elements)。

以上提到的internal representations为elliptic curve points,所以内部的group element 加/减/scalar乘法运算可转换为对ellptic curve points的加/减/scalar乘法运算。

这个group运算需要用到Curve25519的Edward curve特性。

/// edwards.rs文件中注释:
Group operations for Curve25519, in Edwards form.

ristretto255抽象层对性能的损耗很小,个别特定的操作(如EQUALS)的运行性能甚至优于底层使用elliptic curve points的运算性能。

2. ristretto255 element

ristretto255 group element为prime order group element的抽象。

  • “element encoding”为对一个ristretto255 group element(以下简称group element)的编码(该编码唯一且可逆的);
  • “internal representation”为实现ristretto255的ellptic curve上的一个point。 每个group point可以有多个等效的internal representations。(即可满足cofactor不为1的曲线。)

ristretto255 group element以扩展坐标系(x,y,z,t)形式表示。

3. 基于Curve25519的ristretto255层实现

当把Curve25519 points作为internal representation时,具体的ristretto255 group实现细节如下:

Curve25519具有order—— l = 2 252 + 27742317777372353535851937790883648493 l=2^{252}+27742317777372353535851937790883648493 l=2252+27742317777372353535851937790883648493。

ristretto255为prime order group,其中的每个element均可作为generator,但是为了互操作性便利,会选择一个经典的generator——该generator对应的为Curve25519的basepoint,以便于复用现有scalar multiplication的precomputation。这个经典的generator的编码对应为:

e2f2ae0a 6abc4e71 a884a961 c500515f 58e30b6a a582dd8d b6a65945 e08d2d76

参考资料: [1] https://eprint.iacr.org/2015/673.pdf [2] https://tools.ietf.org/pdf/draft-hdevalence-cfrg-ristretto-01.pdf [3] https://ristretto.group/ristretto.html [4] https://github.com/dalek-cryptography/curve25519-dalek [5] https://mp.csdn.net/mdeditor/94566837#

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

微信扫码登录

0.0397s