示例#1
0
 private IBlockCipher CreateBlockCipher(TlsCipherMode cipherMode, IBlockCipher blockCipher)
 {
     switch (cipherMode)
     {
     case TlsCipherMode.CBC:
     case TlsCipherMode.EDE_CBC:
         return(new CbcBlockCipher(blockCipher));
     }
     return(null);
 }
示例#2
0
        private IAeadBlockCipher CreateAeadCipher(TlsCipherMode cipherMode, IBlockCipher blockCipher)
        {
            switch (cipherMode)
            {
            case TlsCipherMode.CCM_8:
            case TlsCipherMode.CCM:
                return(new CcmBlockCipher(blockCipher));

            case TlsCipherMode.GCM:
                return(new GcmBlockCipher(blockCipher));
            }
            return(null);
        }