<commit_before>package ed25519.test;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.Assert;

import java.security.NoSuchAlgorithmException;

import ed25519.application.Crypto;


public class CryptoTest {

	@Test(dependsOnGroups= "constants")
	public void testCreateCrypto() throws NoSuchAlgorithmException {
		Crypto crypto = new Crypto();
		Assert.assertNotNull(crypto);
	}
	
	@DataProvider(name = "publickey")
	public static Object[][] publickeyProvider() {
		byte[] input1 = {};
		byte[] input2 = {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64};
		byte[] expected1 = {(byte) 0xe0, (byte) 0xb1, (byte) 0xfe, 0x74, 0x11, 0x7e, 0x1b, (byte) 0x95, (byte) 0xb6, 0x8, (byte) 0xa4, (byte) 0xf2, 0x21, (byte) 0xdf, 0x31, 0x47, 0x74, (byte) 0xb2, 0xe, (byte) 0xa6, 0x68, 0x42, 0x35, 0xd, 0x51, 0x53, 0x71, (byte) 0xc7, (byte) 0xc6, (byte) 0x96, 0x6c, 0x6e};
		byte[] expected2 = {0x30, (byte) 0xd1, 0x6, 0x5e, (byte) 0xe6, (byte) 0xbb, 0x57, (byte) 0xa2, 0x3c, 0x33, 0x9, (byte) 0xe8, 0x3b, (byte) 0xf0, (byte) 0xd1, (byte) 0xfc, 0x3b, (byte) 0xd7, 0x13, (byte) 0xea, 0x61, (byte) 0xd2, (byte) 0xe7, 0x6d, 0x19, (byte) 0x93, 0x2b, 0x7a, (byte) 0xdb, (byte) 0x8c, (byte) 0x83, (byte) 0xaf};
		Object[][] data = {{input1,expected1}, {input2,expected2}};
		return data;
	}
	
	@Test(dataProvider = "publickey", dependsOnGroups= {"basics", "bigpoint"}, dependsOnMethods = {"ed25519.test.CurveTest.testScalarMult","ed25519.test.CurveTest.testEncodePoint"})
	public void testGetPublicKey(byte[] input, byte[] expected) throws NoSuchAlgorithmException {
		Crypto crypto = new Crypto();
		Assert.assertEquals(crypto.getPublikKey(input), expected);
	}
	
}<commit_msg>added a test from ed25519 page.<commit_after>package ed25519.test;

import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import org.testng.Assert;

import java.security.NoSuchAlgorithmException;

import ed25519.application.Crypto;


public class CryptoTest {

	@Test(dependsOnGroups= "constants")
	public void testCreateCrypto() throws NoSuchAlgorithmException {
		Crypto crypto = new Crypto();
		Assert.assertNotNull(crypto);
	}
	
	@DataProvider(name = "publickey")
	public static Object[][] publickeyProvider() {
		byte[] input1 = {};
		byte[] input2 = {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x57, 0x6f, 0x72, 0x6c, 0x64};
		byte[] input3 = {(byte) 0x9d, 0x61, (byte) 0xb1, (byte) 0x9d, (byte) 0xef, (byte) 0xfd, 0x5a, 0x60, (byte) 0xba, (byte) 0x84, 0x4a, (byte) 0xf4, (byte) 0x92, (byte) 0xec, 0x2c, (byte) 0xc4, 0x44, 0x49, (byte) 0xc5, 0x69, 0x7b, 0x32, 0x69, 0x19, 0x70, 0x3b, (byte) 0xac, 0x03, 0x1c, (byte) 0xae, 0x7f, 0x60};
		byte[] expected1 = {(byte) 0xe0, (byte) 0xb1, (byte) 0xfe, 0x74, 0x11, 0x7e, 0x1b, (byte) 0x95, (byte) 0xb6, 0x8, (byte) 0xa4, (byte) 0xf2, 0x21, (byte) 0xdf, 0x31, 0x47, 0x74, (byte) 0xb2, 0xe, (byte) 0xa6, 0x68, 0x42, 0x35, 0xd, 0x51, 0x53, 0x71, (byte) 0xc7, (byte) 0xc6, (byte) 0x96, 0x6c, 0x6e};
		byte[] expected2 = {0x30, (byte) 0xd1, 0x6, 0x5e, (byte) 0xe6, (byte) 0xbb, 0x57, (byte) 0xa2, 0x3c, 0x33, 0x9, (byte) 0xe8, 0x3b, (byte) 0xf0, (byte) 0xd1, (byte) 0xfc, 0x3b, (byte) 0xd7, 0x13, (byte) 0xea, 0x61, (byte) 0xd2, (byte) 0xe7, 0x6d, 0x19, (byte) 0x93, 0x2b, 0x7a, (byte) 0xdb, (byte) 0x8c, (byte) 0x83, (byte) 0xaf};
		byte[] expected3 = {(byte) 0xd7, 0x5a, (byte) 0x98, 0x01, (byte) 0x82, (byte) 0xb1, 0x0a, (byte) 0xb7, (byte) 0xd5, 0x4b, (byte) 0xfe, (byte) 0xd3, (byte) 0xc9, 0x64, 0x07, 0x3a, 0x0e, (byte) 0xe1, 0x72, (byte) 0xf3, (byte) 0xda, (byte) 0xa6, 0x23, 0x25, (byte) 0xaf, 0x02, 0x1a, 0x68, (byte) 0xf7, 0x07, 0x51, 0x1a};
		Object[][] data = {{input1,expected1}, {input2,expected2}, {input3,expected3}};
		return data;
	}
	
	@Test(dataProvider = "publickey", dependsOnGroups= {"basics", "bigpoint"}, dependsOnMethods = {"ed25519.test.CurveTest.testScalarMult","ed25519.test.CurveTest.testEncodePoint"})
	public void testGetPublicKey(byte[] input, byte[] expected) throws NoSuchAlgorithmException {
		Crypto crypto = new Crypto();
		Assert.assertEquals(crypto.getPublikKey(input), expected);
	}
	
}
{'fraction_non_alphanumeric': 0.16902439024390245, 'fraction_numerical': 0.13195121951219513, 'mean_word_length': 5.646677471636953, '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': '5809928', 'n_tokens_mistral': 2195, 'n_tokens_neox': 1846, 'n_words': 447}