Skip to content
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.

draft-irtf-cfrg-vrf-06 #1346

Closed
wants to merge 31 commits into from
Closed

draft-irtf-cfrg-vrf-06 #1346

wants to merge 31 commits into from

Conversation

gdbelvin
Copy link
Contributor

@gdbelvin gdbelvin commented Aug 23, 2019

Golang implementation of https://datatracker.ietf.org/doc/draft-irtf-cfrg-vrf/

This will replace the implementation at core/crypto/vrf

cc @reyzin

core/crypto/draft-irtf-cfrg-vrf-05/suites.go Outdated Show resolved Hide resolved
core/crypto/draft-irtf-cfrg-vrf-05/ecvrf_nonce.go Outdated Show resolved Hide resolved
core/crypto/draft-irtf-cfrg-vrf-05/ecvrf_nonce.go Outdated Show resolved Hide resolved
core/crypto/draft-irtf-cfrg-vrf-05/ecvrf_nonce.go Outdated Show resolved Hide resolved
@lgtm-com
Copy link

lgtm-com bot commented Apr 1, 2020

This pull request introduces 2 alerts when merging 1ae055a into 81611a7 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable
  • 1 for Self assignment

@gdbelvin gdbelvin changed the title draft-irtf-cfrg-vrf-05 draft-irtf-cfrg-vrf-06 Apr 1, 2020
@gdbelvin
Copy link
Contributor Author

gdbelvin commented Apr 1, 2020

Note, this could make use of golang/go#34105 when it is implemented.

@codecov
Copy link

codecov bot commented Apr 1, 2020

Codecov Report

Merging #1346 into master will decrease coverage by 0.66%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1346      +/-   ##
==========================================
- Coverage   70.15%   69.49%   -0.67%     
==========================================
  Files          58       57       -1     
  Lines        4329     4261      -68     
==========================================
- Hits         3037     2961      -76     
- Misses        877      886       +9     
+ Partials      415      414       -1     
Impacted Files Coverage Δ
core/sequencer/election/tracker.go 70.11% <0.00%> (-10.35%) ⬇️
core/crypto/draft-irtf-cfrg-vrf-06/conversion.go 84.90% <0.00%> (-3.78%) ⬇️
core/crypto/draft-irtf-cfrg-vrf-06/ecvrf.go 87.17% <0.00%> (-0.63%) ⬇️
core/sequencer/server.go 74.18% <0.00%> (-0.33%) ⬇️
...to/draft-irtf-cfrg-vrf-06/ecvrf_p256_sha256_tai.go 85.71% <0.00%> (ø)
...to/draft-irtf-cfrg-vrf-06/ecvrf_p256_sha256_swu.go
core/sequencer/trillian_client.go 60.86% <0.00%> (+2.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0a2f299...0a2f299. Read the comment docs.

//
// http://www.secg.org/sec1-v2.pdf
// https://tools.ietf.org/html/rfc8032#section-5.1.3
func SECG1Decode(curve elliptic.Curve, data []byte) (x, y *big.Int) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

65-94 lines are duplicate of core/crypto/vrf/p256/unmarshal.go:27-56 (from dupl)

if aux.params.cofactor > 1 {
hx, hy = aux.params.ec.ScalarMult(hx, hy, []byte{aux.params.cofactor})
}
return

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naked return in func hashToCurveSimplifiedSWU with 98 lines of code (from nakedret)

}
}

func BenchmarkProveECVRFP256SHA256SWUU(b *testing.B) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

197-218 lines are duplicate of core/crypto/draft-irtf-cfrg-vrf-06/ecvrf_p256_sha256_tai_test.go:197-218 (from dupl)

}
}

func BenchmarkProveECVRFP256SHA256TAI(b *testing.B) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

197-218 lines are duplicate of core/crypto/draft-irtf-cfrg-vrf-06/ecvrf_p256_sha256_swu_test.go:197-218 (from dupl)

@gdbelvin gdbelvin marked this pull request as ready for review April 3, 2020 19:46
@gdbelvin gdbelvin requested a review from thaidn as a code owner April 3, 2020 19:46
@gdbelvin gdbelvin mentioned this pull request Apr 7, 2020
@gdbelvin gdbelvin marked this pull request as draft April 29, 2020 11:06
@gdbelvin gdbelvin closed this Jun 20, 2020
@gdbelvin gdbelvin deleted the vrf branch June 20, 2020 09:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants