コード例 #1
0
        private byte[] GetCounterBlock(long blockCounter)
        {
            if (_cachedIv == null)
            {
                _cachedIv = _algorithm.IV();
            }

            byte[] counterBytes = blockCounter.GetBigEndianBytes();
            byte[] counterBlock = ((byte[])_cachedIv.Clone()).Xor(_cachedIv.Length - counterBytes.Length, counterBytes, 0, counterBytes.Length);
            return(counterBlock);
        }