net.i2p.crypto
Class DummyElGamalEngine
java.lang.Object
net.i2p.crypto.ElGamalEngine
net.i2p.crypto.DummyElGamalEngine
public class DummyElGamalEngine
- extends ElGamalEngine
Fake ElG E and D, useful for when performance isn't being tested
- Author:
- jrandom
Method Summary |
byte[] |
decrypt(byte[] encrypted,
PrivateKey privateKey)
Decrypt the data |
byte[] |
encrypt(byte[] data,
PublicKey publicKey)
encrypt the data to the public key |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DummyElGamalEngine
public DummyElGamalEngine(I2PAppContext context)
- The ElGamal engine should only be constructed and accessed through the
application context. This constructor should only be used by the
appropriate application context itself.
encrypt
public byte[] encrypt(byte[] data,
PublicKey publicKey)
- encrypt the data to the public key
- Overrides:
encrypt
in class ElGamalEngine
- Parameters:
publicKey
- public key encrypt todata
- data to encrypt
- Returns:
- encrypted data
decrypt
public byte[] decrypt(byte[] encrypted,
PrivateKey privateKey)
- Decrypt the data
- Overrides:
decrypt
in class ElGamalEngine
- Parameters:
encrypted
- encrypted dataprivateKey
- private key to decrypt with
- Returns:
- unencrypted data