Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/olehmisar/noir_webauthn


https://github.com/olehmisar/noir_webauthn

Last synced: 19 days ago
JSON representation

Awesome Lists containing this project

README

        

# 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:

```toml
[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 [email protected].

## Usage

```rs
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 - clientDataJSON generated `credentials.get`
client_data_json,
// BoundedVec - 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