macro_rules! impl_certificate_ed25519 {
($subject:ty, $namespace:ty) => { ... };
}Expand description
Generates an Ed25519 signing scheme wrapper for a specific protocol.
This macro creates a complete wrapper struct with constructors, Scheme trait
implementation, and a fixture function for testing.
§Parameters
-
$subject: The subject type used asScheme::Subject<'a, D>. Use'aandDin the subject type to bind to the GAT lifetime and digest type parameters. -
$namespace: The namespace type that implementsNamespace. This type pre-computes and stores any protocol-specific namespace bytes derived from a base namespace. The scheme calls$namespace::derive(base)at construction time to create the namespace, then passes it toSubject::namespace()during signing and verification. For simple protocols with only a base namespace,Vec<u8>can be used directly. For protocols with multiple message types, a custom struct can pre-compute all variants.
§Example
// For non-generic subject types with a single namespace:
impl_certificate_ed25519!(MySubject, Vec<u8>);
// For protocols with generic subject types:
impl_certificate_ed25519!(Subject<'a, D>, Namespace);