Scrypt, SHA256 and CryptoNight optimization