pub trait HashProvider {
// Required methods
fn hash(&self, data: &[u8]) -> [u8; 32];
fn name(&self) -> &'static str;
}Expand description
Hash provider trait for identity operations
This trait abstracts the hashing algorithm used for identity operations, following the Dependency Inversion Principle (DIP). The core identity logic depends on this abstraction rather than concrete implementations.
§Design Rationale
- Decoupling: Core identity logic doesn’t depend on Blake3 directly
- Testability: Can use mock hash providers in tests
- Flexibility: Easy to switch hash algorithms if needed
- Future-proofing: Supports quantum-resistant hashes in the future