Example #1
0
File: Key.cs Project: Mijyuoon/MV2
        public Key(byte[] key)
        {
            BaseKDF kdf;

            switch ((KeySize)key.Length)
            {
            case KeySize.KNull:
                kdf = new NullKDF();
                break;

            case KeySize.K256:
                kdf = new KDF256(key);
                break;

            default:
                throw new ArgumentException("Invalid key length", nameof(key));
            }

            Data = new KeyData(kdf);
        }
Example #2
0
 public Encoder(Key key, int rounds = 16)
 {
     this.key    = key.Data;
     this.rounds = rounds;
 }
Example #3
0
 public Decoder(Key key)
 {
     this.key = key.Data;
 }