Esempio n. 1
0
            public AEADResult Decrypt(ReadOnlySpan <byte> input, Span <byte> output)
            {
                // Don't consume what could be the tag
                var length = input.Length - _tagSize;

                // TODO round length up to BlockLength
                SecurityAssert.AssertInputOutputBuffers(input, output, length);

                for (var index = 0; index < length; index++)
                {
                    var t = input[index];
                    _buffer[_bufferOffset++] = t;

                    if (_bufferOffset == _blockSize)
                    {
                        output = DecryptBlock(output);
                    }
                }

                return(new AEADResult(input.Slice(length), output));
            }