<commit_before>package diffiehellman

import (
	"crypto/rand"
	"math/big"
)

// Diffie-Hellman-Merkle key exchange
// Private keys should be generated randomly.

func PrivateKey(p *big.Int) *big.Int {
	max := big.NewInt(0)
	two := big.NewInt(2)
	max.Sub(p, two)
	n, err := rand.Int(rand.Reader, max)
	if err != nil {
		panic(err)
	}
	return two.Add(two, n)
}

func PublicKey(a *big.Int, p *big.Int, g int64) *big.Int {
	temp := big.NewInt(g)
	return temp.Exp(temp, a, p)
}

func SecretKey(a *big.Int, B *big.Int, p *big.Int) *big.Int {
	return B.Exp(B, a, p)

}
<commit_msg>Avoid overwriting public2 when calculating secret key<commit_after>package diffiehellman

import (
	"crypto/rand"
	"math/big"
)

// Diffie-Hellman-Merkle key exchange
// Private keys should be generated randomly.

func PrivateKey(p *big.Int) *big.Int {
	max := big.NewInt(0)
	two := big.NewInt(2)
	max.Sub(p, two)
	n, err := rand.Int(rand.Reader, max)
	if err != nil {
		panic(err)
	}
	return two.Add(two, n)
}

func PublicKey(a *big.Int, p *big.Int, g int64) *big.Int {
	temp := big.NewInt(g)
	return temp.Exp(temp, a, p)
}

func SecretKey(private1 *big.Int, public2 *big.Int, p *big.Int) *big.Int {
	return new(big.Int).Exp(public2, private1, p)

}

{'fraction_non_alphanumeric': 0.16408163265306122, 'fraction_numerical': 0.010612244897959184, 'mean_word_length': 3.751937984496124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2958733', 'n_tokens_mistral': 523, 'n_tokens_neox': 515, 'n_words': 128}