package crypto

import (
	
	
	
	

	
	
	
	
	
)

// RFC 3962

// Aes128CtsHmacSha96 implements Kerberos encryption type aes128-cts-hmac-sha1-96
type Aes128CtsHmacSha96 struct {
}

// GetETypeID returns the EType ID number.
func ( Aes128CtsHmacSha96) () int32 {
	return etypeID.AES128_CTS_HMAC_SHA1_96
}

// GetHashID returns the checksum type ID number.
func ( Aes128CtsHmacSha96) () int32 {
	return chksumtype.HMAC_SHA1_96_AES128
}

// GetKeyByteSize returns the number of bytes for key of this etype.
func ( Aes128CtsHmacSha96) () int {
	return 128 / 8
}

// GetKeySeedBitLength returns the number of bits for the seed for key generation.
func ( Aes128CtsHmacSha96) () int {
	return .GetKeyByteSize() * 8
}

// GetHashFunc returns the hash function for this etype.
func ( Aes128CtsHmacSha96) () func() hash.Hash {
	return sha1.New
}

// GetMessageBlockByteSize returns the block size for the etype's messages.
func ( Aes128CtsHmacSha96) () int {
	return 1
}

// GetDefaultStringToKeyParams returns the default key derivation parameters in string form.
func ( Aes128CtsHmacSha96) () string {
	return "00001000"
}

// GetConfounderByteSize returns the byte count for confounder to be used during cryptographic operations.
func ( Aes128CtsHmacSha96) () int {
	return aes.BlockSize
}

// GetHMACBitLength returns the bit count size of the integrity hash.
func ( Aes128CtsHmacSha96) () int {
	return 96
}

// GetCypherBlockBitLength returns the bit count size of the cypher block.
func ( Aes128CtsHmacSha96) () int {
	return aes.BlockSize * 8
}

// StringToKey returns a key derived from the string provided.
func ( Aes128CtsHmacSha96) ( string,  string,  string) ([]byte, error) {
	return rfc3962.StringToKey(, , , )
}

// RandomToKey returns a key from the bytes provided.
func ( Aes128CtsHmacSha96) ( []byte) []byte {
	return rfc3961.RandomToKey()
}

// EncryptData encrypts the data provided.
func ( Aes128CtsHmacSha96) (,  []byte) ([]byte, []byte, error) {
	return rfc3962.EncryptData(, , )
}

// EncryptMessage encrypts the message provided and concatenates it with the integrity hash to create an encrypted message.
func ( Aes128CtsHmacSha96) (,  []byte,  uint32) ([]byte, []byte, error) {
	return rfc3962.EncryptMessage(, , , )
}

// DecryptData decrypts the data provided.
func ( Aes128CtsHmacSha96) (,  []byte) ([]byte, error) {
	return rfc3962.DecryptData(, , )
}

// DecryptMessage decrypts the message provided and verifies the integrity of the message.
func ( Aes128CtsHmacSha96) (,  []byte,  uint32) ([]byte, error) {
	return rfc3962.DecryptMessage(, , , )
}

// DeriveKey derives a key from the protocol key based on the usage value.
func ( Aes128CtsHmacSha96) (,  []byte) ([]byte, error) {
	return rfc3961.DeriveKey(, , )
}

// DeriveRandom generates data needed for key generation.
func ( Aes128CtsHmacSha96) (,  []byte) ([]byte, error) {
	return rfc3961.DeriveRandom(, , )
}

// VerifyIntegrity checks the integrity of the plaintext message.
func ( Aes128CtsHmacSha96) (, ,  []byte,  uint32) bool {
	return rfc3961.VerifyIntegrity(, , , , )
}

// GetChecksumHash returns a keyed checksum hash of the bytes provided.
func ( Aes128CtsHmacSha96) (,  []byte,  uint32) ([]byte, error) {
	return common.GetHash(, , common.GetUsageKc(), )
}

// VerifyChecksum compares the checksum of the message bytes is the same as the checksum provided.
func ( Aes128CtsHmacSha96) (, ,  []byte,  uint32) bool {
	,  := .GetChecksumHash(, , )
	if  != nil {
		return false
	}
	return hmac.Equal(, )
}