hash

package
v2.0.0-...-6b5deca Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package hash provides TLS HashAlgorithm as defined in TLS 1.2

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Algorithms

func Algorithms() map[Algorithm]struct{}

Algorithms returns all the supported Hash Algorithms

Types

type Algorithm

type Algorithm uint16

Algorithm is used to indicate the hash algorithm used https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-18

const (
	None    Algorithm = 0 // Blacklisted
	MD5     Algorithm = 1 // Blacklisted
	SHA1    Algorithm = 2 // Blacklisted
	SHA224  Algorithm = 3
	SHA256  Algorithm = 4
	SHA384  Algorithm = 5
	SHA512  Algorithm = 6
	Ed25519 Algorithm = 8
)

Supported hash algorithms

func (Algorithm) CryptoHash

func (a Algorithm) CryptoHash() crypto.Hash

CryptoHash returns the crypto.Hash implementation for the given HashAlgorithm

func (Algorithm) Digest

func (a Algorithm) Digest(b []byte) []byte

Digest performs a digest on the passed value

func (Algorithm) Insecure

func (a Algorithm) Insecure() bool

Insecure returns if the given HashAlgorithm is considered secure in DTLS 1.2

func (Algorithm) String

func (a Algorithm) String() string

String makes hashAlgorithm printable

Jump to

Keyboard shortcuts

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