{"action":"created","comment":{"url":"https://api.github.com/repos/openssl/openssl/pulls/comments/166638331","pull_request_review_id":94732781,"id":166638331,"diff_hunk":"@@ -0,0 +1,205 @@\n+/*\n+ * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.\n+ * Copyright 2015-2016 Cryptography Research, Inc.\n+ *\n+ * Licensed under the OpenSSL license (the \"License\").  You may not use\n+ * this file except in compliance with the License.  You can obtain a copy\n+ * in the file LICENSE in the source distribution or at\n+ * https://www.openssl.org/source/license.html\n+ *\n+ * Originally written by Mike Hamburg\n+ */\n+#include \"field.h\"\n+\n+static const gf MODULUS = {\n+    FIELD_LITERAL(0xffffffffffffff, 0xffffffffffffff, 0xffffffffffffff,\n+                  0xffffffffffffff, 0xfffffffffffffe, 0xffffffffffffff,\n+                  0xffffffffffffff, 0xffffffffffffff)\n+};\n+\n+/* Serialize to wire format. */\n+void gf_serialize(uint8_t serial[SER_BYTES], const gf x, int with_hibit)\n+{\n+    unsigned int j = 0, fill = 0;\n+    dword_t buffer = 0;\n+    int i;\n+    gf red;\n+\n+    gf_copy(red, x);\n+    gf_strong_reduce(red);\n+    if (!with_hibit)\n+        assert(gf_hibit(red) == 0);\n+\n+    FOR_LIMB(i, 0, (with_hibit ? X_SER_BYTES : SER_BYTES),  {\n+        if (fill < 8 && j < NLIMBS) {\n+            buffer |= ((dword_t) red->limb[LIMBPERM(j)]) << fill;\n+            fill += LIMB_PLACE_VALUE(LIMBPERM(j));\n+            j++;\n+        }\n+        serial[i] = (uint8_t)buffer;\n+        fill -= 8;\n+        buffer >>= 8;\n+    });\n+}\n+\n+/* Return high bit of x = low bit of 2x mod p */\n+mask_t gf_hibit(const gf x)\n+{\n+    gf y;\n+\n+    gf_add(y, x, x);\n+    gf_strong_reduce(y);\n+    return 0 - (y->limb[0] & 1);","path":"crypto/ec/curve448/f_generic.c","position":52,"original_position":52,"commit_id":"f3cf264cca087405e7d5847f0c2d0b74ab50aee4","original_commit_id":"f3cf264cca087405e7d5847f0c2d0b74ab50aee4","user":{"login":"bernd-edlinger","id":17638929,"avatar_url":"https://avatars2.githubusercontent.com/u/17638929?v=4","gravatar_id":"","url":"https://api.github.com/users/bernd-edlinger","html_url":"https://github.com/bernd-edlinger","followers_url":"https://api.github.com/users/bernd-edlinger/followers","following_url":"https://api.github.com/users/bernd-edlinger/following{/other_user}","gists_url":"https://api.github.com/users/bernd-edlinger/gists{/gist_id}","starred_url":"https://api.github.com/users/bernd-edlinger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bernd-edlinger/subscriptions","organizations_url":"https://api.github.com/users/bernd-edlinger/orgs","repos_url":"https://api.github.com/users/bernd-edlinger/repos","events_url":"https://api.github.com/users/bernd-edlinger/events{/privacy}","received_events_url":"https://api.github.com/users/bernd-edlinger/received_events","type":"User","site_admin":false},"body":"would using \"word_is_zero\" make this more constant time?","created_at":"2018-02-07T14:46:03Z","updated_at":"2018-02-07T14:46:03Z","html_url":"https://github.com/openssl/openssl/pull/5105#discussion_r166638331","pull_request_url":"https://api.github.com/repos/openssl/openssl/pulls/5105","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments/166638331"},"html":{"href":"https://github.com/openssl/openssl/pull/5105#discussion_r166638331"},"pull_request":{"href":"https://api.github.com/repos/openssl/openssl/pulls/5105"}}},"pull_request":{"url":"https://api.github.com/repos/openssl/openssl/pulls/5105","id":163714457,"html_url":"https://github.com/openssl/openssl/pull/5105","diff_url":"https://github.com/openssl/openssl/pull/5105.diff","patch_url":"https://github.com/openssl/openssl/pull/5105.patch","issue_url":"https://api.github.com/repos/openssl/openssl/issues/5105","number":5105,"state":"open","locked":false,"title":"Curve448 primitives","user":{"login":"mattcaswell","id":7422273,"avatar_url":"https://avatars0.githubusercontent.com/u/7422273?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},"body":"This adds all the primitives required for Curve448 support (X448 and Ed448).\r\n\r\nThis is based heavily on original work by Mike Hamburg (thanks @bitwiseshiftleft) and contributed under CLA.\r\n\r\nThis is code that originally appeared in #4829, but I've pulled out just the primitives (i.e. none of the EVP changes). The EVP layer will come in a different PR once this is in. I've also stripped out all commits that were updating the temporary Makefile I had in #4829 , so that doesn't appear here.\r\n\r\nAt the moment only the 32-bit reference code is used. There are a number of files for other architectures that I have imported but done very little else with at this stage. Again later PRs can look at integrating the platform specific code in.\r\n\r\n<!--\r\nThank you for your pull request. Please review these requirements:\r\n\r\nContributors guide: https://github.com/openssl/openssl/blob/master/CONTRIBUTING\r\n\r\nOther than that, provide a description above this comment if there isn't one already\r\n\r\nIf this fixes a github issue, make sure to have a line saying 'Fixes #XXXX' (without quotes) in the commit message.\r\n-->\r\n\r\n##### Checklist\r\n<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->\r\n- [ ] documentation is added or updated\r\n- [x] tests are added or updated\r\n","created_at":"2018-01-18T13:41:17Z","updated_at":"2018-02-07T14:46:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"738efd182352e6fce6702232f565cf607982cdc5","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"milestone":{"url":"https://api.github.com/repos/openssl/openssl/milestones/11","html_url":"https://github.com/openssl/openssl/milestone/11","labels_url":"https://api.github.com/repos/openssl/openssl/milestones/11/labels","id":3024154,"number":11,"title":"Post 1.1.1","description":"","creator":{"login":"kaduk","id":1894506,"avatar_url":"https://avatars1.githubusercontent.com/u/1894506?v=4","gravatar_id":"","url":"https://api.github.com/users/kaduk","html_url":"https://github.com/kaduk","followers_url":"https://api.github.com/users/kaduk/followers","following_url":"https://api.github.com/users/kaduk/following{/other_user}","gists_url":"https://api.github.com/users/kaduk/gists{/gist_id}","starred_url":"https://api.github.com/users/kaduk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaduk/subscriptions","organizations_url":"https://api.github.com/users/kaduk/orgs","repos_url":"https://api.github.com/users/kaduk/repos","events_url":"https://api.github.com/users/kaduk/events{/privacy}","received_events_url":"https://api.github.com/users/kaduk/received_events","type":"User","site_admin":false},"open_issues":120,"closed_issues":9,"state":"open","created_at":"2018-01-09T21:08:23Z","updated_at":"2018-02-04T10:32:54Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/openssl/openssl/pulls/5105/commits","review_comments_url":"https://api.github.com/repos/openssl/openssl/pulls/5105/comments","review_comment_url":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openssl/openssl/issues/5105/comments","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/f3cf264cca087405e7d5847f0c2d0b74ab50aee4","head":{"label":"mattcaswell:curve448-primitives","ref":"curve448-primitives","sha":"f3cf264cca087405e7d5847f0c2d0b74ab50aee4","user":{"login":"mattcaswell","id":7422273,"avatar_url":"https://avatars0.githubusercontent.com/u/7422273?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},"repo":{"id":26978010,"name":"openssl","full_name":"mattcaswell/openssl","owner":{"login":"mattcaswell","id":7422273,"avatar_url":"https://avatars0.githubusercontent.com/u/7422273?v=4","gravatar_id":"","url":"https://api.github.com/users/mattcaswell","html_url":"https://github.com/mattcaswell","followers_url":"https://api.github.com/users/mattcaswell/followers","following_url":"https://api.github.com/users/mattcaswell/following{/other_user}","gists_url":"https://api.github.com/users/mattcaswell/gists{/gist_id}","starred_url":"https://api.github.com/users/mattcaswell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattcaswell/subscriptions","organizations_url":"https://api.github.com/users/mattcaswell/orgs","repos_url":"https://api.github.com/users/mattcaswell/repos","events_url":"https://api.github.com/users/mattcaswell/events{/privacy}","received_events_url":"https://api.github.com/users/mattcaswell/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mattcaswell/openssl","description":null,"fork":true,"url":"https://api.github.com/repos/mattcaswell/openssl","forks_url":"https://api.github.com/repos/mattcaswell/openssl/forks","keys_url":"https://api.github.com/repos/mattcaswell/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mattcaswell/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mattcaswell/openssl/teams","hooks_url":"https://api.github.com/repos/mattcaswell/openssl/hooks","issue_events_url":"https://api.github.com/repos/mattcaswell/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/mattcaswell/openssl/events","assignees_url":"https://api.github.com/repos/mattcaswell/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/mattcaswell/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/mattcaswell/openssl/tags","blobs_url":"https://api.github.com/repos/mattcaswell/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mattcaswell/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mattcaswell/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/mattcaswell/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mattcaswell/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/mattcaswell/openssl/languages","stargazers_url":"https://api.github.com/repos/mattcaswell/openssl/stargazers","contributors_url":"https://api.github.com/repos/mattcaswell/openssl/contributors","subscribers_url":"https://api.github.com/repos/mattcaswell/openssl/subscribers","subscription_url":"https://api.github.com/repos/mattcaswell/openssl/subscription","commits_url":"https://api.github.com/repos/mattcaswell/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/mattcaswell/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/mattcaswell/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/mattcaswell/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/mattcaswell/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/mattcaswell/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mattcaswell/openssl/merges","archive_url":"https://api.github.com/repos/mattcaswell/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mattcaswell/openssl/downloads","issues_url":"https://api.github.com/repos/mattcaswell/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/mattcaswell/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/mattcaswell/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/mattcaswell/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mattcaswell/openssl/labels{/name}","releases_url":"https://api.github.com/repos/mattcaswell/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/mattcaswell/openssl/deployments","created_at":"2014-11-21T21:09:59Z","updated_at":"2017-02-22T10:52:04Z","pushed_at":"2018-02-07T13:42:04Z","git_url":"git://github.com/mattcaswell/openssl.git","ssh_url":"git@github.com:mattcaswell/openssl.git","clone_url":"https://github.com/mattcaswell/openssl.git","svn_url":"https://github.com/mattcaswell/openssl","homepage":null,"size":141069,"stargazers_count":4,"watchers_count":4,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":1,"open_issues":0,"watchers":4,"default_branch":"master"}},"base":{"label":"openssl:master","ref":"master","sha":"03cb2cc9e53f7ca7539069a388d2767fffa7cf66","user":{"login":"openssl","id":3279138,"avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"repo":{"id":7634677,"name":"openssl","full_name":"openssl/openssl","owner":{"login":"openssl","id":3279138,"avatar_url":"https://avatars2.githubusercontent.com/u/3279138?v=4","gravatar_id":"","url":"https://api.github.com/users/openssl","html_url":"https://github.com/openssl","followers_url":"https://api.github.com/users/openssl/followers","following_url":"https://api.github.com/users/openssl/following{/other_user}","gists_url":"https://api.github.com/users/openssl/gists{/gist_id}","starred_url":"https://api.github.com/users/openssl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openssl/subscriptions","organizations_url":"https://api.github.com/users/openssl/orgs","repos_url":"https://api.github.com/users/openssl/repos","events_url":"https://api.github.com/users/openssl/events{/privacy}","received_events_url":"https://api.github.com/users/openssl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openssl/openssl","description":"TLS/SSL and crypto library","fork":false,"url":"https://api.github.com/repos/openssl/openssl","forks_url":"https://api.github.com/repos/openssl/openssl/forks","keys_url":"https://api.github.com/repos/openssl/openssl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openssl/openssl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openssl/openssl/teams","hooks_url":"https://api.github.com/repos/openssl/openssl/hooks","issue_events_url":"https://api.github.com/repos/openssl/openssl/issues/events{/number}","events_url":"https://api.github.com/repos/openssl/openssl/events","assignees_url":"https://api.github.com/repos/openssl/openssl/assignees{/user}","branches_url":"https://api.github.com/repos/openssl/openssl/branches{/branch}","tags_url":"https://api.github.com/repos/openssl/openssl/tags","blobs_url":"https://api.github.com/repos/openssl/openssl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openssl/openssl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openssl/openssl/git/refs{/sha}","trees_url":"https://api.github.com/repos/openssl/openssl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openssl/openssl/statuses/{sha}","languages_url":"https://api.github.com/repos/openssl/openssl/languages","stargazers_url":"https://api.github.com/repos/openssl/openssl/stargazers","contributors_url":"https://api.github.com/repos/openssl/openssl/contributors","subscribers_url":"https://api.github.com/repos/openssl/openssl/subscribers","subscription_url":"https://api.github.com/repos/openssl/openssl/subscription","commits_url":"https://api.github.com/repos/openssl/openssl/commits{/sha}","git_commits_url":"https://api.github.com/repos/openssl/openssl/git/commits{/sha}","comments_url":"https://api.github.com/repos/openssl/openssl/comments{/number}","issue_comment_url":"https://api.github.com/repos/openssl/openssl/issues/comments{/number}","contents_url":"https://api.github.com/repos/openssl/openssl/contents/{+path}","compare_url":"https://api.github.com/repos/openssl/openssl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openssl/openssl/merges","archive_url":"https://api.github.com/repos/openssl/openssl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openssl/openssl/downloads","issues_url":"https://api.github.com/repos/openssl/openssl/issues{/number}","pulls_url":"https://api.github.com/repos/openssl/openssl/pulls{/number}","milestones_url":"https://api.github.com/repos/openssl/openssl/milestones{/number}","notifications_url":"https://api.github.com/repos/openssl/openssl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openssl/openssl/labels{/name}","releases_url":"https://api.github.com/repos/openssl/openssl/releases{/id}","deployments_url":"https://api.github.com/repos/openssl/openssl/deployments","created_at":"2013-01-15T22:34:48Z","updated_at":"2018-02-07T12:53:39Z","pushed_at":"2018-02-07T14:36:23Z","git_url":"git://github.com/openssl/openssl.git","ssh_url":"git@github.com:openssl/openssl.git","clone_url":"https://github.com/openssl/openssl.git","svn_url":"https://github.com/openssl/openssl","homepage":"https://www.openssl.org","size":139860,"stargazers_count":6331,"watchers_count":6331,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3152,"mirror_url":null,"archived":false,"open_issues_count":395,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":3152,"open_issues":395,"watchers":6331,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openssl/openssl/pulls/5105"},"html":{"href":"https://github.com/openssl/openssl/pull/5105"},"issue":{"href":"https://api.github.com/repos/openssl/openssl/issues/5105"},"comments":{"href":"https://api.github.com/repos/openssl/openssl/issues/5105/comments"},"review_comments":{"href":"https://api.github.com/repos/openssl/openssl/pulls/5105/comments"},"review_comment":{"href":"https://api.github.com/repos/openssl/openssl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openssl/openssl/pulls/5105/commits"},"statuses":{"href":"https://api.github.com/repos/openssl/openssl/statuses/f3cf264cca087405e7d5847f0c2d0b74ab50aee4"}},"author_association":"OWNER"}}
{"actor":{"display_login":"bernd-edlinger"}}