Helper: parse a hex string into a PublicKey (array )
| 33 | |
| 34 | // Helper: parse a hex string into a PublicKey (array<uint8_t, 32>) |
| 35 | static PublicKey parsePublicKeyFromHex(const std::string &hex) { |
| 36 | std::vector<uint8_t> bytes = fromHex(hex); |
| 37 | if (bytes.size() != 32) |
| 38 | throw std::runtime_error("Invalid pubkey length"); |
| 39 | PublicKey arr; |
| 40 | std::copy(bytes.begin(), bytes.end(), arr.begin()); |
| 41 | return arr; |
| 42 | } |
| 43 | |
| 44 | // Helper: parse a hex string into a WinternitzAddress (64-byte format: 32-byte |
| 45 | // publicSeed + 32-byte publicKeyHash) |