I am using the bindings here to do secp256k1 functions in Swift. I have the following code:
let pubkeyTxt = "036c1495224d8b6245ca35df958127dc3d587ff7e9d8e1e5f964b312dc5ea3aac9"
let pubArray: [UInt8] = Array(pubkeyTxt.utf8)
var pubkey = secp256k1_pubkey()
let pubBool = secp256k1_ec_pubkey_parse(ctx!, &pubkey, pubArray, pubArray.count)
if pubBool == 0 {
print("Could not parse the public key")
return
}
which keeps printing that it could not parse the public key. I can't figure out what's wrong. My hunch was the pubArray.count was the wrong length for the function so I tried some other values, but with no luck.