mb-hmac

HMAC message authentication for MoonBit (HMAC-SHA256, HMAC-SHA512; native+WASM)

crypto
mac
hmac
hmac-sha256
hmac-sha512
moon add Tigls/mb-hmac@0.1.0
Download zip
Author
Version
0.1.0
License
Apache-2.0
Last updated
4 months ago
Downloads
142

Dependencies

README

#MB Crypto Mac Library

A cryptographic MAC (Message Authentication Code) library for secure message authentication.

#Features

  • Secure message authentication
  • Multiple MAC algorithm support
  • Easy-to-use API
  • Cross-platform compatibility

#Installation

# Add installation instructions here

#Usage

// Generate MAC
let mac = @hmac.generateMAC(message, key);

// Verify MAC
let isValid = @hmac.verifyMAC(message, key, mac);

#API Reference

#generateMAC(message, key)

Generates a MAC for the given message using the provided key.

#verifyMAC(message, key, mac)

Verifies a MAC against the message and key.

#License

MIT License

#Contributing

Pull requests are welcome. For major changes, please open an issue first.

#
generateMAC

fn generateMAC(message : Array[UInt], key : Array[UInt]) -> FixedArray[UInt]

#
generateMAC_bytes

fn generateMAC_bytes(message : Bytes, key : Bytes) -> FixedArray[UInt]

#
generateMAC_string

fn generateMAC_string(message : String, key : String) -> FixedArray[UInt]

#
hmac_sha256

fn hmac_sha256(message : Array[UInt], key : Array[UInt]) -> FixedArray[UInt]

#
hmac_sha256_bytes

fn hmac_sha256_bytes(message : Bytes, key : Bytes) -> FixedArray[UInt]

#
hmac_sha256_string

fn hmac_sha256_string(message : String, key : String) -> FixedArray[UInt]

#
hmac_sha512

fn hmac_sha512(message : Array[UInt], key : Array[UInt]) -> FixedArray[UInt]

#
hmac_sha512_bytes

fn hmac_sha512_bytes(message : Bytes, key : Bytes) -> FixedArray[UInt]

#
hmac_sha512_string

fn hmac_sha512_string(message : String, key : String) -> FixedArray[UInt]

#
verifyMAC

fn verifyMAC(message : Array[UInt], key : Array[UInt], mac : Array[UInt]) -> Bool

#
verifyMAC_bytes

fn verifyMAC_bytes(message : Bytes, key : Bytes, mac : Array[UInt]) -> Bool

#
verifyMAC_string

fn verifyMAC_string(message : String, key : String, mac : Array[UInt]) -> Bool

#
verify_hmac_sha256

fn verify_hmac_sha256(message : Array[UInt], key : Array[UInt], mac : Array[UInt]) -> Bool

#
verify_hmac_sha256_bytes

fn verify_hmac_sha256_bytes(message : Bytes, key : Bytes, mac : Array[UInt]) -> Bool

#
verify_hmac_sha512

fn verify_hmac_sha512(message : Array[UInt], key : Array[UInt], mac : Array[UInt]) -> Bool

#
verify_hmac_sha512_bytes

fn verify_hmac_sha512_bytes(message : Bytes, key : Bytes, mac : Array[UInt]) -> Bool

Source Files

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io