Function zk_pass::client::execute_protocol
source · pub async fn execute_protocol<T, P, S>(
params: &GroupParams<P>,
x: &T::Secret,
user: &String,
client: &mut AuthClientLib
) -> Result<(), Box<dyn Error>>where
T: ChaumPedersen<GroupParameters = GroupParams<P>, CommitParameters = (P, P, P, P), Response = S, Challenge = S>,
P: ByteConvertible<P> + RandomGenerator<P>,
S: ByteConvertible<S> + RandomGenerator<S>,
Expand description
Executes the Chaum-Pedersen protocol for client authentication.
This function handles the client side of the Chaum-Pedersen protocol, including registering the commitment, creating an authentication challenge, and verifying the authentication response.
Type Parameters
T
: The type of Chaum-Pedersen protocol (either Discrete Log or Elliptic Curve).P
: The type of the group parameters (eitherBigUint
for Discrete Log orRistrettoPoint
for Elliptic Curve).S
: The type of the response and challenge (usuallyBigUint
).
Arguments
params
- Group parameters for the cryptographic operations.x
- The secret value used in the protocol.user
- The username for authentication.client
- The client object for communication with the ZKPass server.
Returns
Returns a Result
which is Ok(())
on successful execution or an error
if any part of the process fails.