Skip to content

Commit fdd5d46

Browse files
move crypto types to folder
1 parent f38ba7c commit fdd5d46

File tree

6 files changed

+30
-16
lines changed

6 files changed

+30
-16
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Copyright (c) 2025 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
pub mod passkey;
5+
pub mod simple;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Copyright (c) 2025 IOTA Stiftung
2+
// SPDX-License-Identifier: Apache-2.0
3+
4+
use iota_crypto::Verifier;
5+
6+
use crate::{
7+
error::Result,
8+
types::{crypto::passkey::PasskeyAuthenticator, signature::SimpleSignature},
9+
};
10+
11+
#[derive(uniffi::Object)]
12+
pub struct PasskeyVerifier(iota_crypto::passkey::PasskeyVerifier);
13+
14+
#[uniffi::export]
15+
impl PasskeyVerifier {
16+
#[uniffi::constructor]
17+
pub fn new() -> Self {
18+
Self(iota_crypto::passkey::PasskeyVerifier::new())
19+
}
20+
21+
pub fn verify(&self, message: &[u8], authenticator: &PasskeyAuthenticator) -> Result<()> {
22+
Ok(self.0.verify(message, &authenticator.0)?)
23+
}
24+
}

crates/iota-sdk-ffi/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@
106106
#![expect(unused)]
107107
#![allow(clippy::wrong_self_convention)]
108108

109+
mod crypto;
109110
mod error;
110111
mod faucet;
111112
mod graphql;

crates/iota-sdk-ffi/src/types/crypto/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
pub mod multisig;
55
pub mod passkey;
6-
pub mod simple;
76
pub mod validator;
87
pub mod zklogin;
98

crates/iota-sdk-ffi/src/types/crypto/passkey.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,3 @@ impl PasskeyAuthenticator {
6666
self.0.signature().into()
6767
}
6868
}
69-
70-
#[derive(uniffi::Object)]
71-
pub struct PasskeyVerifier(iota_crypto::passkey::PasskeyVerifier);
72-
73-
#[uniffi::export]
74-
impl PasskeyVerifier {
75-
#[uniffi::constructor]
76-
pub fn new() -> Self {
77-
Self(iota_crypto::passkey::PasskeyVerifier::new())
78-
}
79-
80-
pub fn verify(&self, message: &[u8], authenticator: &PasskeyAuthenticator) -> Result<()> {
81-
Ok(self.0.verify(message, &authenticator.0)?)
82-
}
83-
}

0 commit comments

Comments
 (0)