Skip to content

Fix encoding of AlgorithmIdentifier.parameters of Digests, add support of Shake-based signatures. - #906

Closed
xipki wants to merge 0 commit into
bcgit:masterfrom
xipki:master
Closed

xipki wants to merge 0 commit into
bcgit:masterfrom
xipki:master

Conversation

@xipki

@xipki xipki commented Mar 13, 2021

Copy link
Copy Markdown
Contributor

For the SHAKE-based signatures, I cannot find test vectors, so please review the code before merge.

@dghgit dghgit self-assigned this Mar 14, 2021
@dghgit

dghgit commented Mar 14, 2021

Copy link
Copy Markdown
Contributor

I think we'll need to take small steps with this one, I agree with most of it, but it's a bit of a rabbit warren. For example the change:

else if (sigAlgId.getAlgorithm().equals(EdECObjectIdentifiers.id_Ed448))
{

  •  digAlgId = new AlgorithmIdentifier(NISTObjectIdentifiers.id_shake256_len, new ASN1Integer(512));
    
  •        digAlgOid = NISTObjectIdentifiers.id_shake256;
      }
    

is incorrect. What's currently there is based on RFC 8419, Section 3.1. It's very easy to blow one's foot off here... If there's no objection, I'll make some small corrections first and then get you to update.

@dghgit

dghgit commented Mar 14, 2021

Copy link
Copy Markdown
Contributor

One other one, would you generate a couple of PSS signatures using SHAKE128 and SHAKE256 and send me enough details so I can verify them. There's another way of adding PSS for these, assuming we both produce the same results there is a better chance that the RFC has been followed correctly. Thanks.

@xipki xipki closed this Mar 14, 2021
@xipki

xipki commented Mar 14, 2021 •

Copy link
Copy Markdown
Contributor Author

I will re-submit the pull requests.

@dghgit

dghgit commented Mar 14, 2021

Copy link
Copy Markdown
Contributor

Sure, by the way I've found a source of test vectors for PSS.

@dghgit

dghgit commented Mar 15, 2021

Copy link
Copy Markdown
Contributor

I've just pushed some code for PSS and ECDSA, it combines RFC 8702 and the draft of FIPS 186-5. Please take a look and poke a bit...

The only doubtful one seems to be ECDSA with SHAKE128 not passing the test vectors I have, but they may actually be incorrect. The SHAKE256 vectors from the same provider do match up, investigating.

@xipki

xipki commented Mar 15, 2021 •

Copy link
Copy Markdown
Contributor Author

Reviewed your changes, they are fine.

It would be better, if you can also specify the source of the test vectors.

@dghgit

dghgit commented Mar 15, 2021

Copy link
Copy Markdown
Contributor

Thanks, I generated the vectors from the ACVP demo system. They are apparently planning to start publishing vectors for download sometime soon - when that happens I'll update so people have a definitive source to check against.

Trisia pushed a commit to Trisia/bc-java that referenced this pull request Mar 16, 2021
added support for ECDSA with SHAKE128/SHAKE256 (some from github bcgit#906)
Trisia pushed a commit to Trisia/bc-java that referenced this pull request Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants