Hi,
I am trying to use the crate ecdsa - Rust for verifying ecdsa signatures. Specifically I am trying to load a signature using the below method,
ecdsa::Signature - Rust
Tried two methods to load some test data,
let buf1: [u8; 16] = [0x00, 0x42, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x30, 0x00, 0xc3, 0x00, 0x00];
let buf2: [u8; 16] = [0x00, 0x42, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0xc3, 0x00, 0x00, 0x30, 0x00, 0xc3, 0x00, 0x00];
let test_signature = Signature::from_scalars(buf1, buf2).unwrap();
let bytes2: GenericArray<u8, U16> = GenericArray::clone_from_slice(&buf2[0..16]);
let test_signature = Signature::from_scalars(bytes1, bytes2).unwrap();```
Both cases I get error:
the trait bound ```GenericArray<u8, UInt<UInt<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B0>, B0>, B0>, B0>>: From<[u8; 16]>``` is not satisfied
The implementation of the method looks like below, but I am finding it a bit difficult to understand how to pass r and s parameters to the method.
pub fn from_scalars(
r: impl Into<FieldBytes<C>>,
s: impl Into<FieldBytes<C>>,
) -> Result<Self, Error> {
Self::try_from(r.into().concat(s.into()).as_slice())
}
Any guidance will be of great help and much appreciated.