Expand description
Cryptographic traits and UMSH-specific key/packet operations.
This crate separates algorithm providers from protocol logic. The low-level
traits such as AesProvider and Sha256Provider can be backed either by
software implementations or hardware accelerators, while CryptoEngine
implements the UMSH-specific derivation and packet-authentication rules.
§Example
use umsh_crypto::software::{SoftwareAes, SoftwareIdentity, SoftwareSha256};
use umsh_crypto::{CryptoEngine, NodeIdentity};
let alice = SoftwareIdentity::from_secret_bytes(&[0x11; 32]);
let bob = SoftwareIdentity::from_secret_bytes(&[0x22; 32]);
let shared = alice.shared_secret_with(bob.public_key()).unwrap();
let engine = CryptoEngine::new(SoftwareAes, SoftwareSha256);
let keys = engine.derive_pairwise_keys(&shared);
assert_ne!(keys.k_enc, [0u8; 16]);
assert_ne!(keys.k_mic, [0u8; 16]);Re-exports§
pub use software::*;
Modules§
Structs§
- Cmac
State - Incremental AES-CMAC state.
- Crypto
Engine - UMSH protocol crypto engine.
- Derived
Channel Keys - Derived multicast or channel transport keys.
- Pairwise
Keys - Derived pairwise transport keys.
- Shared
Secret - Raw X25519 shared secret.
Enums§
- Crypto
Error - Protocol-level crypto failures.
Traits§
- AesCipher
- AES block-cipher instance used by the protocol engine.
- AesProvider
- Factory for keyed AES cipher instances.
- Node
Identity - Node identity capable of signing and key agreement.
- Sha256
Provider - SHA-256 and HMAC-SHA-256 provider.