anon.client.crypto
Class ControlChannelCipher

java.lang.Object
  extended by anon.client.crypto.ControlChannelCipher

public class ControlChannelCipher
extends java.lang.Object


Field Summary
(package private)  long m_DecMsgCounter
           
(package private)  long m_EncMsgCounter
           
(package private)  org.bouncycastle.crypto.modes.GCMBlockCipher m_recvEngine
           
(package private)  byte[] m_recvKey
           
(package private)  org.bouncycastle.crypto.modes.GCMBlockCipher m_sentEngine
           
(package private)  byte[] m_sentKey
           
 
Constructor Summary
ControlChannelCipher()
           
 
Method Summary
private  byte[] createIV(long counter)
           
 void decryptGCM2(byte[] from, int ifrom, byte[] to, int ito, int len)
           
 void encryptGCM1(byte[] from, int ifrom, byte[] to, int ito, int len)
           
 int getDecryptedOutputSize(int enclength)
           
 int getEncryptedOutputSize(int inputlength)
           
 int setRecvKey(byte[] key, int offset, int len)
           
 int setSentKey(byte[] key, int offset, int len)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_sentEngine

org.bouncycastle.crypto.modes.GCMBlockCipher m_sentEngine

m_recvEngine

org.bouncycastle.crypto.modes.GCMBlockCipher m_recvEngine

m_EncMsgCounter

long m_EncMsgCounter

m_DecMsgCounter

long m_DecMsgCounter

m_sentKey

byte[] m_sentKey

m_recvKey

byte[] m_recvKey
Constructor Detail

ControlChannelCipher

public ControlChannelCipher()
Method Detail

setSentKey

public int setSentKey(byte[] key,
                      int offset,
                      int len)

setRecvKey

public int setRecvKey(byte[] key,
                      int offset,
                      int len)

createIV

private byte[] createIV(long counter)

encryptGCM1

public void encryptGCM1(byte[] from,
                        int ifrom,
                        byte[] to,
                        int ito,
                        int len)
                 throws java.lang.Exception
Throws:
java.lang.Exception

decryptGCM2

public void decryptGCM2(byte[] from,
                        int ifrom,
                        byte[] to,
                        int ito,
                        int len)
                 throws java.lang.Exception
Throws:
java.lang.Exception

getEncryptedOutputSize

public int getEncryptedOutputSize(int inputlength)

getDecryptedOutputSize

public int getDecryptedOutputSize(int enclength)