BlockXor() static private method

static private BlockXor ( byte src, int s_offset, int len, byte dest, int d_offset ) : void
src byte
s_offset int
len int
dest byte
d_offset int
return void
Ejemplo n.º 1
0
        public void EncryptCBC(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
        {
            int nBlocks = inputLen / 8;

            for (int bc = 0; bc < nBlocks; bc++)
            {
                CipherUtil.BlockXor(input, inputOffset, 8, _iv, 0);
                BlockEncrypt(_iv, 0, output, outputOffset);
                Array.Copy(output, outputOffset, _iv, 0, 8);
                inputOffset  += 8;
                outputOffset += 8;
            }
        }
Ejemplo n.º 2
0
        public void encryptCBC(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
        {
            int nBlocks = inputLen / BLOCK_SIZE;

            for (int bc = 0; bc < nBlocks; bc++)
            {
                CipherUtil.BlockXor(input, inputOffset, BLOCK_SIZE, IV, 0);
                blockEncrypt(IV, 0, output, outputOffset);
                Array.Copy(output, outputOffset, IV, 0, BLOCK_SIZE);
                inputOffset  += BLOCK_SIZE;
                outputOffset += BLOCK_SIZE;
            }
        }
Ejemplo n.º 3
0
        public void encryptCBC(byte[] input, int inputOffset, int inputLen, byte[] output, int outputOffset)
        {
            int block_size = GetBlockSize();
            int nBlocks    = inputLen / block_size;

            for (int bc = 0; bc < nBlocks; bc++)
            {
                CipherUtil.BlockXor(input, inputOffset, block_size, _IV, 0);
                blockEncrypt(_IV, 0, output, outputOffset);
                Array.Copy(output, outputOffset, _IV, 0, block_size);
                inputOffset  += block_size;
                outputOffset += block_size;
            }
        }