Use functions from crypto-random and crypto-equality

Better to use dependencies than duplicate this functionality in Ring.