1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
use Future;
use crate::;
/// Chain-specific signature verifier.
///
/// Implementors live in companion crates (`siwx-evm`, `siwx-svm`, …).
/// Verification is async to accommodate on-chain checks (e.g. EIP-1271);
/// purely computational verifiers (EIP-191, Ed25519) simply wrap their
/// synchronous logic in `async {}`.
///
/// # Contract
///
/// * Return `Ok(())` when the signature is **valid** for the given message.
/// * Return `Err(SiwxError::VerificationFailed(..))` when the signature is
/// **cryptographically invalid**.
/// * Return other `Err` variants for malformed inputs.