Open sydhds opened 1 year ago
In a SC, we can only pass string (for digest argument) to the function:
isSignatureValid( digest: string, signature: string, publicKey: string, ): bool;
in massa-sc-runtime, the digest argument is indeed read as a string then directly converted to a string as the massa function impl is defined as:
fn signature_verify(&self, data: &[u8], signature: &str, public_key: &str) -> Result<bool>
this prevents from verifying sig on binary data and should be changed on massa-sc-runtime && massa-as-sdk.
Bonus:
As a workaround, for now, you can verify only strings by encoding your binary data to like base64 before giving it to the verify function?
In a SC, we can only pass string (for digest argument) to the function:
in massa-sc-runtime, the digest argument is indeed read as a string then directly converted to a string as the massa function impl is defined as:
this prevents from verifying sig on binary data and should be changed on massa-sc-runtime && massa-as-sdk.
Bonus: