https://github.com/olehmisar/noir_webauthn
Verify a WebAuthn/Passkey signature in Noir
https://github.com/olehmisar/noir_webauthn
Last synced: about 1 month ago
JSON representation
Verify a WebAuthn/Passkey signature in Noir
- Host: GitHub
- URL: https://github.com/olehmisar/noir_webauthn
- Owner: olehmisar
- License: apache-2.0
- Created: 2024-10-24T12:24:13.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-03-12T00:12:44.000Z (about 1 month ago)
- Last Synced: 2025-03-12T01:19:38.855Z (about 1 month ago)
- Language: Noir
- Homepage:
- Size: 17.6 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-noir - WebAuthn/Passkeys - Verification of WebAuthn/Passkeys signatures; verifies signatures produced by `credentials.get` (Libraries / Cryptography)
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.37.0", git = "https://github.com/olehmisar/noir_webauthn" }
```## 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