Trait sgxs::crypto::SgxRsaPubOps
source · pub trait SgxRsaPubOps {
type Error: Error;
// Required method
fn calculate_q1_q2(
&self,
s: &[u8]
) -> Result<(Vec<u8>, Vec<u8>), Self::Error>;
}
Required Associated Types§
Required Methods§
sourcefn calculate_q1_q2(&self, s: &[u8]) -> Result<(Vec<u8>, Vec<u8>), Self::Error>
fn calculate_q1_q2(&self, s: &[u8]) -> Result<(Vec<u8>, Vec<u8>), Self::Error>
Given a signature, compute
q1 = s^2 / n
q2 = (s^3 - q1*s*n) / n
where/
is integer division.
Returns (q1, q2)
in little-endian format.
§Panics
May panic if the input length is not 32, or if the key does not contain the private component.