crypto

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 24, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Copyright (c) 2024 Eli Janssen Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Copyright (c) 2024 Eli Janssen Use of this source code is governed by an MIT-style license that can be found in the LICENSE file.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHash         = fmt.Errorf("argon2 invalid hash")
	ErrIncompatibleVersion = fmt.Errorf("argon2 incompatible version")
)

Functions

func CheckPWHash

func CheckPWHash(pwHash, rawPw []byte) (bool, error)

func HashPW

func HashPW(rawPw []byte) ([]byte, error)

Types

type HMACer

type HMACer interface {
	Validate(message, messageMAC []byte) bool
	Generate(message []byte) []byte
}

type MAC

type MAC struct {
	// contains filtered or unexported fields
}

keyed MAC using blake3 similar to HMAC(SHA256), but simpler and faster (while offering similar security)

func NewMAC

func NewMAC(key []byte) *MAC

func (*MAC) Generate

func (h *MAC) Generate(message []byte) []byte

func (*MAC) Validate

func (h *MAC) Validate(message, messageMAC []byte) bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL