{"action":"created","comment":{"url":"https://api.github.com/repos/yahoo/end-to-end/pulls/comments/39460561","id":39460561,"diff_hunk":"@@ -0,0 +1,185 @@\n+/**\n+ * @license\n+ * Copyright 2015 Yahoo Inc. All rights reserved.\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+/**\n+ * @fileoverview Helper functions for the Yahoo E2E vrf.verify() implementation\n+ * This is ported from https://github.com/yahoo/coname/blob/master/vrf/vrf.go\n+ */\n+\n+goog.provide('e2e.vrf.extra25519');\n+\n+goog.require('goog.asserts');\n+goog.require('goog.crypt');\n+goog.require('e2e.BigNum');\n+goog.require('e2e.ecc.constant');\n+goog.require('e2e.ecc.DomainParam');\n+goog.require('e2e.ecc.PrimeCurve');\n+\n+goog.require('e2e.vrf.sha3Shake256');\n+\n+e2e.vrf.ed25519 = e2e.ecc.DomainParam.fromCurve(e2e.ecc.PrimeCurve.ED_25519);\n+e2e.vrf.curve25519 = e2e.ecc.DomainParam.fromCurve(e2e.ecc.PrimeCurve.CURVE_25519);\n+\n+\n+/**\n+ * Unmarshals an elliptic curve point, and validates that it is an Ed25519 public key\n+ * Refer to Definition 1 in https://www.iacr.org/archive/pkc2003/25670211/25670211.pdf\n+ * \n+ * @param {!e2e.ByteArray} sBytes A byte array of length 32\n+ * @return {!e2e.ecc.point.Ed25519}\n+ */\n+e2e.vrf.extra25519.fromBytesBaseGroup = function(sBytes) {\n+\n+\tvar P = e2e.vrf.ed25519.curve.pointFromByteArray(sBytes);\n+\n+\tgoog.asserts.assert(!P.isInfinity(),","path":"src/javascript/crypto/e2e/vrf/extra25519.js","position":48,"original_position":48,"commit_id":"8762f423bee53dfbf13475b64701ffefb6e6120d","original_commit_id":"8762f423bee53dfbf13475b64701ffefb6e6120d","user":{"login":"adon-at-work","id":8486533,"avatar_url":"https://avatars.githubusercontent.com/u/8486533?v=3","gravatar_id":"","url":"https://api.github.com/users/adon-at-work","html_url":"https://github.com/adon-at-work","followers_url":"https://api.github.com/users/adon-at-work/followers","following_url":"https://api.github.com/users/adon-at-work/following{/other_user}","gists_url":"https://api.github.com/users/adon-at-work/gists{/gist_id}","starred_url":"https://api.github.com/users/adon-at-work/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adon-at-work/subscriptions","organizations_url":"https://api.github.com/users/adon-at-work/orgs","repos_url":"https://api.github.com/users/adon-at-work/repos","events_url":"https://api.github.com/users/adon-at-work/events{/privacy}","received_events_url":"https://api.github.com/users/adon-at-work/received_events","type":"User","site_admin":false},"body":"I sort of follow the practise used by the ecc library. \r\n\r\nAn example can be found here:\r\nhttps://github.com/yahoo/end-to-end/blob/master/src/javascript/crypto/e2e/ecc/curve/curve25519.js#L85","created_at":"2015-09-14T23:40:17Z","updated_at":"2015-09-14T23:40:17Z","html_url":"https://github.com/yahoo/end-to-end/pull/58#discussion_r39460561","pull_request_url":"https://api.github.com/repos/yahoo/end-to-end/pulls/58","_links":{"self":{"href":"https://api.github.com/repos/yahoo/end-to-end/pulls/comments/39460561"},"html":{"href":"https://github.com/yahoo/end-to-end/pull/58#discussion_r39460561"},"pull_request":{"href":"https://api.github.com/repos/yahoo/end-to-end/pulls/58"}}},"pull_request":{"url":"https://api.github.com/repos/yahoo/end-to-end/pulls/58","id":44920761,"html_url":"https://github.com/yahoo/end-to-end/pull/58","diff_url":"https://github.com/yahoo/end-to-end/pull/58.diff","patch_url":"https://github.com/yahoo/end-to-end/pull/58.patch","issue_url":"https://api.github.com/repos/yahoo/end-to-end/issues/58","number":58,"state":"open","locked":false,"title":"Ported the vrf verification feature","user":{"login":"adon-at-work","id":8486533,"avatar_url":"https://avatars.githubusercontent.com/u/8486533?v=3","gravatar_id":"","url":"https://api.github.com/users/adon-at-work","html_url":"https://github.com/adon-at-work","followers_url":"https://api.github.com/users/adon-at-work/followers","following_url":"https://api.github.com/users/adon-at-work/following{/other_user}","gists_url":"https://api.github.com/users/adon-at-work/gists{/gist_id}","starred_url":"https://api.github.com/users/adon-at-work/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adon-at-work/subscriptions","organizations_url":"https://api.github.com/users/adon-at-work/orgs","repos_url":"https://api.github.com/users/adon-at-work/repos","events_url":"https://api.github.com/users/adon-at-work/events{/privacy}","received_events_url":"https://api.github.com/users/adon-at-work/received_events","type":"User","site_admin":false},"body":"This is the vrf verification implementation ported from https://github.com/yahoo/coname/blob/master/vrf/vrf.go \r\n\r\nIt lives as an utility function, and is tested with inputs and outputs captured from the original golang implementation.\r\n\r\nPlease review, thanks.","created_at":"2015-09-14T11:49:49Z","updated_at":"2015-09-14T23:40:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"25b5b4ba980582bf89dabcb2f9a85473e1045bdd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yahoo/end-to-end/pulls/58/commits","review_comments_url":"https://api.github.com/repos/yahoo/end-to-end/pulls/58/comments","review_comment_url":"https://api.github.com/repos/yahoo/end-to-end/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yahoo/end-to-end/issues/58/comments","statuses_url":"https://api.github.com/repos/yahoo/end-to-end/statuses/8762f423bee53dfbf13475b64701ffefb6e6120d","head":{"label":"yahoo:feature/vrf","ref":"feature/vrf","sha":"8762f423bee53dfbf13475b64701ffefb6e6120d","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":32270084,"name":"end-to-end","full_name":"yahoo/end-to-end","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/end-to-end","description":"Use OpenPGP-based encryption in Yahoo mail.","fork":false,"url":"https://api.github.com/repos/yahoo/end-to-end","forks_url":"https://api.github.com/repos/yahoo/end-to-end/forks","keys_url":"https://api.github.com/repos/yahoo/end-to-end/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/end-to-end/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/end-to-end/teams","hooks_url":"https://api.github.com/repos/yahoo/end-to-end/hooks","issue_events_url":"https://api.github.com/repos/yahoo/end-to-end/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/end-to-end/events","assignees_url":"https://api.github.com/repos/yahoo/end-to-end/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/end-to-end/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/end-to-end/tags","blobs_url":"https://api.github.com/repos/yahoo/end-to-end/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/end-to-end/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/end-to-end/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/end-to-end/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/end-to-end/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/end-to-end/languages","stargazers_url":"https://api.github.com/repos/yahoo/end-to-end/stargazers","contributors_url":"https://api.github.com/repos/yahoo/end-to-end/contributors","subscribers_url":"https://api.github.com/repos/yahoo/end-to-end/subscribers","subscription_url":"https://api.github.com/repos/yahoo/end-to-end/subscription","commits_url":"https://api.github.com/repos/yahoo/end-to-end/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/end-to-end/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/end-to-end/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/end-to-end/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/end-to-end/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/end-to-end/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/end-to-end/merges","archive_url":"https://api.github.com/repos/yahoo/end-to-end/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/end-to-end/downloads","issues_url":"https://api.github.com/repos/yahoo/end-to-end/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/end-to-end/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/end-to-end/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/end-to-end/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/end-to-end/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/end-to-end/releases{/id}","created_at":"2015-03-15T16:14:20Z","updated_at":"2015-09-10T14:32:40Z","pushed_at":"2015-09-14T11:49:50Z","git_url":"git://github.com/yahoo/end-to-end.git","ssh_url":"git@github.com:yahoo/end-to-end.git","clone_url":"https://github.com/yahoo/end-to-end.git","svn_url":"https://github.com/yahoo/end-to-end","homepage":"http://yahoo.tumblr.com/post/113708033335/user-focused-security-end-to-end-encryption","size":12878,"stargazers_count":157,"watchers_count":157,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":18,"forks":21,"open_issues":18,"watchers":157,"default_branch":"master"}},"base":{"label":"yahoo:master","ref":"master","sha":"f042b3f794aa05509db03e586ce800c889859662","user":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"repo":{"id":32270084,"name":"end-to-end","full_name":"yahoo/end-to-end","owner":{"login":"yahoo","id":16574,"avatar_url":"https://avatars.githubusercontent.com/u/16574?v=3","gravatar_id":"","url":"https://api.github.com/users/yahoo","html_url":"https://github.com/yahoo","followers_url":"https://api.github.com/users/yahoo/followers","following_url":"https://api.github.com/users/yahoo/following{/other_user}","gists_url":"https://api.github.com/users/yahoo/gists{/gist_id}","starred_url":"https://api.github.com/users/yahoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yahoo/subscriptions","organizations_url":"https://api.github.com/users/yahoo/orgs","repos_url":"https://api.github.com/users/yahoo/repos","events_url":"https://api.github.com/users/yahoo/events{/privacy}","received_events_url":"https://api.github.com/users/yahoo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yahoo/end-to-end","description":"Use OpenPGP-based encryption in Yahoo mail.","fork":false,"url":"https://api.github.com/repos/yahoo/end-to-end","forks_url":"https://api.github.com/repos/yahoo/end-to-end/forks","keys_url":"https://api.github.com/repos/yahoo/end-to-end/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yahoo/end-to-end/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yahoo/end-to-end/teams","hooks_url":"https://api.github.com/repos/yahoo/end-to-end/hooks","issue_events_url":"https://api.github.com/repos/yahoo/end-to-end/issues/events{/number}","events_url":"https://api.github.com/repos/yahoo/end-to-end/events","assignees_url":"https://api.github.com/repos/yahoo/end-to-end/assignees{/user}","branches_url":"https://api.github.com/repos/yahoo/end-to-end/branches{/branch}","tags_url":"https://api.github.com/repos/yahoo/end-to-end/tags","blobs_url":"https://api.github.com/repos/yahoo/end-to-end/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yahoo/end-to-end/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yahoo/end-to-end/git/refs{/sha}","trees_url":"https://api.github.com/repos/yahoo/end-to-end/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yahoo/end-to-end/statuses/{sha}","languages_url":"https://api.github.com/repos/yahoo/end-to-end/languages","stargazers_url":"https://api.github.com/repos/yahoo/end-to-end/stargazers","contributors_url":"https://api.github.com/repos/yahoo/end-to-end/contributors","subscribers_url":"https://api.github.com/repos/yahoo/end-to-end/subscribers","subscription_url":"https://api.github.com/repos/yahoo/end-to-end/subscription","commits_url":"https://api.github.com/repos/yahoo/end-to-end/commits{/sha}","git_commits_url":"https://api.github.com/repos/yahoo/end-to-end/git/commits{/sha}","comments_url":"https://api.github.com/repos/yahoo/end-to-end/comments{/number}","issue_comment_url":"https://api.github.com/repos/yahoo/end-to-end/issues/comments{/number}","contents_url":"https://api.github.com/repos/yahoo/end-to-end/contents/{+path}","compare_url":"https://api.github.com/repos/yahoo/end-to-end/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yahoo/end-to-end/merges","archive_url":"https://api.github.com/repos/yahoo/end-to-end/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yahoo/end-to-end/downloads","issues_url":"https://api.github.com/repos/yahoo/end-to-end/issues{/number}","pulls_url":"https://api.github.com/repos/yahoo/end-to-end/pulls{/number}","milestones_url":"https://api.github.com/repos/yahoo/end-to-end/milestones{/number}","notifications_url":"https://api.github.com/repos/yahoo/end-to-end/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yahoo/end-to-end/labels{/name}","releases_url":"https://api.github.com/repos/yahoo/end-to-end/releases{/id}","created_at":"2015-03-15T16:14:20Z","updated_at":"2015-09-10T14:32:40Z","pushed_at":"2015-09-14T11:49:50Z","git_url":"git://github.com/yahoo/end-to-end.git","ssh_url":"git@github.com:yahoo/end-to-end.git","clone_url":"https://github.com/yahoo/end-to-end.git","svn_url":"https://github.com/yahoo/end-to-end","homepage":"http://yahoo.tumblr.com/post/113708033335/user-focused-security-end-to-end-encryption","size":12878,"stargazers_count":157,"watchers_count":157,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":18,"forks":21,"open_issues":18,"watchers":157,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yahoo/end-to-end/pulls/58"},"html":{"href":"https://github.com/yahoo/end-to-end/pull/58"},"issue":{"href":"https://api.github.com/repos/yahoo/end-to-end/issues/58"},"comments":{"href":"https://api.github.com/repos/yahoo/end-to-end/issues/58/comments"},"review_comments":{"href":"https://api.github.com/repos/yahoo/end-to-end/pulls/58/comments"},"review_comment":{"href":"https://api.github.com/repos/yahoo/end-to-end/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yahoo/end-to-end/pulls/58/commits"},"statuses":{"href":"https://api.github.com/repos/yahoo/end-to-end/statuses/8762f423bee53dfbf13475b64701ffefb6e6120d"}}}}