Exemple #1
0
 /**
  * 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.
  *
  * @param agree the key agreement used as the basis for the encryption
  * @param kdf the key derivation function used for byte generation
  * @param mac the message authentication code generator for the message
  */
 public IESEngine(
     BasicAgreement agree,
     DerivationFunction kdf,
     Mac mac)
 {
     this.agree  = agree;
     this.kdf    = kdf;
     this.mac    = mac;
     this.macBuf = new byte[mac.getMacSize()];
     this.cipher = null;
 }
Exemple #2
0
 /**
  * set up for use in conjunction with a block cipher to handle the
  * message.
  *
  * @param agree the key agreement used as the basis for the encryption
  * @param kdf the key derivation function used for byte generation
  * @param mac the message authentication code generator for the message
  * @param cipher the cipher to used for encrypting the message
  */
 public IESEngine(
     BasicAgreement agree,
     DerivationFunction kdf,
     Mac mac,
     BufferedBlockCipher cipher)
 {
     this.agree  = agree;
     this.kdf    = kdf;
     this.mac    = mac;
     this.macBuf = new byte[mac.getMacSize()];
     this.cipher = cipher;
 }