I am receiving as input a private key string and a random string. Goal is to get public key and address.
When I am receiving the string I do:
var hash = Crypto.util.hexToBytes(privStr);
this.priv = new BigInteger(hash);
A random string:
var hash = keccak256.array(suppliedKey);
this.priv = new BigInteger(hash);
On both randomly work, am I doing it correctly?
UPDATE 1. In first case my issue was I was not appending "0x" as prefix of the string.