コード例 #1
0
 public void changeRecvCipher(BlockCipher bc, MAC mac) {
   cis.changeCipher(bc);
   recv_mac = mac;
   recv_mac_buffer = (mac != null) ? new byte[mac.size()] : null;
   recv_mac_buffer_cmp = (mac != null) ? new byte[mac.size()] : null;
   recv_padd_blocksize = bc.getBlockSize();
   if (recv_padd_blocksize < 8) recv_padd_blocksize = 8;
 }
コード例 #2
0
  public void changeSendCipher(BlockCipher bc, MAC mac) {
    if ((bc instanceof NullCipher) == false) {
      /* Only use zero byte padding for the first few packets */
      useRandomPadding = true;
      /* Once we start encrypting, there is no way back */
    }

    cos.changeCipher(bc);
    send_mac = mac;
    send_mac_buffer = (mac != null) ? new byte[mac.size()] : null;
    send_padd_blocksize = bc.getBlockSize();
    if (send_padd_blocksize < 8) send_padd_blocksize = 8;
  }