algorithm

package
v0.0.0-...-f0a77d2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AeadAlgorithm

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

func (*AeadAlgorithm) GetAeadDefaultLengthTag

func (a *AeadAlgorithm) GetAeadDefaultLengthTag() *AeadAlgorithmDefaultLengthTag

func (*AeadAlgorithm) GetAeadShortenedTag

func (a *AeadAlgorithm) GetAeadShortenedTag() *AeadAlgorithmShortenedTag

func (*AeadAlgorithm) ToWireInterface

func (a *AeadAlgorithm) ToWireInterface() interface{}

type AeadAlgorithmDefaultLengthTag

type AeadAlgorithmDefaultLengthTag struct {
	AeadAlg AeadAlgorithmType
}

func (*AeadAlgorithmDefaultLengthTag) ToWireInterface

func (a *AeadAlgorithmDefaultLengthTag) ToWireInterface() interface{}

type AeadAlgorithmShortenedTag

type AeadAlgorithmShortenedTag struct {
	AeadAlg   AeadAlgorithmType
	TagLength uint32
}

func (*AeadAlgorithmShortenedTag) ToWireInterface

func (a *AeadAlgorithmShortenedTag) ToWireInterface() interface{}

type AeadAlgorithmType

type AeadAlgorithmType uint32
const (
	AeadAlgorithmNODEFAULTTAG     AeadAlgorithmType = 0
	AeadAlgorithmCCM              AeadAlgorithmType = 1
	AeadAlgorithmGCM              AeadAlgorithmType = 2
	AeadAlgorithmChacha20Poly1305 AeadAlgorithmType = 4
)

type AeadFactory

type AeadFactory interface {
	Aead(algType AeadAlgorithmType) *Algorithm
	AeadShortenedTag(algType AeadAlgorithmType, tagLength uint32) *Algorithm
}

func NewAead

func NewAead() AeadFactory

type Algorithm

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

func NewAlgorithmFromWireInterface

func NewAlgorithmFromWireInterface(op interface{}) (*Algorithm, error)

func NewCipher

func NewCipher(mode CipherModeType) *Algorithm

func NewHashAlgorithm

func NewHashAlgorithm(h HashAlgorithmType) *Algorithm

func (*Algorithm) GetAead

func (a *Algorithm) GetAead() *AeadAlgorithm

func (*Algorithm) GetAsymmetricEncryption

func (a *Algorithm) GetAsymmetricEncryption() *AsymmetricEncryptionAlgorithm

func (*Algorithm) GetAsymmetricSignature

func (a *Algorithm) GetAsymmetricSignature() *AsymmetricSignatureAlgorithm

func (*Algorithm) GetCipher

func (a *Algorithm) GetCipher() *Cipher

func (*Algorithm) GetHash

func (a *Algorithm) GetHash() *HashAlgorithm

func (*Algorithm) ToWireInterface

func (a *Algorithm) ToWireInterface() interface{}

type AsymmetricEncryptionAlgorithm

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

func (*AsymmetricEncryptionAlgorithm) GetRsaOaep

func (*AsymmetricEncryptionAlgorithm) GetRsaPkcs1V15Crypt

func (*AsymmetricEncryptionAlgorithm) ToWireInterface

func (a *AsymmetricEncryptionAlgorithm) ToWireInterface() interface{}

type AsymmetricEncryptionFactory

type AsymmetricEncryptionFactory interface {
	RsaPkcs1V15Crypt() *Algorithm
	RsaOaep(hashAlg HashAlgorithmType) *Algorithm
}

func NewAsymmetricEncryption

func NewAsymmetricEncryption() AsymmetricEncryptionFactory

type AsymmetricEncryptionRsaOaep

type AsymmetricEncryptionRsaOaep struct {
	HashAlg HashAlgorithmType
}

func (*AsymmetricEncryptionRsaOaep) ToWireInterface

func (a *AsymmetricEncryptionRsaOaep) ToWireInterface() interface{}

type AsymmetricEncryptionRsaPkcs1V15Crypt

type AsymmetricEncryptionRsaPkcs1V15Crypt struct {
}

func (*AsymmetricEncryptionRsaPkcs1V15Crypt) ToWireInterface

func (a *AsymmetricEncryptionRsaPkcs1V15Crypt) ToWireInterface() interface{}

type AsymmetricSignatureAlgorithm

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

*AsymmetricSignatureRsaPkcs1V15Sign *AsymmetricSignatureRsaPkcs1V15SignRaw *AsymmetricSignatureRsaPss *AsymmetricSignatureEcdsa *AsymmetricSignatureEcdsaAny *AsymmetricSignatureDeterministicEcdsa

func (*AsymmetricSignatureAlgorithm) GetDeterministicEcdsa

func (*AsymmetricSignatureAlgorithm) GetEcdsa

func (*AsymmetricSignatureAlgorithm) GetEcdsaAny

func (*AsymmetricSignatureAlgorithm) GetRsaPkcs1V15Sign

func (*AsymmetricSignatureAlgorithm) GetRsaPkcs1V15SignRaw

func (*AsymmetricSignatureAlgorithm) GetRsaPss

func (*AsymmetricSignatureAlgorithm) ToWireInterface

func (a *AsymmetricSignatureAlgorithm) ToWireInterface() interface{}

type AsymmetricSignatureDeterministicEcdsa

type AsymmetricSignatureDeterministicEcdsa struct {
	SignHash *AsymmetricSignatureSignHash
}

func (*AsymmetricSignatureDeterministicEcdsa) ToWireInterface

func (a *AsymmetricSignatureDeterministicEcdsa) ToWireInterface() interface{}

type AsymmetricSignatureEcdsa

type AsymmetricSignatureEcdsa struct {
	SignHash *AsymmetricSignatureSignHash
}

func (*AsymmetricSignatureEcdsa) ToWireInterface

func (a *AsymmetricSignatureEcdsa) ToWireInterface() interface{}

type AsymmetricSignatureEcdsaAny

type AsymmetricSignatureEcdsaAny struct {
}

func (*AsymmetricSignatureEcdsaAny) ToWireInterface

func (a *AsymmetricSignatureEcdsaAny) ToWireInterface() interface{}

type AsymmetricSignatureFactory

type AsymmetricSignatureFactory interface {
	RsaPkcs1V15Sign(hashAlg HashAlgorithmType) *Algorithm
	RsaPkcs1V15SignAny() *Algorithm
	RsaPkcs1V15SignRaw() *Algorithm
	RsaPss(hashAlg HashAlgorithmType) *Algorithm
	RsaPssAny() *Algorithm
	Ecdsa(hashAlg HashAlgorithmType) *Algorithm
	EcdsaAny() *Algorithm
	DeterministicEcdsa(hashAlg HashAlgorithmType) *Algorithm
	DeterministicEcdsaAny() *Algorithm
}

func NewAsymmetricSignature

func NewAsymmetricSignature() AsymmetricSignatureFactory

type AsymmetricSignatureRsaPkcs1V15Sign

type AsymmetricSignatureRsaPkcs1V15Sign struct {
	SignHash *AsymmetricSignatureSignHash
}

func (*AsymmetricSignatureRsaPkcs1V15Sign) ToWireInterface

func (a *AsymmetricSignatureRsaPkcs1V15Sign) ToWireInterface() interface{}

type AsymmetricSignatureRsaPkcs1V15SignRaw

type AsymmetricSignatureRsaPkcs1V15SignRaw struct {
}

func (*AsymmetricSignatureRsaPkcs1V15SignRaw) ToWireInterface

func (a *AsymmetricSignatureRsaPkcs1V15SignRaw) ToWireInterface() interface{}

type AsymmetricSignatureRsaPss

type AsymmetricSignatureRsaPss struct {
	SignHash *AsymmetricSignatureSignHash
}

func (*AsymmetricSignatureRsaPss) ToWireInterface

func (a *AsymmetricSignatureRsaPss) ToWireInterface() interface{}

type AsymmetricSignatureSignHash

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

func (*AsymmetricSignatureSignHash) GetAny

func (*AsymmetricSignatureSignHash) GetSpecific

type AsymmetricSignatureSignHashAny

type AsymmetricSignatureSignHashAny struct{}

type AsymmetricSignatureSignHashSpecific

type AsymmetricSignatureSignHashSpecific struct {
	HashAlg HashAlgorithmType
}

type Cipher

type Cipher struct {
	Mode CipherModeType
}

func (*Cipher) ToWireInterface

func (c *Cipher) ToWireInterface() interface{}

type CipherModeType

type CipherModeType int32
const (
	CipherModeCIPHERNONE   CipherModeType = 0 // This default variant should not be used.
	CipherModeSTREAMCIPHER CipherModeType = 1
	CipherModeCTR          CipherModeType = 2
	CipherModeCFB          CipherModeType = 3
	CipherModeOFB          CipherModeType = 4
	CipherModeXTS          CipherModeType = 5
	CipherModeECBNOPADDING CipherModeType = 6
	CipherModeCBCNOPADDING CipherModeType = 7
	CipherModeCBCPKCS7     CipherModeType = 8
)

type HashAlgorithm

type HashAlgorithm struct {
	HashAlg HashAlgorithmType
}

func (HashAlgorithm) String

func (a HashAlgorithm) String() string

func (*HashAlgorithm) ToWireInterface

func (a *HashAlgorithm) ToWireInterface() interface{}

type HashAlgorithmType

type HashAlgorithmType uint32
const (
	HashAlgorithmTypeNONE HashAlgorithmType = 0 // This default variant should not be used.
	// Deprecated: Do not use.
	HashAlgorithmTypeMD2 HashAlgorithmType = 1
	// Deprecated: Do not use.
	HashAlgorithmTypeMD4 HashAlgorithmType = 2
	// Deprecated: Do not use.
	HashAlgorithmTypeMD5       HashAlgorithmType = 3
	HashAlgorithmTypeRIPEMD160 HashAlgorithmType = 4
	// Deprecated: Do not use.
	HashAlgorithmTypeSHA1       HashAlgorithmType = 5
	HashAlgorithmTypeSHA224     HashAlgorithmType = 6
	HashAlgorithmTypeSHA256     HashAlgorithmType = 7
	HashAlgorithmTypeSHA384     HashAlgorithmType = 8
	HashAlgorithmTypeSHA512     HashAlgorithmType = 9
	HashAlgorithmTypeSHA512_224 HashAlgorithmType = 10
	HashAlgorithmTypeSHA512_256 HashAlgorithmType = 11
	HashAlgorithmTypeSHA3_224   HashAlgorithmType = 12
	HashAlgorithmTypeSHA3_256   HashAlgorithmType = 13
	HashAlgorithmTypeSHA3_384   HashAlgorithmType = 14
	HashAlgorithmTypeSHA3_512   HashAlgorithmType = 15
)

func (HashAlgorithmType) String

func (a HashAlgorithmType) String() string

type KeyAgreement

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

func (*KeyAgreement) GetRaw

func (a *KeyAgreement) GetRaw() *KeyAgreementRaw

func (*KeyAgreement) GetWithKeyDerivation

func (a *KeyAgreement) GetWithKeyDerivation() *KeyAgreementWithKeyDerivation

func (*KeyAgreement) ToWireInterface

func (a *KeyAgreement) ToWireInterface() interface{}

type KeyAgreementFactory

type KeyAgreementFactory interface {
	RawFFDH() *Algorithm
	RawECDH() *Algorithm
	FFDH(*KeyDerivation) *Algorithm
	ECDH(*KeyDerivation) *Algorithm
}

func NewKeyAgreement

func NewKeyAgreement() KeyAgreementFactory

type KeyAgreementRaw

type KeyAgreementRaw struct {
	RawAlg KeyAgreementRawType
}

func (*KeyAgreementRaw) ToWireInterface

func (a *KeyAgreementRaw) ToWireInterface() interface{}

type KeyAgreementRawType

type KeyAgreementRawType int32
const (
	KeyAgreementRAWNONE KeyAgreementRawType = 0 // This default variant should not be used.
	KeyAgreementFFDH    KeyAgreementRawType = 1
	KeyAgreementECDH    KeyAgreementRawType = 2
)

type KeyAgreementWithKeyDerivation

type KeyAgreementWithKeyDerivation struct {
	KaAlg         KeyAgreementRawType
	DerivationAlg *KeyDerivation
}

func (*KeyAgreementWithKeyDerivation) ToWireInterface

func (a *KeyAgreementWithKeyDerivation) ToWireInterface() interface{}

type KeyDerivation

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

func (*KeyDerivation) GetKeyDerivationHkdf

func (a *KeyDerivation) GetKeyDerivationHkdf() *KeyDerivationHkdf

func (*KeyDerivation) GetKeyDerivationTLS12Prf

func (a *KeyDerivation) GetKeyDerivationTLS12Prf() *KeyDerivationTLS12Prf

func (*KeyDerivation) GetKeyDerivationTLS12PskToMs

func (a *KeyDerivation) GetKeyDerivationTLS12PskToMs() *KeyDerivationTLS12PskToMs

func (*KeyDerivation) ToWireInterface

func (a *KeyDerivation) ToWireInterface() interface{}

type KeyDerivationFactory

type KeyDerivationFactory interface {
	Hkdf(hashAlg HashAlgorithmType) *Algorithm
	TLS12PRF(hashAlg HashAlgorithmType) *Algorithm
	TLS12PSKToMs(hashAlg HashAlgorithmType) *Algorithm
}

func NewKeyDerivation

func NewKeyDerivation() KeyDerivationFactory

type KeyDerivationHkdf

type KeyDerivationHkdf struct {
	HashAlg HashAlgorithmType
}

func (*KeyDerivationHkdf) ToWireInterface

func (a *KeyDerivationHkdf) ToWireInterface() interface{}

type KeyDerivationTLS12Prf

type KeyDerivationTLS12Prf struct {
	HashAlg HashAlgorithmType
}

func (*KeyDerivationTLS12Prf) ToWireInterface

func (a *KeyDerivationTLS12Prf) ToWireInterface() interface{}

type KeyDerivationTLS12PskToMs

type KeyDerivationTLS12PskToMs struct {
	HashAlg HashAlgorithmType
}

func (*KeyDerivationTLS12PskToMs) ToWireInterface

func (a *KeyDerivationTLS12PskToMs) ToWireInterface() interface{}

type MACFactory

type MACFactory interface {
	HMAC(hashAlg HashAlgorithmType) *Algorithm
	HMACTruncated(hashAlg HashAlgorithmType, macLength uint32) *Algorithm
	CBCMAC() *Algorithm
	CBCMACTruncated(macLength uint32) *Algorithm
	CMAC() *Algorithm
	CMACTruncated(macLength uint32) *Algorithm
}

func NewMAC

func NewMAC() MACFactory

type MacAlgorithm

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

func (*MacAlgorithm) ToWireInterface

func (a *MacAlgorithm) ToWireInterface() interface{}

type MacFullLength

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

func (*MacFullLength) ToWireInterface

func (a *MacFullLength) ToWireInterface() interface{}

type MacFullLengthCbcMac

type MacFullLengthCbcMac struct{}

func (*MacFullLengthCbcMac) ToWireInterface

func (a *MacFullLengthCbcMac) ToWireInterface() interface{}

type MacFullLengthCmac

type MacFullLengthCmac struct{}

func (*MacFullLengthCmac) ToWireInterface

func (a *MacFullLengthCmac) ToWireInterface() interface{}

type MacFullLengthHmac

type MacFullLengthHmac struct {
	HashAlg HashAlgorithmType
}

func (*MacFullLengthHmac) ToWireInterface

func (a *MacFullLengthHmac) ToWireInterface() interface{}

type MacTruncated

type MacTruncated struct {
	MacAlg    *MacFullLength
	MacLength uint32
}

func (*MacTruncated) ToWireInterface

func (a *MacTruncated) ToWireInterface() interface{}

Jump to

Keyboard shortcuts

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