blake: full rewrite with a midstate cache

speed increase by 2 (same logic as i made in ccminer)

Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>