error[E0599]: no method named `read_biguint` found for type `yasna::reader::BERReader<'_, '_>` in the current scope
--> src/sm2/signature.rs:44:39
|
44 | let r = reader.next().read_biguint()?;
| ^^^^^^^^^^^^
error[E0599]: no method named `read_biguint` found for type `yasna::reader::BERReader<'_, '_>` in the current scope
--> src/sm2/signature.rs:45:39
|
45 | let s = reader.next().read_biguint()?;
| ^^^^^^^^^^^^
error[E0599]: no method named `write_biguint` found for type `yasna::writer::DERWriter<'_>` in the current scope
--> src/sm2/signature.rs:78:31
|
78 | writer.next().write_biguint(&self.r);
| ^^^^^^^^^^^^^
error[E0599]: no method named `write_biguint` found for type `yasna::writer::DERWriter<'_>` in the current scope
--> src/sm2/signature.rs:79:31
|
79 | writer.next().write_biguint(&self.s);
| ^^^^^^^^^^^^^
error: aborting due to 4 previous errors
my code
use yasna;
pub fn der_decode(buf: &[u8]) -> Result<Signature, yasna::ASN1Error> {
let (r, s) = yasna::parse_der(buf, |reader| {
reader.read_sequence(|reader| {
let r = reader.next().read_biguint()?;
let s = reader.next().read_biguint()?;
Ok((r, s))
})
})?;
Ok(Signature { r, s })
}
pub fn der_encode(&self) -> Vec<u8> {
yasna::construct_der(|writer| {
writer.write_sequence(|writer| {
writer.next().write_biguint(&self.r);
writer.next().write_biguint(&self.s);
})
})
}
abort by error
my code