From a1a895e462e2a67049241d38d8031adba5af93e3 Mon Sep 17 00:00:00 2001 From: zzz Date: Fri, 29 Jan 2016 03:02:02 +0000 Subject: [PATCH] Add EdDSA_SHA512_Ed25519ph Fix EdDSA OID --- core/java/src/net/i2p/crypto/SigType.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/core/java/src/net/i2p/crypto/SigType.java b/core/java/src/net/i2p/crypto/SigType.java index 1a3d0646d6..5da9e22b04 100644 --- a/core/java/src/net/i2p/crypto/SigType.java +++ b/core/java/src/net/i2p/crypto/SigType.java @@ -55,9 +55,17 @@ public enum SigType { * @since 0.9.15 */ EdDSA_SHA512_Ed25519(7, 32, 32, 64, 64, SigAlgo.EdDSA, "SHA-512", "SHA512withEdDSA", - // this is the OID of the key, not the sig, probably wrong - EdDSANamedCurveTable.getByName("ed25519-sha-512"), "1.3.101.100", "0.9.17"); + EdDSANamedCurveTable.getByName("ed25519-sha-512"), "1.3.101.101", "0.9.17"), + /** + * Prehash version (double hashing, for offline use such as su3, not for use on the network) + * Pubkey 32 bytes; privkey 32 bytes; hash 64 bytes; sig 64 bytes + * @since 0.9.25 + */ + EdDSA_SHA512_Ed25519ph(8, 32, 32, 64, 64, SigAlgo.EdDSA, "SHA-512", "NonewithEdDSA", + EdDSANamedCurveTable.getByName("ed25519-sha-512"), "1.3.101.101", "0.9.25"), + + ; // TESTING.................... @@ -285,6 +293,8 @@ public enum SigType { // handle mixed-case enum if (uc.equals("EDDSA_SHA512_ED25519")) return EdDSA_SHA512_Ed25519; + if (uc.equals("EDDSA_SHA512_ED25519PH")) + return EdDSA_SHA512_Ed25519ph; return valueOf(uc); } catch (IllegalArgumentException iae) { try {