The below code signs a string "123" and then called recover .. for some reason the key returned does not match the expected key. Please explain or flag as bug.
The output of the below looks as follows:
123
SIG_K1_K1K6bCbJ9AqxYgeYLGxqtG4MhiyBodTqGsjEeeGcguBTWpBEg54rywEGkNUYbn9uPF7QtCUo9sD8XKd7By3FbJDd78cY9m
recovered key: EOS5Q36JqHkTrsBuEufZTFLgKn7YQ582ew6STCFWmwVTuEFEgERec
function recoverTest() {
var initaPrivate = '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3';
var initaPublic = 'EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV';
var action = document.getElementById('transaction').value;
console.log(action);
var sign = ecc.sign(action, initaPrivate ,'hex').toString();
console.log(sign);
var recover = ecc.recover(sign, action);
console.log("recovered key: "+recover);
}
The below code signs a string "123" and then called recover .. for some reason the key returned does not match the expected key. Please explain or flag as bug.
The output of the below looks as follows: 123 SIG_K1_K1K6bCbJ9AqxYgeYLGxqtG4MhiyBodTqGsjEeeGcguBTWpBEg54rywEGkNUYbn9uPF7QtCUo9sD8XKd7By3FbJDd78cY9m recovered key: EOS5Q36JqHkTrsBuEufZTFLgKn7YQ582ew6STCFWmwVTuEFEgERec