| 432 | } |
| 433 | |
| 434 | uint8_t Secp256K1::GetByte(std::string &str, int idx) { |
| 435 | |
| 436 | char tmp[3]; |
| 437 | int val; |
| 438 | |
| 439 | tmp[0] = str.data()[2 * idx]; |
| 440 | tmp[1] = str.data()[2 * idx + 1]; |
| 441 | tmp[2] = 0; |
| 442 | |
| 443 | if (sscanf(tmp, "%X", &val) != 1) { |
| 444 | printf("ParsePublicKeyHex: Error invalid public key specified (unexpected hexadecimal digit)\n"); |
| 445 | exit(-1); |
| 446 | } |
| 447 | |
| 448 | return (uint8_t)val; |
| 449 | |
| 450 | } |
| 451 | |
| 452 | Point Secp256K1::ParsePublicKeyHex(std::string str,bool &isCompressed) { |
| 453 |