Changeset 649d712


Ignore:
Timestamp:
Jan 24, 2016 4:45:54 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
f38cfcc
Parents:
ad25611
Message:

Add ElGamal? signature implementation
Add ElGamal? to provider
doesn't work yet,
needs key encoding/decoding and SigUtil? support for longer signatures

Location:
core/java/src/net/i2p/crypto
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • core/java/src/net/i2p/crypto/provider/I2PProvider.java

    rad25611 r649d712  
    3232    private void setup() {
    3333        // TODO: Implement SPIs for existing code
     34        // However -
     35        // quote
     36        // http://docs.oracle.com/javase/7/docs/technotes/guides/security/crypto/HowToImplAProvider.html
     37        //
     38        // If your provider is supplying encryption algorithms through the
     39        // Cipher, KeyAgreement, KeyGenerator, Mac, or SecretKeyFactory classes,
     40        // you will need to sign your JAR file so that the JCA can authenticate the code at runtime.
     41        // If you are NOT providing an implementation of this type you can skip this step.
     42        //
    3443        //put("Cipher.AES", "net.i2p.crypto.provider.CipherSpi$aesCBC");
    3544        //put("Cipher.ElGamal", "net.i2p.crypto.provider.CipherSpi$elGamal");
    3645        //put("Mac.HmacMD5-I2P", "net.i2p.crypto.provider.MacSpi");
     46
    3747        put("MessageDigest.SHA-1", "net.i2p.crypto.SHA1");
    3848        //put("Signature.SHA1withDSA", "net.i2p.crypto.provider.SignatureSpi");
    3949
    4050        // EdDSA
     51        // OID: 1.3.101.100
    4152        put("KeyFactory.EdDSA", "net.i2p.crypto.eddsa.KeyFactory");
    4253        put("KeyPairGenerator.EdDSA", "net.i2p.crypto.eddsa.KeyPairGenerator");
     
    5162        put("Alg.Alias.Signature.1.3.101.100", "SHA512withEdDSA");
    5263        put("Alg.Alias.Signature.OID.1.3.101.100", "SHA512withEdDSA");
     64        // TODO Ed25519ph
     65        // OID: 1.3.101.101
     66
     67        // ElGamal
     68        // OID: 1.3.14.7.2.1.1
     69        put("KeyFactory.DH", "net.i2p.crypto.elgamal.KeyFactory");
     70        put("KeyFactory.DiffieHellman", "net.i2p.crypto.elgamal.KeyFactory");
     71        put("KeyFactory.ElGamal", "net.i2p.crypto.elgamal.KeyFactory");
     72        put("KeyPairGenerator.DH", "net.i2p.crypto.elgamal.KeyPairGenerator");
     73        put("KeyPairGenerator.DiffieHellman", "net.i2p.crypto.elgamal.KeyPairGenerator");
     74        put("KeyPairGenerator.ElGamal", "net.i2p.crypto.elgamal.KeyPairGenerator");
     75        put("Signature.SHA256withElGamal", "net.i2p.crypto.elgamal.ElGamalSigEngine");
     76        put("Alg.Alias.KeyPairGenerator.1.3.14.7.2.1.1", "ElGamal");
     77        put("Alg.Alias.KeyPairGenerator.OID.1.3.14.7.2.1.1", "ElGamal");
     78        put("Alg.Alias.Signature.1.3.14.7.2.1.1", "SHA256withElGamal");
     79        put("Alg.Alias.Signature.OID.1.3.14.7.2.1.1", "SHA256withElGamal");
    5380    }
    5481}
Note: See TracChangeset for help on using the changeset viewer.