{"action":"created","comment":{"url":"https://api.github.com/repos/kmackay/micro-ecc/pulls/comments/55230885","id":55230885,"diff_hunk":"@@ -1046,22 +1064,36 @@ void uECC_compress(const uint8_t *public_key, uint8_t *compressed, uECC_Curve cu\n     for (i = 0; i < curve->num_bytes; ++i) {\n         compressed[i+1] = public_key[i];\n     }\n+#if uECC_VLI_NATIVE_LITTLE_ENDIAN\n+    compressed[0] = 2 + (public_key[curve->num_bytes] & 0x01);\n+#else\n     compressed[0] = 2 + (public_key[curve->num_bytes * 2 - 1] & 0x01);\n+#endif\n }\n \n void uECC_decompress(const uint8_t *compressed, uint8_t *public_key, uECC_Curve curve) {\n+#if uECC_VLI_NATIVE_LITTLE_ENDIAN\n+    uECC_word_t *point = (uECC_word_t *) public_key;\n+#else\n     uECC_word_t point[uECC_MAX_WORDS * 2];\n+#endif\n     uECC_word_t *y = point + curve->num_words;\n+#if uECC_VLI_NATIVE_LITTLE_ENDIAN\n+    memcpy(public_key, compressed+1, curve->num_bytes);\n+#else\n     uECC_vli_bytesToNative(point, compressed + 1, curve->num_bytes);\n+#endif\n     curve->x_side(y, point, curve);\n     curve->mod_sqrt(y, curve);\n \n     if ((y[0] & 0x01) != (compressed[0] & 0x01)) {\n-        uECC_vli_sub(y, curve->p, y, curve->num_words);\n+      uECC_vli_sub(y, curve->p, y, curve->num_words);","path":"uECC.c","position":94,"original_position":94,"commit_id":"778effd96739f3bb85b4bcbe8af8e9b8315fac9a","original_commit_id":"778effd96739f3bb85b4bcbe8af8e9b8315fac9a","user":{"login":"kmackay","id":3208815,"avatar_url":"https://avatars.githubusercontent.com/u/3208815?v=3","gravatar_id":"","url":"https://api.github.com/users/kmackay","html_url":"https://github.com/kmackay","followers_url":"https://api.github.com/users/kmackay/followers","following_url":"https://api.github.com/users/kmackay/following{/other_user}","gists_url":"https://api.github.com/users/kmackay/gists{/gist_id}","starred_url":"https://api.github.com/users/kmackay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmackay/subscriptions","organizations_url":"https://api.github.com/users/kmackay/orgs","repos_url":"https://api.github.com/users/kmackay/repos","events_url":"https://api.github.com/users/kmackay/events{/privacy}","received_events_url":"https://api.github.com/users/kmackay/received_events","type":"User","site_admin":false},"body":"nit: 4-space indent","created_at":"2016-03-07T16:39:35Z","updated_at":"2016-03-07T16:39:35Z","html_url":"https://github.com/kmackay/micro-ecc/pull/72#discussion_r55230885","pull_request_url":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/kmackay/micro-ecc/pulls/comments/55230885"},"html":{"href":"https://github.com/kmackay/micro-ecc/pull/72#discussion_r55230885"},"pull_request":{"href":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72","id":61311984,"html_url":"https://github.com/kmackay/micro-ecc/pull/72","diff_url":"https://github.com/kmackay/micro-ecc/pull/72.diff","patch_url":"https://github.com/kmackay/micro-ecc/pull/72.patch","issue_url":"https://api.github.com/repos/kmackay/micro-ecc/issues/72","number":72,"state":"open","locked":false,"title":"Add a new compile-time macro to use the local native format for VLI","user":{"login":"carlescufi","id":12450381,"avatar_url":"https://avatars.githubusercontent.com/u/12450381?v=3","gravatar_id":"","url":"https://api.github.com/users/carlescufi","html_url":"https://github.com/carlescufi","followers_url":"https://api.github.com/users/carlescufi/followers","following_url":"https://api.github.com/users/carlescufi/following{/other_user}","gists_url":"https://api.github.com/users/carlescufi/gists{/gist_id}","starred_url":"https://api.github.com/users/carlescufi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlescufi/subscriptions","organizations_url":"https://api.github.com/users/carlescufi/orgs","repos_url":"https://api.github.com/users/carlescufi/repos","events_url":"https://api.github.com/users/carlescufi/events{/privacy}","received_events_url":"https://api.github.com/users/carlescufi/received_events","type":"User","site_admin":false},"body":"Add a new compile-time macro to use the local native format for VLI handling. This is useful for little-endian machines that have to interface with protocol stacks using little-endian byte ordering. It saves certain implementations from having to wrap all calls to the uECC API in uECC_vli_nativeToBytes() and uECC_vli_bytesToNative() ","created_at":"2016-03-01T21:33:12Z","updated_at":"2016-03-07T16:39:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94197f26ce18528ea0dabca7c2b2f565a42ce860","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72/commits","review_comments_url":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72/comments","review_comment_url":"https://api.github.com/repos/kmackay/micro-ecc/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kmackay/micro-ecc/issues/72/comments","statuses_url":"https://api.github.com/repos/kmackay/micro-ecc/statuses/778effd96739f3bb85b4bcbe8af8e9b8315fac9a","head":{"label":"carlescufi:master","ref":"master","sha":"778effd96739f3bb85b4bcbe8af8e9b8315fac9a","user":{"login":"carlescufi","id":12450381,"avatar_url":"https://avatars.githubusercontent.com/u/12450381?v=3","gravatar_id":"","url":"https://api.github.com/users/carlescufi","html_url":"https://github.com/carlescufi","followers_url":"https://api.github.com/users/carlescufi/followers","following_url":"https://api.github.com/users/carlescufi/following{/other_user}","gists_url":"https://api.github.com/users/carlescufi/gists{/gist_id}","starred_url":"https://api.github.com/users/carlescufi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlescufi/subscriptions","organizations_url":"https://api.github.com/users/carlescufi/orgs","repos_url":"https://api.github.com/users/carlescufi/repos","events_url":"https://api.github.com/users/carlescufi/events{/privacy}","received_events_url":"https://api.github.com/users/carlescufi/received_events","type":"User","site_admin":false},"repo":{"id":52908868,"name":"micro-ecc","full_name":"carlescufi/micro-ecc","owner":{"login":"carlescufi","id":12450381,"avatar_url":"https://avatars.githubusercontent.com/u/12450381?v=3","gravatar_id":"","url":"https://api.github.com/users/carlescufi","html_url":"https://github.com/carlescufi","followers_url":"https://api.github.com/users/carlescufi/followers","following_url":"https://api.github.com/users/carlescufi/following{/other_user}","gists_url":"https://api.github.com/users/carlescufi/gists{/gist_id}","starred_url":"https://api.github.com/users/carlescufi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carlescufi/subscriptions","organizations_url":"https://api.github.com/users/carlescufi/orgs","repos_url":"https://api.github.com/users/carlescufi/repos","events_url":"https://api.github.com/users/carlescufi/events{/privacy}","received_events_url":"https://api.github.com/users/carlescufi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/carlescufi/micro-ecc","description":"ECDH and ECDSA for 8-bit, 32-bit, and 64-bit processors.","fork":true,"url":"https://api.github.com/repos/carlescufi/micro-ecc","forks_url":"https://api.github.com/repos/carlescufi/micro-ecc/forks","keys_url":"https://api.github.com/repos/carlescufi/micro-ecc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carlescufi/micro-ecc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carlescufi/micro-ecc/teams","hooks_url":"https://api.github.com/repos/carlescufi/micro-ecc/hooks","issue_events_url":"https://api.github.com/repos/carlescufi/micro-ecc/issues/events{/number}","events_url":"https://api.github.com/repos/carlescufi/micro-ecc/events","assignees_url":"https://api.github.com/repos/carlescufi/micro-ecc/assignees{/user}","branches_url":"https://api.github.com/repos/carlescufi/micro-ecc/branches{/branch}","tags_url":"https://api.github.com/repos/carlescufi/micro-ecc/tags","blobs_url":"https://api.github.com/repos/carlescufi/micro-ecc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carlescufi/micro-ecc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carlescufi/micro-ecc/git/refs{/sha}","trees_url":"https://api.github.com/repos/carlescufi/micro-ecc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carlescufi/micro-ecc/statuses/{sha}","languages_url":"https://api.github.com/repos/carlescufi/micro-ecc/languages","stargazers_url":"https://api.github.com/repos/carlescufi/micro-ecc/stargazers","contributors_url":"https://api.github.com/repos/carlescufi/micro-ecc/contributors","subscribers_url":"https://api.github.com/repos/carlescufi/micro-ecc/subscribers","subscription_url":"https://api.github.com/repos/carlescufi/micro-ecc/subscription","commits_url":"https://api.github.com/repos/carlescufi/micro-ecc/commits{/sha}","git_commits_url":"https://api.github.com/repos/carlescufi/micro-ecc/git/commits{/sha}","comments_url":"https://api.github.com/repos/carlescufi/micro-ecc/comments{/number}","issue_comment_url":"https://api.github.com/repos/carlescufi/micro-ecc/issues/comments{/number}","contents_url":"https://api.github.com/repos/carlescufi/micro-ecc/contents/{+path}","compare_url":"https://api.github.com/repos/carlescufi/micro-ecc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carlescufi/micro-ecc/merges","archive_url":"https://api.github.com/repos/carlescufi/micro-ecc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carlescufi/micro-ecc/downloads","issues_url":"https://api.github.com/repos/carlescufi/micro-ecc/issues{/number}","pulls_url":"https://api.github.com/repos/carlescufi/micro-ecc/pulls{/number}","milestones_url":"https://api.github.com/repos/carlescufi/micro-ecc/milestones{/number}","notifications_url":"https://api.github.com/repos/carlescufi/micro-ecc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carlescufi/micro-ecc/labels{/name}","releases_url":"https://api.github.com/repos/carlescufi/micro-ecc/releases{/id}","deployments_url":"https://api.github.com/repos/carlescufi/micro-ecc/deployments","created_at":"2016-03-01T20:48:54Z","updated_at":"2016-03-01T20:48:56Z","pushed_at":"2016-03-07T12:10:25Z","git_url":"git://github.com/carlescufi/micro-ecc.git","ssh_url":"git@github.com:carlescufi/micro-ecc.git","clone_url":"https://github.com/carlescufi/micro-ecc.git","svn_url":"https://github.com/carlescufi/micro-ecc","homepage":"","size":616,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"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":"kmackay:master","ref":"master","sha":"b970244fa1ae075c8ce575ebfb6f870877217b36","user":{"login":"kmackay","id":3208815,"avatar_url":"https://avatars.githubusercontent.com/u/3208815?v=3","gravatar_id":"","url":"https://api.github.com/users/kmackay","html_url":"https://github.com/kmackay","followers_url":"https://api.github.com/users/kmackay/followers","following_url":"https://api.github.com/users/kmackay/following{/other_user}","gists_url":"https://api.github.com/users/kmackay/gists{/gist_id}","starred_url":"https://api.github.com/users/kmackay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmackay/subscriptions","organizations_url":"https://api.github.com/users/kmackay/orgs","repos_url":"https://api.github.com/users/kmackay/repos","events_url":"https://api.github.com/users/kmackay/events{/privacy}","received_events_url":"https://api.github.com/users/kmackay/received_events","type":"User","site_admin":false},"repo":{"id":9871244,"name":"micro-ecc","full_name":"kmackay/micro-ecc","owner":{"login":"kmackay","id":3208815,"avatar_url":"https://avatars.githubusercontent.com/u/3208815?v=3","gravatar_id":"","url":"https://api.github.com/users/kmackay","html_url":"https://github.com/kmackay","followers_url":"https://api.github.com/users/kmackay/followers","following_url":"https://api.github.com/users/kmackay/following{/other_user}","gists_url":"https://api.github.com/users/kmackay/gists{/gist_id}","starred_url":"https://api.github.com/users/kmackay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kmackay/subscriptions","organizations_url":"https://api.github.com/users/kmackay/orgs","repos_url":"https://api.github.com/users/kmackay/repos","events_url":"https://api.github.com/users/kmackay/events{/privacy}","received_events_url":"https://api.github.com/users/kmackay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kmackay/micro-ecc","description":"ECDH and ECDSA for 8-bit, 32-bit, and 64-bit processors.","fork":false,"url":"https://api.github.com/repos/kmackay/micro-ecc","forks_url":"https://api.github.com/repos/kmackay/micro-ecc/forks","keys_url":"https://api.github.com/repos/kmackay/micro-ecc/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kmackay/micro-ecc/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kmackay/micro-ecc/teams","hooks_url":"https://api.github.com/repos/kmackay/micro-ecc/hooks","issue_events_url":"https://api.github.com/repos/kmackay/micro-ecc/issues/events{/number}","events_url":"https://api.github.com/repos/kmackay/micro-ecc/events","assignees_url":"https://api.github.com/repos/kmackay/micro-ecc/assignees{/user}","branches_url":"https://api.github.com/repos/kmackay/micro-ecc/branches{/branch}","tags_url":"https://api.github.com/repos/kmackay/micro-ecc/tags","blobs_url":"https://api.github.com/repos/kmackay/micro-ecc/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kmackay/micro-ecc/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kmackay/micro-ecc/git/refs{/sha}","trees_url":"https://api.github.com/repos/kmackay/micro-ecc/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kmackay/micro-ecc/statuses/{sha}","languages_url":"https://api.github.com/repos/kmackay/micro-ecc/languages","stargazers_url":"https://api.github.com/repos/kmackay/micro-ecc/stargazers","contributors_url":"https://api.github.com/repos/kmackay/micro-ecc/contributors","subscribers_url":"https://api.github.com/repos/kmackay/micro-ecc/subscribers","subscription_url":"https://api.github.com/repos/kmackay/micro-ecc/subscription","commits_url":"https://api.github.com/repos/kmackay/micro-ecc/commits{/sha}","git_commits_url":"https://api.github.com/repos/kmackay/micro-ecc/git/commits{/sha}","comments_url":"https://api.github.com/repos/kmackay/micro-ecc/comments{/number}","issue_comment_url":"https://api.github.com/repos/kmackay/micro-ecc/issues/comments{/number}","contents_url":"https://api.github.com/repos/kmackay/micro-ecc/contents/{+path}","compare_url":"https://api.github.com/repos/kmackay/micro-ecc/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kmackay/micro-ecc/merges","archive_url":"https://api.github.com/repos/kmackay/micro-ecc/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kmackay/micro-ecc/downloads","issues_url":"https://api.github.com/repos/kmackay/micro-ecc/issues{/number}","pulls_url":"https://api.github.com/repos/kmackay/micro-ecc/pulls{/number}","milestones_url":"https://api.github.com/repos/kmackay/micro-ecc/milestones{/number}","notifications_url":"https://api.github.com/repos/kmackay/micro-ecc/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kmackay/micro-ecc/labels{/name}","releases_url":"https://api.github.com/repos/kmackay/micro-ecc/releases{/id}","deployments_url":"https://api.github.com/repos/kmackay/micro-ecc/deployments","created_at":"2013-05-05T16:29:20Z","updated_at":"2016-03-03T16:01:55Z","pushed_at":"2016-03-07T12:10:26Z","git_url":"git://github.com/kmackay/micro-ecc.git","ssh_url":"git@github.com:kmackay/micro-ecc.git","clone_url":"https://github.com/kmackay/micro-ecc.git","svn_url":"https://github.com/kmackay/micro-ecc","homepage":"","size":783,"stargazers_count":166,"watchers_count":166,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":64,"mirror_url":null,"open_issues_count":6,"forks":64,"open_issues":6,"watchers":166,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72"},"html":{"href":"https://github.com/kmackay/micro-ecc/pull/72"},"issue":{"href":"https://api.github.com/repos/kmackay/micro-ecc/issues/72"},"comments":{"href":"https://api.github.com/repos/kmackay/micro-ecc/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/kmackay/micro-ecc/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kmackay/micro-ecc/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/kmackay/micro-ecc/statuses/778effd96739f3bb85b4bcbe8af8e9b8315fac9a"}}}}