{"action":"created","comment":{"url":"https://api.github.com/repos/ebfull/pairing/pulls/comments/135381164","pull_request_review_id":58793659,"id":135381164,"diff_hunk":"@@ -21,6 +28,14 @@ const R2: FqRepr = FqRepr([0xf4df1f341c341746, 0xa76e6a609d104f1, 0x8de5476c4c95\n // INV = -(q^{-1} mod q) mod q\n const INV: u64 = 0x89f3fffcfffcfffd;\n \n+// SWENC_CONST0 = sqrt(-3) mod q =\n+// 1586958781458431025242759403266842894121773480562120986020912974854563298150952611241517463240701\n+pub const SWENC_CONST0: Fq = Fq(FqRepr([0x1dec6c36f3181f22, 0xb4b9bb641054b457, 0x25695a2be9415286, 0x982b6cbf66c749bc, 0x7d58e1ae1feb7873, 0x62c96300937c0b9]));","path":"src/bls12_381/fq.rs","position":22,"original_position":22,"commit_id":"21796faa99e3b527839f88fbc474aea49dbf8521","original_commit_id":"21796faa99e3b527839f88fbc474aea49dbf8521","user":{"login":"zmanian","id":93434,"avatar_url":"https://avatars3.githubusercontent.com/u/93434?v=4","gravatar_id":"","url":"https://api.github.com/users/zmanian","html_url":"https://github.com/zmanian","followers_url":"https://api.github.com/users/zmanian/followers","following_url":"https://api.github.com/users/zmanian/following{/other_user}","gists_url":"https://api.github.com/users/zmanian/gists{/gist_id}","starred_url":"https://api.github.com/users/zmanian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zmanian/subscriptions","organizations_url":"https://api.github.com/users/zmanian/orgs","repos_url":"https://api.github.com/users/zmanian/repos","events_url":"https://api.github.com/users/zmanian/events{/privacy}","received_events_url":"https://api.github.com/users/zmanian/received_events","type":"User","site_admin":false},"body":"It would be good to document why these constants are significant.","created_at":"2017-08-26T04:15:14Z","updated_at":"2017-08-26T04:15:14Z","html_url":"https://github.com/ebfull/pairing/pull/30#discussion_r135381164","pull_request_url":"https://api.github.com/repos/ebfull/pairing/pulls/30","_links":{"self":{"href":"https://api.github.com/repos/ebfull/pairing/pulls/comments/135381164"},"html":{"href":"https://github.com/ebfull/pairing/pull/30#discussion_r135381164"},"pull_request":{"href":"https://api.github.com/repos/ebfull/pairing/pulls/30"}}},"pull_request":{"url":"https://api.github.com/repos/ebfull/pairing/pulls/30","id":135045957,"html_url":"https://github.com/ebfull/pairing/pull/30","diff_url":"https://github.com/ebfull/pairing/pull/30.diff","patch_url":"https://github.com/ebfull/pairing/pull/30.patch","issue_url":"https://api.github.com/repos/ebfull/pairing/issues/30","number":30,"state":"open","locked":false,"title":"Add hashing into the curve.","user":{"login":"mmaker","id":278405,"avatar_url":"https://avatars1.githubusercontent.com/u/278405?v=4","gravatar_id":"","url":"https://api.github.com/users/mmaker","html_url":"https://github.com/mmaker","followers_url":"https://api.github.com/users/mmaker/followers","following_url":"https://api.github.com/users/mmaker/following{/other_user}","gists_url":"https://api.github.com/users/mmaker/gists{/gist_id}","starred_url":"https://api.github.com/users/mmaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmaker/subscriptions","organizations_url":"https://api.github.com/users/mmaker/orgs","repos_url":"https://api.github.com/users/mmaker/repos","events_url":"https://api.github.com/users/mmaker/events{/privacy}","received_events_url":"https://api.github.com/users/mmaker/received_events","type":"User","site_admin":false},"body":"Hello.\r\nA few days ago @zmanian said it'd be nice if somebody added hashing to the curve to `pairing`, and I found myself with a few spare days in bed, soo… I'd like to propose the folllowing changes:\r\n\r\n- Add Legendre symbol for Fq and Fq2, with test cases\r\n- Implement Foque-Ticouchi's hashing to the curve algorithm\r\n\r\nThe algorithm is pretty much along the lines of https://github.com/herumi/mcl/blob/9fbc54305d01b984e39d83e96bfa94bb17648a86/include/mcl/bn.hpp#L65-L127 , as suggested by @zmanian.","created_at":"2017-08-10T05:49:13Z","updated_at":"2017-08-26T04:15:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"65a8572e28ebe461d20c510e71bf4e16348be6e5","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/ebfull/pairing/pulls/30/commits","review_comments_url":"https://api.github.com/repos/ebfull/pairing/pulls/30/comments","review_comment_url":"https://api.github.com/repos/ebfull/pairing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ebfull/pairing/issues/30/comments","statuses_url":"https://api.github.com/repos/ebfull/pairing/statuses/21796faa99e3b527839f88fbc474aea49dbf8521","head":{"label":"mmaker:master","ref":"master","sha":"21796faa99e3b527839f88fbc474aea49dbf8521","user":{"login":"mmaker","id":278405,"avatar_url":"https://avatars1.githubusercontent.com/u/278405?v=4","gravatar_id":"","url":"https://api.github.com/users/mmaker","html_url":"https://github.com/mmaker","followers_url":"https://api.github.com/users/mmaker/followers","following_url":"https://api.github.com/users/mmaker/following{/other_user}","gists_url":"https://api.github.com/users/mmaker/gists{/gist_id}","starred_url":"https://api.github.com/users/mmaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmaker/subscriptions","organizations_url":"https://api.github.com/users/mmaker/orgs","repos_url":"https://api.github.com/users/mmaker/repos","events_url":"https://api.github.com/users/mmaker/events{/privacy}","received_events_url":"https://api.github.com/users/mmaker/received_events","type":"User","site_admin":false},"repo":{"id":99576136,"name":"pairing","full_name":"mmaker/pairing","owner":{"login":"mmaker","id":278405,"avatar_url":"https://avatars1.githubusercontent.com/u/278405?v=4","gravatar_id":"","url":"https://api.github.com/users/mmaker","html_url":"https://github.com/mmaker","followers_url":"https://api.github.com/users/mmaker/followers","following_url":"https://api.github.com/users/mmaker/following{/other_user}","gists_url":"https://api.github.com/users/mmaker/gists{/gist_id}","starred_url":"https://api.github.com/users/mmaker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mmaker/subscriptions","organizations_url":"https://api.github.com/users/mmaker/orgs","repos_url":"https://api.github.com/users/mmaker/repos","events_url":"https://api.github.com/users/mmaker/events{/privacy}","received_events_url":"https://api.github.com/users/mmaker/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mmaker/pairing","description":"Pairing-friendly elliptic curve library","fork":true,"url":"https://api.github.com/repos/mmaker/pairing","forks_url":"https://api.github.com/repos/mmaker/pairing/forks","keys_url":"https://api.github.com/repos/mmaker/pairing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mmaker/pairing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mmaker/pairing/teams","hooks_url":"https://api.github.com/repos/mmaker/pairing/hooks","issue_events_url":"https://api.github.com/repos/mmaker/pairing/issues/events{/number}","events_url":"https://api.github.com/repos/mmaker/pairing/events","assignees_url":"https://api.github.com/repos/mmaker/pairing/assignees{/user}","branches_url":"https://api.github.com/repos/mmaker/pairing/branches{/branch}","tags_url":"https://api.github.com/repos/mmaker/pairing/tags","blobs_url":"https://api.github.com/repos/mmaker/pairing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mmaker/pairing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mmaker/pairing/git/refs{/sha}","trees_url":"https://api.github.com/repos/mmaker/pairing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mmaker/pairing/statuses/{sha}","languages_url":"https://api.github.com/repos/mmaker/pairing/languages","stargazers_url":"https://api.github.com/repos/mmaker/pairing/stargazers","contributors_url":"https://api.github.com/repos/mmaker/pairing/contributors","subscribers_url":"https://api.github.com/repos/mmaker/pairing/subscribers","subscription_url":"https://api.github.com/repos/mmaker/pairing/subscription","commits_url":"https://api.github.com/repos/mmaker/pairing/commits{/sha}","git_commits_url":"https://api.github.com/repos/mmaker/pairing/git/commits{/sha}","comments_url":"https://api.github.com/repos/mmaker/pairing/comments{/number}","issue_comment_url":"https://api.github.com/repos/mmaker/pairing/issues/comments{/number}","contents_url":"https://api.github.com/repos/mmaker/pairing/contents/{+path}","compare_url":"https://api.github.com/repos/mmaker/pairing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mmaker/pairing/merges","archive_url":"https://api.github.com/repos/mmaker/pairing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mmaker/pairing/downloads","issues_url":"https://api.github.com/repos/mmaker/pairing/issues{/number}","pulls_url":"https://api.github.com/repos/mmaker/pairing/pulls{/number}","milestones_url":"https://api.github.com/repos/mmaker/pairing/milestones{/number}","notifications_url":"https://api.github.com/repos/mmaker/pairing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mmaker/pairing/labels{/name}","releases_url":"https://api.github.com/repos/mmaker/pairing/releases{/id}","deployments_url":"https://api.github.com/repos/mmaker/pairing/deployments","created_at":"2017-08-07T12:35:06Z","updated_at":"2017-08-10T17:30:43Z","pushed_at":"2017-08-25T21:57:46Z","git_url":"git://github.com/mmaker/pairing.git","ssh_url":"git@github.com:mmaker/pairing.git","clone_url":"https://github.com/mmaker/pairing.git","svn_url":"https://github.com/mmaker/pairing","homepage":"","size":572,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ebfull:master","ref":"master","sha":"57de78f4f1052fb6adbc201914158711986ed9b5","user":{"login":"ebfull","id":3794471,"avatar_url":"https://avatars1.githubusercontent.com/u/3794471?v=4","gravatar_id":"","url":"https://api.github.com/users/ebfull","html_url":"https://github.com/ebfull","followers_url":"https://api.github.com/users/ebfull/followers","following_url":"https://api.github.com/users/ebfull/following{/other_user}","gists_url":"https://api.github.com/users/ebfull/gists{/gist_id}","starred_url":"https://api.github.com/users/ebfull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebfull/subscriptions","organizations_url":"https://api.github.com/users/ebfull/orgs","repos_url":"https://api.github.com/users/ebfull/repos","events_url":"https://api.github.com/users/ebfull/events{/privacy}","received_events_url":"https://api.github.com/users/ebfull/received_events","type":"User","site_admin":false},"repo":{"id":96633177,"name":"pairing","full_name":"ebfull/pairing","owner":{"login":"ebfull","id":3794471,"avatar_url":"https://avatars1.githubusercontent.com/u/3794471?v=4","gravatar_id":"","url":"https://api.github.com/users/ebfull","html_url":"https://github.com/ebfull","followers_url":"https://api.github.com/users/ebfull/followers","following_url":"https://api.github.com/users/ebfull/following{/other_user}","gists_url":"https://api.github.com/users/ebfull/gists{/gist_id}","starred_url":"https://api.github.com/users/ebfull/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ebfull/subscriptions","organizations_url":"https://api.github.com/users/ebfull/orgs","repos_url":"https://api.github.com/users/ebfull/repos","events_url":"https://api.github.com/users/ebfull/events{/privacy}","received_events_url":"https://api.github.com/users/ebfull/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ebfull/pairing","description":"Pairing-friendly elliptic curve library","fork":false,"url":"https://api.github.com/repos/ebfull/pairing","forks_url":"https://api.github.com/repos/ebfull/pairing/forks","keys_url":"https://api.github.com/repos/ebfull/pairing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ebfull/pairing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ebfull/pairing/teams","hooks_url":"https://api.github.com/repos/ebfull/pairing/hooks","issue_events_url":"https://api.github.com/repos/ebfull/pairing/issues/events{/number}","events_url":"https://api.github.com/repos/ebfull/pairing/events","assignees_url":"https://api.github.com/repos/ebfull/pairing/assignees{/user}","branches_url":"https://api.github.com/repos/ebfull/pairing/branches{/branch}","tags_url":"https://api.github.com/repos/ebfull/pairing/tags","blobs_url":"https://api.github.com/repos/ebfull/pairing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ebfull/pairing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ebfull/pairing/git/refs{/sha}","trees_url":"https://api.github.com/repos/ebfull/pairing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ebfull/pairing/statuses/{sha}","languages_url":"https://api.github.com/repos/ebfull/pairing/languages","stargazers_url":"https://api.github.com/repos/ebfull/pairing/stargazers","contributors_url":"https://api.github.com/repos/ebfull/pairing/contributors","subscribers_url":"https://api.github.com/repos/ebfull/pairing/subscribers","subscription_url":"https://api.github.com/repos/ebfull/pairing/subscription","commits_url":"https://api.github.com/repos/ebfull/pairing/commits{/sha}","git_commits_url":"https://api.github.com/repos/ebfull/pairing/git/commits{/sha}","comments_url":"https://api.github.com/repos/ebfull/pairing/comments{/number}","issue_comment_url":"https://api.github.com/repos/ebfull/pairing/issues/comments{/number}","contents_url":"https://api.github.com/repos/ebfull/pairing/contents/{+path}","compare_url":"https://api.github.com/repos/ebfull/pairing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ebfull/pairing/merges","archive_url":"https://api.github.com/repos/ebfull/pairing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ebfull/pairing/downloads","issues_url":"https://api.github.com/repos/ebfull/pairing/issues{/number}","pulls_url":"https://api.github.com/repos/ebfull/pairing/pulls{/number}","milestones_url":"https://api.github.com/repos/ebfull/pairing/milestones{/number}","notifications_url":"https://api.github.com/repos/ebfull/pairing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ebfull/pairing/labels{/name}","releases_url":"https://api.github.com/repos/ebfull/pairing/releases{/id}","deployments_url":"https://api.github.com/repos/ebfull/pairing/deployments","created_at":"2017-07-08T17:16:44Z","updated_at":"2017-08-04T04:10:14Z","pushed_at":"2017-08-25T21:39:46Z","git_url":"git://github.com/ebfull/pairing.git","ssh_url":"git@github.com:ebfull/pairing.git","clone_url":"https://github.com/ebfull/pairing.git","svn_url":"https://github.com/ebfull/pairing","homepage":"","size":520,"stargazers_count":10,"watchers_count":10,"language":"Rust","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":8,"forks":4,"open_issues":8,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ebfull/pairing/pulls/30"},"html":{"href":"https://github.com/ebfull/pairing/pull/30"},"issue":{"href":"https://api.github.com/repos/ebfull/pairing/issues/30"},"comments":{"href":"https://api.github.com/repos/ebfull/pairing/issues/30/comments"},"review_comments":{"href":"https://api.github.com/repos/ebfull/pairing/pulls/30/comments"},"review_comment":{"href":"https://api.github.com/repos/ebfull/pairing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ebfull/pairing/pulls/30/commits"},"statuses":{"href":"https://api.github.com/repos/ebfull/pairing/statuses/21796faa99e3b527839f88fbc474aea49dbf8521"}}}}
{"actor":{"display_login":"zmanian"}}