split :: (ByteArray ba, HashAlgorithm hash, DRG rng)=> hashHash algorithm to use as diffuser
-> rngRandom generator to use
-> IntNumber of times to diffuse the data.
-> baoriginal data to diffuse.
-> (ba, rng)The diffused data
Split data to diffused data, using a random generator and an hash algorithm.
the diffused data will consist of random data for (expandTimes-1) then the last block will be xor of the accumulated random data diffused by the hash algorithm.
---------
orig -
---------
--------- ---------- --------------
rand1 - - rand2 - - orig ^ acc -
--------- ---------- --------------
where acc is : acc(n+1) = hash (n ++ rand(n)) ^ acc(n)