crypto

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EC  = 16
	RRC = 28
)

Variables

View Source
var (
	CFXFlagSendByAcceptor = uint8(0x01)
	CFXFlagSealed         = uint8(0x02)
	CFXFlagAcceptorSubKey = uint8(0x04)
)
View Source
var (
	KRB5OID = asn1.ObjectIdentifier{1, 2, 840, 113554, 1, 2, 2}
)

Functions

func Rotate

func Rotate(b []byte, rc int) []byte

Rotate function rotates the buffer over rotation point `rc`, ie out = in[rc:] + in[:rc].

Types

type AESCTSHMACSHA1

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

AESCTSHMACSHA1 represents the integrity/confidentiality routines for the aes128-cts-hmac-sha1 and aes256-cts-hmac-sha1.

func (*AESCTSHMACSHA1) ChecksumHash

func (c *AESCTSHMACSHA1) ChecksumHash() (hash.Hash, error)

func (*AESCTSHMACSHA1) IntegrityHash

func (c *AESCTSHMACSHA1) IntegrityHash() (hash.Hash, error)

func (*AESCTSHMACSHA1) MICHeader

func (c *AESCTSHMACSHA1) MICHeader(ctx context.Context, seqNum uint64) []byte

func (*AESCTSHMACSHA1) MakeSignature

func (c *AESCTSHMACSHA1) MakeSignature(ctx context.Context, seqNum uint64, forSgn [][]byte) ([]byte, error)

func (*AESCTSHMACSHA1) Size

func (c *AESCTSHMACSHA1) Size(ctx context.Context, conf bool) int

func (*AESCTSHMACSHA1) Unwrap

func (c *AESCTSHMACSHA1) Unwrap(ctx context.Context, seqNum uint64, forSign, forSeal [][]byte, sgn []byte) (bool, error)

func (*AESCTSHMACSHA1) Wrap

func (c *AESCTSHMACSHA1) Wrap(ctx context.Context, seqNum uint64, forSign, forSeal [][]byte) ([]byte, error)

func (*AESCTSHMACSHA1) WrapHeader

func (c *AESCTSHMACSHA1) WrapHeader(ctx context.Context, seqNum uint64) []byte

type Cipher

type Cipher interface {
	Wrap(context.Context, uint64, [][]byte, [][]byte) ([]byte, error)
	Unwrap(context.Context, uint64, [][]byte, [][]byte, []byte) (bool, error)
	MakeSignature(context.Context, uint64, [][]byte) ([]byte, error)
	Size(context.Context, bool) int
}

func NewAESCipher

func NewAESCipher(ctx context.Context, key types.EncryptionKey, isServer, isSubKey bool) (Cipher, error)

func NewCipher

func NewCipher(ctx context.Context, key types.EncryptionKey, isSubKey bool, isServer bool) (Cipher, error)

func NewRC4Cipher

func NewRC4Cipher(ctx context.Context, key types.EncryptionKey, isServer bool) (Cipher, error)

type RC4HMAC

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

func (*RC4HMAC) MICHeader

func (c *RC4HMAC) MICHeader(ctx context.Context, seqNum uint64) []byte

func (*RC4HMAC) MakeSignature

func (c *RC4HMAC) MakeSignature(ctx context.Context, seqNum uint64, forSign [][]byte) ([]byte, error)

func (*RC4HMAC) Size

func (c *RC4HMAC) Size(ctx context.Context, conf bool) int

func (*RC4HMAC) Unwrap

func (c *RC4HMAC) Unwrap(ctx context.Context, seqNum uint64, forSign, forSeal [][]byte, sgn []byte) (bool, error)

func (*RC4HMAC) Wrap

func (c *RC4HMAC) Wrap(ctx context.Context, seqNum uint64, forSign, forSeal [][]byte) ([]byte, error)

func (*RC4HMAC) WrapHeader

func (c *RC4HMAC) WrapHeader(ctx context.Context, seqNum uint64) []byte

type SizedHash

type SizedHash struct {
	hash.Hash
	// contains filtered or unexported fields
}

func (*SizedHash) Sum

func (h *SizedHash) Sum(b []byte) []byte

Jump to

Keyboard shortcuts

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