mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-22 19:43:11 +00:00
Crypto: Fix Ed25519ph conversion
This commit is contained in:
1 parent
9d17066175
commit
91c59dfb6b
1 file changed
+4
-2
@@ -372,7 +372,8 @@ public final class SigUtil {
|
||||
EdDSAParameterSpec paramspec = (EdDSAParameterSpec) pk.getType().getParams();
|
||||
EdDSAPrivateKeySpec pkspec;
|
||||
SigType type = pk.getType();
|
||||
if (type == SigType.EdDSA_SHA512_Ed25519)
|
||||
if (type == SigType.EdDSA_SHA512_Ed25519 ||
|
||||
type == SigType.EdDSA_SHA512_Ed25519ph)
|
||||
pkspec = new EdDSAPrivateKeySpec(pk.getData(), paramspec);
|
||||
else if (type == SigType.RedDSA_SHA512_Ed25519)
|
||||
pkspec = new EdDSAPrivateKeySpec(pk.getData(), null, paramspec);
|
||||
@@ -398,7 +399,8 @@ public final class SigUtil {
|
||||
public static SigningPrivateKey fromJavaKey(EdDSAPrivateKey pk, SigType type)
|
||||
throws GeneralSecurityException {
|
||||
byte[] data;
|
||||
if (type == SigType.EdDSA_SHA512_Ed25519)
|
||||
if (type == SigType.EdDSA_SHA512_Ed25519 ||
|
||||
type == SigType.EdDSA_SHA512_Ed25519ph)
|
||||
data = pk.getSeed();
|
||||
else if (type == SigType.RedDSA_SHA512_Ed25519)
|
||||
data = pk.geta();
|
||||
|
||||
Reference in new issue
Block a user