package crypto

import (
	 // #nosec G505

	
)

// MessageKeyV1 computes msg_key for MTProto v1.
//
// msg_key = SHA1(plaintext)[4:20]
func ( []byte) ( bin.Int128) {
	 := sha1.Sum() // #nosec G401
	copy([:], [4:20])
	return 
}

// KeysV1 returns (aes_key, aes_iv) pair for MTProto v1.
//
// The KDF is used by auth.bindTempAuthKey encrypted_message.
// It intentionally mirrors the old "x=0 client side" key schedule, because
// Telegram explicitly requires this exact derivation for binding payload.
func ( Key,  bin.Int128) (,  bin.Int256) {
	 := make([]byte, sha1.Size*4)

	// x = 0 (client side) for binding message.
	 := sha1a([0:0], , , 0)
	 := sha1b([sha1.Size:sha1.Size], , , 0)
	 := sha1c([2*sha1.Size:2*sha1.Size], , , 0)
	 := sha1d([3*sha1.Size:3*sha1.Size], , , 0)

	// aes_key = sha1_a[0:8] + sha1_b[8:20] + sha1_c[4:16]
	 := copy([:], [:8])
	 += copy([:], [8:20])
	copy([:], [4:16])

	// aes_iv = sha1_a[8:20] + sha1_b[0:8] + sha1_c[16:20] + sha1_d[0:8]
	 = copy([:], [8:20])
	 += copy([:], [:8])
	 += copy([:], [16:20])
	copy([:], [:8])

	return , 
}