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.
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:
Since
java.security.spec.EdDSAParameterSpecis 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 tosig.setParameter(...)fails as an unsupported operation.Another consequence is that I was not able to find any way to use
Signatureto 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.EdDSAParameterSpecalso allows to specify a context.