tuweni / org.apache.tuweni.rlpx / EthereumIESEncryptionEngine

EthereumIESEncryptionEngine

open class EthereumIESEncryptionEngine (source)

Support class for constructing integrated encryption ciphers for doing basic message exchanges on top of key agreement ciphers. Follows the description given in IEEE Std 1363a.

Constructors

<init>

EthereumIESEncryptionEngine(agree: BasicAgreement, kdf: DerivationFunction, mac: Mac, commonMac: ByteArray)

Set up for use with stream mode, where the key derivation function is used to provide a stream of bytes to xor with the message.

EthereumIESEncryptionEngine(agree: BasicAgreement, kdf: DerivationFunction, mac: Mac, commonMac: ByteArray, cipher: BufferedBlockCipher)

Set up for use in conjunction with a block cipher to handle the message. It is strongly recommended that the cipher is not in ECB mode.

Functions

getCipher

open fun getCipher(): BufferedBlockCipher

getMac

open fun getMac(): Mac

init

open fun init(forEncryption: Boolean, privParam: CipherParameters, pubParam: CipherParameters, params: CipherParameters): Unit
open fun init(privateKey: AsymmetricKeyParameter, params: CipherParameters, publicKeyParser: KeyParser): Unit

Initialise the encryptor.

open fun init(publicKey: AsymmetricKeyParameter, params: CipherParameters, ephemeralKeyPairGenerator: EphemeralKeyPairGenerator): Unit

Initialise the decryptor.

processBlock

open fun processBlock(in: ByteArray, inOff: Int, inLen: Int): ByteArray