示例#1
0
 public AESEngine Next(AESType t)
 {
     AESEngine next;
     if (GlobalPool<AESEngine>.GetObject(out next, this, t))
     {
         next.Type = Type == AESType.EMPTY ? AESType.EMPTY : t;
         next._key = _key;
         next._direction = _direction;
     }
     else
     {
         next._canRecycle = true;
     }
     return next;
 }
示例#2
0
 public AESEngine(AESEngine other, AESType type)
 {
     Type = other.Type == AESType.EMPTY ? AESType.EMPTY : type;
     _key = other._key;
     _direction = other._direction;
 }
示例#3
0
 public AESEngine(byte[] key = null,Direction direction = Direction.DECRYPT)
 {
     _direction = direction;
     Type = key == null ? AESType.EMPTY : AESType.DEFAULT;
     _key = _direction == Direction.DECRYPT ? GetDecryptKey(key) : GetEncryptKey(key);
 }