{"schema":"libjg2-1",
"vpath":"/git/",
"avatar":"/git/avatar/",
"alang":"",
"gen_ut":1754122007,
"reponame":"openssl",
"desc":"OpenSSL",
"owner": { "name": "Andy Green", "email": "andy@warmcat.com", "md5": "c50933ca2aa61e0fe2c43d46bb6b59cb" },"url":"https://warmcat.com/repo/openssl",
"f":3,
"items": [
{"schema":"libjg2-1",
"cid":"54aa91b6238eec4e3d2d6544b245683b",
"commit": {"type":"commit",
"time": 1519131569,
"time_ofs": 0,
"oid_tree": { "oid": "06e173183f8c0fbb8469221d4a246ee0426502db", "alias": []},
"oid":{ "oid": "6853d09368b5b5c56db046de086fc7258c43e8ed", "alias": []},
"msg": "Add a local test",
"sig_commit": { "git_time": { "time": 1519131569, "offset": 0 }, "name": "Matt Caswell", "email": "matt@openssl.org", "md5": "10f7b441a32d5790efad9fc68cae4af2" },
"sig_author": { "git_time": { "time": 1510833126, "offset": 0 }, "name": "Matt Caswell", "email": "matt@openssl.org", "md5": "10f7b441a32d5790efad9fc68cae4af2" }},
"body": "Add a local test\n\nReviewed-by: Bernd Edlinger \u003cbernd.edlinger@hotmail.de\u003e\n(Merged from https://github.com/openssl/openssl/pull/5105)\n"
,
"diff": "diff --git a/crypto/ec/curve448/curve448_test.c b/crypto/ec/curve448/curve448_test.c\nnew file mode 100644\nindex 0000000..8f95810\n--- /dev/null\n+++ b/crypto/ec/curve448/curve448_test.c\n@@ -0,0 +1,145 @@\n+#include \u003cstdio.h\u003e\n+#include \u003cstring.h\u003e\n+#include \u003copenssl/e_os2.h\u003e\n+#include \u0022curve448_lcl.h\u0022\n+\n+/* Test vectors from RFC7748 */\n+\n+const uint8_t in_scalar1[56] \u003d {\n+ 0x3d, 0x26, 0x2f, 0xdd, 0xf9, 0xec, 0x8e, 0x88, 0x49, 0x52, 0x66, 0xfe,\n+ 0xa1, 0x9a, 0x34, 0xd2, 0x88, 0x82, 0xac, 0xef, 0x04, 0x51, 0x04, 0xd0,\n+ 0xd1, 0xaa, 0xe1, 0x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0x00, 0x00, 0x00,\n+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\n+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00\n+};\n+\n+const uint8_t out_u3[3][56] \u003d {\n+ {\n+ 0x3f, 0x48, 0x2c, 0x8a, 0x9f, 0x19, 0xb0, 0x1e, 0x6c, 0x46, 0xee, 0x97,\n+ 0x11, 0xd9, 0xdc, 0x14, 0xfd, 0x4b, 0xf6, 0x7a, 0xf3, 0x07, 0x65, 0xc2,\n+ 0xae, 0x2b, 0x84, 0x6a, 0x4d, 0x23, 0xa8, 0xcd, 0x0d, 0xb8, 0x97, 0x08,\n+ 0x62, 0x39, 0x49, 0x2c, 0xaf, 0x35, 0x0b, 0x51, 0xf8, 0x33, 0x86, 0x8b,\n+ 0x9b, 0xc2, 0xb3, 0xbc, 0xa9, 0xcf, 0x41, 0x13\n+ }, {\n+ 0xaa, 0x3b, 0x47, 0x49, 0xd5, 0x5b, 0x9d, 0xaf, 0x1e, 0x5b, 0x00, 0x28,\n+ 0x88, 0x26, 0xc4, 0x67, 0x27, 0x4c, 0xe3, 0xeb, 0xbd, 0xd5, 0xc1, 0x7b,\n+ 0x97, 0x5e, 0x09, 0xd4, 0xaf, 0x6c, 0x67, 0xcf, 0x10, 0xd0, 0x87, 0x20,\n+ 0x2d, 0xb8, 0x82, 0x86, 0xe2, 0xb7, 0x9f, 0xce, 0xea, 0x3e, 0xc3, 0x53,\n+ 0xef, 0x54, 0xfa, 0xa2, 0x6e, 0x21, 0x9f, 0x38\n+ }, {\n+ 0x07, 0x7f, 0x45, 0x36, 0x81, 0xca, 0xca, 0x36, 0x93, 0x19, 0x84, 0x20,\n+ 0xbb, 0xe5, 0x15, 0xca, 0xe0, 0x00, 0x24, 0x72, 0x51, 0x9b, 0x3e, 0x67,\n+ 0x66, 0x1a, 0x7e, 0x89, 0xca, 0xb9, 0x46, 0x95, 0xc8, 0xf4, 0xbc, 0xd6,\n+ 0x6e, 0x61, 0xb9, 0xb9, 0xc9, 0x46, 0xda, 0x8d, 0x52, 0x4d, 0xe3, 0xd6,\n+ 0x9b, 0xd9, 0xd9, 0xd6, 0x6b, 0x99, 0x7e, 0x37\n+ }\n+};\n+\n+int main(int argc, char *argv[])\n+{\n+ uint8_t u[56], k[56], out[56];\n+ unsigned int i, max \u003d 1000;\n+ int j \u003d -1;\n+\n+ if (argc !\u003d 1 \u0026\u0026 (argc !\u003d 2 || strcmp(argv[1], \u0022-f\u0022) !\u003d 0)) {\n+ printf (\u0022Usage: curve448_test [-f]\u005cn\u0022);\n+ return 1;\n+ }\n+\n+ if (argc \u003d\u003d 2)\n+ max \u003d 1000000;\n+\n+ if (!X448(out, in_scalar1, in_u1)) {\n+ printf(\u0022Failed in X448 call (1)\u005cn\u0022);\n+ return 1;\n+ }\n+ if (memcmp(out, out_u1, sizeof(out)) !\u003d 0) {\n+ printf(\u0022Calculated output and expected output differ (1)\u005cn\u0022);\n+ return 1;\n+ }\n+\n+ if (!X448(out, in_scalar2, in_u2)) {\n+ printf(\u0022Failed in X448 call (2)\u005cn\u0022);\n+ return 1;\n+ }\n+ if (memcmp(out, out_u2, sizeof(out)) !\u003d 0) {\n+ printf(\u0022Calculated output and expected output differ (2)\u005cn\u0022);\n+ return 1;\n+ }\n+\n+ memcpy(u, in_u3, sizeof(u));\n+ memcpy(k, in_u3, sizeof(k));\n+ for (i \u003d 1; i \u003c\u003d max; i++) {\n+ if (i % 10000 \u003d\u003d 0) {\n+ printf(\u0022.\u0022);\n+ fflush(stdout);\n+ }\n+\n+ if (!X448(out, k, u)) {\n+ printf(\u0022Failed in X448 call (3, %ud)\u005cn\u0022, i);\n+ return 1;\n+ }\n+ if (i \u003d\u003d 1 || i \u003d\u003d 1000 || i \u003d\u003d 1000000) {\n+ j++;\n+ if (memcmp(out, out_u3[j], sizeof(out)) !\u003d 0) {\n+ printf(\u0022Calculated output and expected output differ (3, %ud)\u005cn\u0022,\n+ i);\n+ return 1;\n+ }\n+ }\n+ memcpy(u, k, sizeof(u));\n+ memcpy(k, out, sizeof(k));\n+ }\n+\n+ printf(\u0022\u005cnSuccess!\u005cn\u0022);\n+\n+ return 0;\n+}\n","s":{"c":1754122007,"u": 35238}}
],"g": 36550,"chitpc": 0,"ehitpc": 0,"indexed":0
,
"ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}