Пример #1
0
        public void GlobalSetup()
        {
            this.data = new byte[this.DataLengthKb * 1024];
            new Random(31).NextBytes(data);
            this.key   = XChaChaKey.Generate();
            this.nonce = XChaChaNonce.Generate();
            var aeadCipher = new XChaChaAeadCipher();

            this.encryptedData       = new byte[aeadCipher.GetCipherTextLength(this.data.Length)];
            this.decryptOutputBuffer = new byte[aeadCipher.GetCipherTextLength(this.data.Length)];
            aeadCipher.Encrypt(data, this.encryptedData, this.key, this.nonce);
        }
Пример #2
0
        public void Encrypt()
        {
            var aeadCipher = new XChaChaAeadCipher();

            aeadCipher.Encrypt(data, this.encryptedData, this.key, this.nonce);
        }