Project homepage Mailing List  Warmcat.com  API Docs  Github Mirror 
{"schema":"libjg2-1", "vpath":"/git/", "avatar":"/git/avatar/", "alang":"", "gen_ut":1752657516, "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":"39021847ca269d0f771557b894d15905", "commit": {"type":"commit", "time": 1501620155, "time_ofs": 120, "oid_tree": { "oid": "c9a1ec11ee73ceffa4b0f42687b088487d7a0056", "alias": []}, "oid":{ "oid": "5d010e3f10282c7bbc375ec593615c8015fbf836", "alias": []}, "msg": "sha/keccak1600.c: choose more sensible default parameters.", "sig_commit": { "git_time": { "time": 1501620155, "offset": 120 }, "name": "Andy Polyakov", "email": "appro@openssl.org", "md5": "50bd64fa2a792cbbf679fa16213a3b2a" }, "sig_author": { "git_time": { "time": 1501507241, "offset": 120 }, "name": "Andy Polyakov", "email": "appro@openssl.org", "md5": "50bd64fa2a792cbbf679fa16213a3b2a" }}, "body": "sha/keccak1600.c: choose more sensible default parameters.\n\n\u0022More\u0022 refers to the fact that we make active BIT_INTERLEAVE choice\nin some specific cases. Update commentary correspondingly.\n\nReviewed-by: Rich Salz \u003crsalz@openssl.org\u003e\n" , "diff": "diff --git a/crypto/sha/keccak1600.c b/crypto/sha/keccak1600.c\nindex 7ff4ff8..d925734 100644\n--- a/crypto/sha/keccak1600.c\n+++ b/crypto/sha/keccak1600.c\n@@ -15,7 +15,19 @@ size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,\n size_t r);\n void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r);\n \n-#ifndef KECCAK1600_ASM\n+#if !defined(KECCAK1600_ASM) || !defined(SELFTEST)\n+\n+/*\n+ * Choose some sensible defaults\n+ */\n+#if !defined(KECCAK_REF) \u0026\u0026 !defined(KECCAK_1X) \u0026\u0026 !defined(KECCAK_1X_ALT) \u0026\u0026 \u005c\n+ !defined(KECCAK_2X) \u0026\u0026 !defined(KECCAK_INPLACE)\n+# define KECCAK_2X /* default to KECCAK_2X variant */\n+#endif\n+\n+#if defined(__i386) || defined(__i386__) || defined(_M_IX86)\n+# define KECCAK_COMPLEMENTING_TRANSFORM\n+#endif\n \n #if defined(__x86_64__) || defined(__aarch64__) || \u005c\n defined(__mips64) || defined(__ia64) || \u005c\n@@ -508,10 +520,10 @@ static void KeccakF1600(uint64_t A[5][5])\n * This implementation is variant of KECCAK_1X above with outer-most\n * round loop unrolled twice. This allows to take temporary storage\n * out of round procedure and simplify references to it by alternating\n- * it with actual data (see round loop below). Just like original, it's\n- * rather meant as reference for an assembly implementation. It's likely\n- * to provide best instruction per processed byte ratio at minimal\n- * round unroll factor...\n+ * it with actual data (see round loop below). Originally it was meant\n+ * rather as reference for an assembly implementation, but it seems to\n+ * play best with compilers [as well as provide best instruction per\n+ * processed byte ratio at minimal round unroll factor]...\n */\n static void Round(uint64_t R[5][5], uint64_t A[5][5], size_t i)\n {\n@@ -661,13 +673,15 @@ static void KeccakF1600(uint64_t A[5][5])\n #endif\n }\n \n-#else\n+#else /* define KECCAK_INPLACE to compile this code path */\n /*\n * This implementation is KECCAK_1X from above combined 4 times with\n * a twist that allows to omit temporary storage and perform in-place\n * processing. It's discussed in section 2.5 of \u0022Keccak implementation\n * overview\u0022. It's likely to be best suited for processors with large\n- * register bank...\n+ * register bank... On the other hand processor with large register\n+ * bank can as well use KECCAK_1X_ALT, it would be as fast but much\n+ * more compact...\n */\n static void FourRounds(uint64_t A[5][5], size_t i)\n {\n@@ -1106,10 +1120,6 @@ void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r)\n KeccakF1600(A);\n }\n }\n-#else\n-size_t SHA3_absorb(uint64_t A[5][5], const unsigned char *inp, size_t len,\n- size_t r);\n-void SHA3_squeeze(uint64_t A[5][5], unsigned char *out, size_t len, size_t r);\n #endif\n \n #ifdef SELFTEST\n","s":{"c":1752657516,"u": 41660}} ],"g": 42579,"chitpc": 0,"ehitpc": 0,"indexed":0 , "ab": 0, "si": 0, "db":0, "di":0, "sat":0, "lfc": "0000"}