Skip to content

edjCase/motoko_hmac

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HMAC library for Motoko

A fork of herumi/ecdsa-motoko, providing HMAC-256 implementation.

Original Project Credits

License

Apache 2.0 with LLVM Exception

This project is a fork of the original ECDSA implementation by MITSUNARI Shigeo, maintaining the same license.

Installation

mops install hmac

To setup MOPS package manage, follow the instructions from the MOPS Site

API Reference

// Generate HMAC digest
public func generate(
    key : [Nat8],              // Key for HMAC
    msg : Iter.Iter<Nat8>,     // Message to hash
    algorithm : HashAlgorithm, // Hash algorithm to use
) : Blob                       // Returns HMAC digest as Blob

// Define available hash algorithms
public type HashAlgorithm = {
    #sha256;                                  // Standard SHA-256
    #custom : (Iter.Iter<Nat8>) -> Blob;      // Custom hash function
};

Changes from Original

Adapted it to use for the MOPS package manager

Original Project

If you'd like to support the original project:

About

Motoko library for HMAC generation and verification

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages