Skip to content

Commit

Permalink
fixup! Use trussed-core and remove default features for trussed
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Jan 6, 2025
1 parent bc51ec0 commit c54b25b
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/crypto_traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ use crate::{RsaImportFormat, RsaPublicParts};

impl<C: CryptoClient> Rsa2048Pkcs1v15 for C {}

/// Helper trait to work with RSA 2048 bit keys through a [`Client`](trussed::Client)
/// Helper trait to work with RSA 2048 bit keys through a [`CryptoClient`][]
///
/// This trait is implemented by all implementors of [`CryptoClient`](trussed::client::CryptoClient)
/// This trait is implemented by all implementors of [`CryptoClient`][]
pub trait Rsa2048Pkcs1v15: CryptoClient {
fn generate_rsa2048pkcs_private_key(
&mut self,
Expand All @@ -45,13 +45,13 @@ pub trait Rsa2048Pkcs1v15: CryptoClient {

/// Serializes an RSA 2048 bit key.
///
/// The resulting [`serialized_key`](trussed::api::reply::SerializeKey::serialized_key) contains a buffer of the parts of the key
/// The resulting [`serialized_key`](trussed_core::api::reply::SerializeKey::serialized_key) contains a buffer of the parts of the key
/// as a serialized [`RsaPublicParts`](crate::RsaPublicParts):
/// ```
///# #[cfg(feature = "virt")]
///# {
///# use trussed_rsa_alloc::*;
///# use trussed::{syscall,types::Location::{Volatile,Internal}};
///# use trussed_core::{syscall,types::Location::{Volatile,Internal}};
///# virt::with_ram_client("rsa tests", |mut client| {
///# let sk = syscall!(client.generate_rsa2048pkcs_private_key(Internal)).key;
///# let pk = syscall!(client.derive_rsa2048pkcs_public_key(sk, Volatile)).key;
Expand Down Expand Up @@ -159,9 +159,9 @@ pub trait Rsa2048Pkcs1v15: CryptoClient {

impl<C: CryptoClient> Rsa3072Pkcs1v15 for C {}

/// Helper trait to work with RSA 3072 bit keys through a [`Client`](trussed::Client)
/// Helper trait to work with RSA 3072 bit keys through a [`CryptoClient`][]
///
/// This trait is implemented by all implementors of [`CryptoClient`](trussed::client::CryptoClient)
/// This trait is implemented by all implementors of [`CryptoClient`][]
pub trait Rsa3072Pkcs1v15: CryptoClient {
fn generate_rsa3072pkcs_private_key(
&mut self,
Expand All @@ -188,13 +188,13 @@ pub trait Rsa3072Pkcs1v15: CryptoClient {

/// Serializes an RSA 3072 bit key.
///
/// The resulting [`serialized_key`](trussed::api::reply::SerializeKey::serialized_key) contains a buffer of the parts of the key
/// The resulting [`serialized_key`](trussed_core::api::reply::SerializeKey::serialized_key) contains a buffer of the parts of the key
/// as a serialized [`RsaPublicParts`](crate::RsaPublicParts):
/// ```
///# #[cfg(feature = "virt")]
///# {
///# use trussed_rsa_alloc::*;
///# use trussed::{syscall,types::Location::{Volatile,Internal}};
///# use trussed_core::{syscall,types::Location::{Volatile,Internal}};
///# virt::with_ram_client("rsa tests", |mut client| {
///# let sk = syscall!(client.generate_rsa3072pkcs_private_key(Internal)).key;
///# let pk = syscall!(client.derive_rsa3072pkcs_public_key(sk, Volatile)).key;
Expand Down Expand Up @@ -302,9 +302,9 @@ pub trait Rsa3072Pkcs1v15: CryptoClient {

impl<C: CryptoClient> Rsa4096Pkcs1v15 for C {}

/// Helper trait to work with RSA 4096 bit keys through a [`Client`](trussed::Client)
/// Helper trait to work with RSA 4096 bit keys through a [`CryptoClient`][]
///
/// This trait is implemented by all implementors of [`CryptoClient`](trussed::client::CryptoClient)
/// This trait is implemented by all implementors of [`CryptoClient`][]
pub trait Rsa4096Pkcs1v15: CryptoClient {
fn generate_rsa4096pkcs_private_key(
&mut self,
Expand All @@ -331,13 +331,13 @@ pub trait Rsa4096Pkcs1v15: CryptoClient {

/// Serializes an RSA 4096 bit key.
///
/// The resulting [`serialized_key`](trussed::api::reply::SerializeKey::serialized_key) contains a buffer of the parts of the key
/// The resulting [`serialized_key`](trussed_core::api::reply::SerializeKey::serialized_key) contains a buffer of the parts of the key
/// as a serialized [`RsaPublicParts`](crate::RsaPublicParts):
/// ```
///# #[cfg(feature = "virt")]
///# {
///# use trussed_rsa_alloc::*;
///# use trussed::{syscall,types::Location::{Volatile,Internal}};
///# use trussed_core::{syscall,types::Location::{Volatile,Internal}};
///# virt::with_ram_client("rsa tests", |mut client| {
///# let sk = syscall!(client.generate_rsa4096pkcs_private_key(Internal)).key;
///# let pk = syscall!(client.derive_rsa4096pkcs_public_key(sk, Volatile)).key;
Expand Down

0 comments on commit c54b25b

Please sign in to comment.