Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add v3.public support #1

Merged
merged 6 commits into from
May 14, 2022
Merged

Add v3.public support #1

merged 6 commits into from
May 14, 2022

Conversation

aidantwoods
Copy link
Owner

No description provided.

@aidantwoods
Copy link
Owner Author

No Go language support for RFC 6979 (as suggested by the PASETO spec). However, the Go crypto library does address CSPRNG failures:

https://pkg.go.dev/crypto/ecdsa#pkg-overview

Package ecdsa implements the Elliptic Curve Digital Signature Algorithm, as defined in FIPS 186-4 and SEC 1, Version 2.0.

Signatures generated by this package are not deterministic, but entropy is mixed with the private key and the message, achieving the same level of security in case of randomness source failure.

This should be sufficient to meet the spec recommendations, but open to feedback on how to improve this. My preference is to defer to the Go crypto library where possible here, rather than writing a custom implementation of RFC 6979.

@paragonie-security
Copy link

Signatures generated by this package are not deterministic, but entropy is mixed with the private key and the message, achieving the same level of security in case of randomness source failure.

That's sufficient. From step 4 in the Version 3 spec (emphasis added):

  1. Sign m2 using ECDSA over P-384 and SHA-384 with the private key sk.
    We'll call this sig. The output of sig MUST be in the format r || s
    (where ||means concatenate), for a total length of 96 bytes.
    • Signatures SHOULD use deterministic nonces (RFC 6979)
      if possible, to mitigate the risk of k-value reuse.
    • If RFC 6979 is not available in your programming language, ECDSA MUST use a CSPRNG
      to generate the k-value.
    • Hedged signatures (RFC 6979 + additional randomness to provide resilience to fault attacks)
      are allowed.
    sig = crypto_sign_ecdsa_p384(
        message = m2,
        private_key = sk
    );
    

@aidantwoods
Copy link
Owner Author

Really appreciate you taking a look. Thanks for confirming! 😃

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