feat(eddsa): add support for EdDSA varsigs - and common Ed25519 and Ed448 algorithms

This commit is contained in:
Steve Moyer
2025-07-07 15:42:11 -04:00
parent 8b710b7e23
commit 03bcfb7b16
7 changed files with 225 additions and 10 deletions

View File

@@ -1,5 +1,21 @@
package varsig
// Ed25519 produces a varsig that describes the associated algorithm defined
// by the [IANA JOSE specification].
//
// [IANA JOSE specidication]: https://www.iana.org/assignments/jose/jose.xhtml#web-signature-encryption-algorithms
func Ed25519(payloadEncoding PayloadEncoding, opts ...Option) (*EdDSAVarsig, error) {
return NewEdDSAVarsig(CurveEd25519, HashAlgorithmSHA512, payloadEncoding, opts...)
}
// Ed448 produces a varsig that describes the associated algorithm defined
// by the [IANA JOSE specification].
//
// [IANA JOSE specidication]: https://www.iana.org/assignments/jose/jose.xhtml#web-signature-encryption-algorithms
func Ed448(payloadEncoding PayloadEncoding, opts ...Option) (*EdDSAVarsig, error) {
return NewEdDSAVarsig(CurveEd448, HashAlgorithmShake256, payloadEncoding, opts...)
}
// RS256 produces a varsig that describes the associated algorithm defined
// by the [IANA JOSE specification].
//