Skip to content

Bouncy Castle JCE provider does not support java.security.spec.EdDSAParameterSpec #2313

@mauromol

Description

@mauromol

I'm not a crypto guru, but I'm working a lot recently with Bouncy Castle, RSA, ECC and now Edwards curves.

One problem I hit is that, contrary to other algorithms, with Ed25519 cryptography I can't use the Bouncy Castle provider as a drop-in replacement of the SunEC provider for the signature creation/verification.

For example, with the standard SunEC provider I can do the following to verify a signature made with Ed25519ph:

Signature sig = Signature.getInstance("Ed25519"); // or even "EdDSA"
sig.setParameter(new  java.security.spec.EdDSAParameterSpec(true));
sig.initVerify(publicKey);
sig.update(inputData);
boolean ok = sig.verify(signatureBytes);

Since java.security.spec.EdDSAParameterSpec is a standard JCE library (and not SunEC-provider specific), I would have expected this to work with BC provider too, but it does not: the call to sig.setParameter(...) fails as an unsupported operation.

Another consequence is that I was not able to find any way to use Signature to create or verify an Ed25519ph signature when using Bouncy Castle. Is there any, which does not require me to use Bouncy Castle own API?
I think the same applies for Ed25519ctx: java.security.spec.EdDSAParameterSpec also allows to specify a context.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions