Skip to content

Commit

Permalink
sigh
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Dec 17, 2024
1 parent c64c8ec commit d755f51
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/pkcs1v15/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,12 @@ impl TryFrom<&[u8]> for Signature {

fn try_from(bytes: &[u8]) -> signature::Result<Self> {
let len = bytes.len();
let inner = BoxedUint::from_be_slice(bytes, len as u32 * 8)
let inner = BoxedUint::from_be_slice(bytes, len as u32 * 8);
#[cfg(feature = "std")]
let inner = inner
.map_err(|e| Box::new(e) as Box<dyn core::error::Error + Send + Sync + 'static>)?;
#[cfg(not(feature = "std"))]
let inner = inner.map_err(|_| signature::Error::new())?;

Ok(Self { inner })
}
Expand Down
7 changes: 6 additions & 1 deletion src/pss/signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,13 @@ impl TryFrom<&[u8]> for Signature {

fn try_from(bytes: &[u8]) -> signature::Result<Self> {
let len = bytes.len();
let inner = BoxedUint::from_be_slice(bytes, len as u32 * 8)
let inner = BoxedUint::from_be_slice(bytes, len as u32 * 8);

#[cfg(feature = "std")]
let inner = inner
.map_err(|e| Box::new(e) as Box<dyn core::error::Error + Send + Sync + 'static>)?;
#[cfg(not(feature = "std"))]
let inner = inner.map_err(|_| signature::Error::new())?;

Ok(Self { inner })
}
Expand Down

0 comments on commit d755f51

Please sign in to comment.