示例#1
0
文件: Key.cs 项目: 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);
        }
示例#2
0
文件: Encoder.cs 项目: Mijyuoon/MV2
 public Encoder(Key key, int rounds = 16)
 {
     this.key    = key.Data;
     this.rounds = rounds;
 }
示例#3
0
文件: Decoder.cs 项目: Mijyuoon/MV2
 public Decoder(Key key)
 {
     this.key = key.Data;
 }