Trait sgxs::crypto::SgxRsaOps[][src]

pub trait SgxRsaOps {
    type Error: Error;
    fn len(&self) -> usize;
fn sign_sha256_pkcs1v1_5_with_q1_q2<H: AsRef<[u8]>>(
        &self,
        hash: H
    ) -> Result<(Vec<u8>, Vec<u8>, Vec<u8>), Self::Error>;
fn verify_sha256_pkcs1v1_5<S: AsRef<[u8]>, H: AsRef<[u8]>>(
        &self,
        sig: S,
        hash: H
    ) -> Result<(), Self::Error>;
fn e(&self) -> Vec<u8>;
fn n(&self) -> Vec<u8>; }

Associated Types

Required methods

Return the number of bits in the RSA key

Generate an RSASSA-PKCS1-v1_5 signature over a SHA256 hash. Also compute

  • q1 = s^2 / n
  • q2 = (s^3 - q1*s*n) / n where / is integer division.

Returns (s, 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.

Verify an RSASSA-PKCS1-v1_5 signature s over a SHA256 hash.

Supply s in little-endian format.

Panics

May panic if the hash input length is not 32.

Retrieve the public key in little-endian format

Retrieve the modulus in little-endian format

Implementors