Skip to content

olehmisar/noir_webauthn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Noir WebAuthn

Provides webauthn::verify_signature function that verifies a WebAuthn signature(also called passkey signature).

Installation

In your Nargo.toml file, add the version of this library you would like to install under dependency:

[dependencies]
webauthn = { tag = "v0.36.0", git = "https://github.com/olehmisar/noir_webauthn" }
Note on version compatibility with Noir

The version of this library matches the version of Noir. The patch version may be different if a bugfix or a new feature is added for the same version of Noir. E.g., this library version v0.36.0 and this library version v0.36.1 are compatible with noir@v0.36.0.

Usage

let result = webauthn::verify_signature(
    // [u8; 32] - x coordinate of WebAuthn public key generated by `credentials.create`
    public_key_x,
    // [u8; 32] - y coordinate of WebAuthn public key generated by `credentials.create`
    public_key_y,
    // [u8; 64] - signature generated by `credentials.get`
    signature,
    // BoundedVec<u8, 256> - clientDataJSON generated `credentials.get`
    client_data_json,
    // BoundedVec<u8, 64> - authenticatorData generated `credentials.get`
    authenticator_data,
    // [u8; 32] - challenge generated `credentials.get`
    challenge,
    // u32 - index of challenge in clientDataJSON
    challenge_index,
);
assert(result, "webauthn signature verification failed");

Benchmarks

TODO