// This function is defined as follow :
// Func (S, i) = HMAC(S || i) | HMAC2(S || i) | ... | HMAC(iterations) (S || i)
// where i is the block number.
private byte[] Func()
{
byte[] INT_block = Utils.Int(m_block);
m_hmacsha1.TransformBlock(m_salt, 0, m_salt.Length, null, 0);
m_hmacsha1.TransformBlock(INT_block, 0, INT_block.Length, null, 0);
m_hmacsha1.TransformFinalBlock(EmptyArray <Byte> .Value, 0, 0);
byte[] temp = m_hmacsha1.HashValue;
m_hmacsha1.Initialize();
byte[] ret = temp;
for (int i = 2; i <= m_iterations; i++)
{
m_hmacsha1.TransformBlock(temp, 0, temp.Length, null, 0);
m_hmacsha1.TransformFinalBlock(EmptyArray <Byte> .Value, 0, 0);
temp = m_hmacsha1.HashValue;
for (int j = 0; j < BlockSize; j++)
{
ret[j] ^= temp[j];
}
m_hmacsha1.Initialize();
}
// increment the block count.
m_block++;
return(ret);
}