Skip to content

0xnonso/noir-hmac-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Noir Hmac Auth

Noir License: MIT

This project implements HMAC (Hash-Based Message Authentication Code) authentication using a generic interface for supported hash algorithm.

Usage

In your Nargo.toml file, add the following dependency:

[dependencies]
hmac = { git = "https://github.com/0xnonso/noir-hmac-auth" }

Then use it in your Noir project like this:

use dep::hmac::types::HHSha256;
use dep::hmac::types::HmacHasherSha256;

fn main(key: [u8; 40], message: [u8; 128], expected_mac_tag: [u8; 32]) {
    let H: HHSha256 = HmacHasherSha256 {};
    assert(expected_mac_tag == H.hmac(key, message));
}

About

HMAC authentication library in noir

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages