It is modelled after the pseudorandom function from RFC4346 (TLS 1.1), the only significant change is the use of SHA512 and Whirlpool instead of MD5 and SHA1.