Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

feat: BbsBlsSignature2020 LDP suite for VC #2261

Merged
merged 1 commit into from
Oct 21, 2020

Conversation

kdimak
Copy link
Contributor

@kdimak kdimak commented Oct 21, 2020

closes #2221

Signed-off-by: Dmitriy Kinoshenko dkinoshenko@gmail.com

@codecov
Copy link

codecov bot commented Oct 21, 2020

Codecov Report

Merging #2261 into master will increase coverage by 0.04%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2261      +/-   ##
==========================================
+ Coverage   89.86%   89.90%   +0.04%     
==========================================
  Files         225      226       +1     
  Lines       15090    15103      +13     
==========================================
+ Hits        13560    13579      +19     
+ Misses        909      903       -6     
  Partials      621      621              
Impacted Files Coverage Δ
...e/suite/bbsblssignature2020/public_key_verifier.go 100.00% <100.00%> (ø)
pkg/doc/signature/verifier/public_key_verifier.go 94.26% <100.00%> (+0.30%) ⬆️
pkg/doc/verifiable/embedded_proof.go 100.00% <100.00%> (+10.00%) ⬆️

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 4ae68df...6e5c88d. Read the comment docs.

Comment on lines +19 to +20
github.com/kilic/bls12-381 => github.com/trustbloc/bls12-381 v0.0.0-20201008080608-ba2e87ef05ef
github.com/phoreproject/bls => github.com/trustbloc/bls v0.0.0-20201008085849-81064514c3cc
Copy link
Contributor

Choose a reason for hiding this comment

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

How come you're replacing these instead of just directly using those specific commits? Are there multiple versions of this dependency being used in different areas?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure if this answers the question, but we are needing to replace modules due to forking those projects. There is an open issue to remove dependencies on forks.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason why we're using replace instead of just directly importing from github.com/trustbloc/bls12-381?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, it's like an indication that this replacement is temporary and should be dropped in the future.

// BBSG2SignatureVerifier is a signature verifier that verifies a BBS+ Signature
// taking Bls12381G2Key2020 public key bytes as input.
// The reference implementation https://github.com/mattrglobal/bls12381-key-pair supports public key bytes only,
// JWK is not supported. JWK is not supported as well here.
Copy link
Contributor

@DRK3 DRK3 Oct 21, 2020

Choose a reason for hiding this comment

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

Should be JWK is not supported here as well instead of JWK is not supported as well here

JWK is not supported as well here actually accidentally implies that JWK is supported, just to a lesser degree than something else.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@baha-ai
Copy link
Contributor

baha-ai commented Oct 21, 2020

@kdimak public_key_verifier_test.go is probably missing, code coverage is low

replace (
github.com/kilic/bls12-381 => github.com/trustbloc/bls12-381 v0.0.0-20201008080608-ba2e87ef05ef
github.com/phoreproject/bls => github.com/trustbloc/bls v0.0.0-20201008085849-81064514c3cc
)
Copy link
Contributor

Choose a reason for hiding this comment

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

We can combine these replaces with the one in line 7.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

}
}
},
"BbsBlsSignatureProof2020": {
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we using BbsBlsSignatureProof2020 json-ld type ? Or is it just here as we copied the context file entirely from the source ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, we start to support it. But in the tests, we do not want to rely on the network availability of the contexts, and that's why we cache BbsBlsSignatureProof2020 context definition (referenced by https://w3c-ccg.github.io/ldp-bbs2020/context/v1). If you check pkg/doc/verifiable/testdata/context/, you can see much more cached contexts there... The contexts caching also speed ups the tests - I recall there was a speedup of verifiable tests run from about 2 minutes to several seconds after we started to use the context cache in the tests.

Copy link
Contributor

@baha-ai baha-ai Oct 21, 2020

Choose a reason for hiding this comment

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

perhaps the name of this file should be prefixed (or suffixed) with cache to indicate this is caching for testdata

closes hyperledger-archives#2221

Signed-off-by: Dmitriy Kinoshenko <dkinoshenko@gmail.com>
@kdimak
Copy link
Contributor Author

kdimak commented Oct 21, 2020

@kdimak public_key_verifier_test.go is probably missing, code coverage is low

yeah, I had to write two extra tests for this :)

@troyronda troyronda merged commit 5e3788f into hyperledger-archives:master Oct 21, 2020
@kdimak kdimak deleted the issue-2221-vc branch October 21, 2020 20:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

BBS+ signature verifier
6 participants