Exemplo n.º 1
0
        public static ITEA Create(TeaTypes type, TeaKey key)
        {
            switch (type)
            {
            case TeaTypes.TEA:
                return(new TEAFunction(key));

            case TeaTypes.XTEA:
                return(new XTEAFunction(key));

            case TeaTypes.XXTEA:
                return(new XXTEAFunction(key));

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Exemplo n.º 2
0
        public static ITEA Create(TeaTypes type, byte[] pwd)
        {
            switch (type)
            {
            case TeaTypes.TEA:
                return(new TEAFunction(GenerateKey(pwd)));

            case TeaTypes.XTEA:
                return(new XTEAFunction(GenerateKey(pwd)));

            case TeaTypes.XXTEA:
                return(new XXTEAFunction(GenerateKey(pwd)));

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }
        }
Exemplo n.º 3
0
 public static ITEA Create(TeaTypes type, TeaKey key) => Factory.Create(type, key);
Exemplo n.º 4
0
 public static ITEA Create(TeaTypes type, byte[] pwd) => Factory.Create(type, pwd);
Exemplo n.º 5
0
 public static ITEA Create(TeaTypes type, string pwd, Encoding encoding = null) => Factory.Create(type, pwd, encoding);
Exemplo n.º 6
0
 public static ITEA Create(TeaTypes type) => Factory.Create(type);