elliptic-curve签名验证verify signature in EdDSA

特别地,https://slowli.github.io/ed25519-quirks/ 这个网站的内容很清晰。

1. signature in EdDSA

详细的EdDSA签名和验签过程可参看 rfc8032 Edwards-Curve Digital Signature Algorithm (EdDSA)

在这里插入图片描述
在这里插入图片描述
参照博客Schnorr signature (Schnorr 签名)数学原理类似,签名过程如下:

  • A = k G A=kG A=kG, k k k is private, A is public key, G is a standard elliptic-curve point.
  • R = r G R=rG R=rG, r r r 为 random-once随机数,每次需分别单独生成,R is public。
  • h = H a s h ( R ∣ ∣ A ∣ ∣ m ) h=Hash(R||A||m) h=Hash(RAm), m m m is the message to be signed.
  • s = r + k h s=r+kh s=r+kh, ( R , s ) (R,s) (R,s) is the signature for message m m m.

∵ s G = r G + k h G = R + h A \because sG=rG+khG=R+hA sG=rG+khG=R+hA
∴ R = s G − h A \therefore R=sG-hA R=sGhA

验签时, ( R , s ) , A , m , G (R,s),A,m,G (R,s),A,m,G均已知,其中的 A / G / R A/G/R A/G/R均为elliptic-curve point, 且为节省空间, A / R A/R A/R已compress。 s s s为scalar值。具体的验签过程如下:

  • h = H a s h ( R ∣ ∣ A ∣ ∣ m ) h=Hash(R||A||m) h=Hash(RAm)
  • c o m p r e s s ( s G − h ∗ d e c o m p r e s s ( A ) )    ? = R compress(sG-h*decompress(A))\ \ ?= R compress(sGhdecompress(A))  ?=R

以上验签过程支持fast batch verification以及fast batch forgery identification.

For elliptic-curve signatures at a 2 b 2^b 2b security level it is standard practice to use about 2 b 2b 2b bits for hashes, scalars, and field elements, and to compress points to single coordinates. EdDSA and Schnorr’s system then have the same signature size, about 4b bits.

( R , s ) (R,s) (R,s) 为EdDSA格式的签名, ( R , h ) (R,h) (R,h)为Schnorr格式的签名。相比于ECDSA,去掉了求倒数的操作。

在这里插入图片描述

对于Schnorr格式的签名,当选择 b b bbits的Hash函数时,最终Schnorr格式的签名可减少至 3 b 3b 3b bits.

decompress需要有额外的求平方根运算,为节约verify的验证时间,也可传递未被压缩的public keys和未压缩的签名。decompress解压缩的细节可参看博客edwards25519 point压缩及解压缩算法,求平方根运算见博客有限域内的平方根求解原理解析及curve25519-dalek中的实现.

基于Pairing-based的签名,其长度更小,大约为 2 b 2b 2b bits,但是pairing-based的验签速度要比elliptic-verve的验签速度慢一个数量级。
在这里插入图片描述

参考资料:
[1] 论文《Faster batch forgery identification》
[2] 博客Schnorr signature (Schnorr 签名)数学原理
[3] Edwards-Curve Digital Signature Algorithm (EdDSA)
[4] https://slowli.github.io/ed25519-quirks/
[5] https://yondon.blog/2019/01/01/how-not-to-use-ecdsa/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值