Diff between dcf1028680ea5ed211b4e12dead54af1d45bedd3 and 51f3b1b8b05cdfce0ef8a7222013398d995b0c94

Changed Files

File Additions Deletions Status
unit/test-ecc.c +30 -0 modified

Full Patch

diff --git a/unit/test-ecc.c b/unit/test-ecc.c
index 99e98e9..e025db7 100644
--- a/unit/test-ecc.c
+++ b/unit/test-ecc.c
@@ -221,6 +221,35 @@ static void test_sample_2(void)
 	g_assert(fails == 0);
 }
 
+static void test_sample_3(void)
+{
+	uint8_t priv_a[32] = {	0xbd, 0x1a, 0x3c, 0xcd, 0xa6, 0xb8, 0x99, 0x58,
+				0x99, 0xb7, 0x40, 0xeb, 0x7b, 0x60, 0xff, 0x4a,
+				0x50, 0x3f, 0x10, 0xd2, 0xe3, 0xb3, 0xc9, 0x74,
+				0x38, 0x5f, 0xc5, 0xa3, 0xd4, 0xf6, 0x49, 0x3f,
+	};
+	uint8_t pub_a[64] = {	0xe6, 0x9d, 0x35, 0x0e, 0x48, 0x01, 0x03, 0xcc,
+				0xdb, 0xfd, 0xf4, 0xac, 0x11, 0x91, 0xf4, 0xef,
+				0xb9, 0xa5, 0xf9, 0xe9, 0xa7, 0x83, 0x2c, 0x5e,
+				0x2c, 0xbe, 0x97, 0xf2, 0xd2, 0x03, 0xb0, 0x20,
+
+				0x8b, 0xd2, 0x89, 0x15, 0xd0, 0x8e, 0x1c, 0x74,
+				0x24, 0x30, 0xed, 0x8f, 0xc2, 0x45, 0x63, 0x76,
+				0x5c, 0x15, 0x52, 0x5a, 0xbf, 0x9a, 0x32, 0x63,
+				0x6d, 0xeb, 0x2a, 0x65, 0x49, 0x9c, 0x80, 0xdc,
+	};
+	uint8_t dhkey[32] = {	0x2d, 0xab, 0x00, 0x48, 0xcb, 0xb3, 0x7b, 0xda,
+				0x55, 0x7b, 0x8b, 0x72, 0xa8, 0x57, 0x87, 0xc3,
+				0x87, 0x27, 0x99, 0x32, 0xfc, 0x79, 0x5f, 0xae,
+				0x7c, 0x1c, 0xf9, 0x49, 0xe6, 0xd7, 0xaa, 0x70,
+	};
+	int fails;
+
+	fails = test_sample(priv_a, priv_a, pub_a, pub_a, dhkey);
+
+	g_assert(fails == 0);
+}
+
 int main(int argc, char *argv[])
 {
 	g_test_init(&argc, &argv, NULL);
@@ -229,6 +258,7 @@ int main(int argc, char *argv[])
 
 	g_test_add_func("/ecdh/sample/1", test_sample_1);
 	g_test_add_func("/ecdh/sample/2", test_sample_2);
+	g_test_add_func("/ecdh/sample/3", test_sample_3);
 
 	return g_test_run();
 }