{"action":"created","comment":{"url":"https://api.github.com/repos/ripple/rippled/pulls/comments/235379331","pull_request_review_id":177229137,"id":235379331,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNTM3OTMzMQ==","diff_hunk":"@@ -671,44 +652,71 @@ keypairForSignature(Json::Value const& params, Json::Value& error)\n         }\n     }\n \n-    // ripple-lib encodes seed used to generate an Ed25519 wallet in a\n-    // non-standard way. While we never encode seeds that way, we try\n-    // to detect such keys to avoid user confusion.\n-    if (secretType != jss::seed_hex.c_str())\n+    boost::optional<Seed> seed;\n     {\n-        seed = RPC::parseRippleLibSeed(params[secretType]);\n+        // Check the key type and set the error if needed. returns true if no error,\n+        // false if error\n+        auto checkKeyType = [&error](boost::optional<KeyType> const& expected, boost::optional<KeyType> const& got) -> bool{","path":"src/ripple/rpc/impl/RPCHelpers.cpp","position":null,"original_position":104,"commit_id":"f69d726530ea5dc51951985db5b2a88ea8c9252e","original_commit_id":"91c6c712b0973af30980b849d50e33a4f715d449","user":{"login":"seelabs","id":5853458,"node_id":"MDQ6VXNlcjU4NTM0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/5853458?v=4","gravatar_id":"","url":"https://api.github.com/users/seelabs","html_url":"https://github.com/seelabs","followers_url":"https://api.github.com/users/seelabs/followers","following_url":"https://api.github.com/users/seelabs/following{/other_user}","gists_url":"https://api.github.com/users/seelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/seelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seelabs/subscriptions","organizations_url":"https://api.github.com/users/seelabs/orgs","repos_url":"https://api.github.com/users/seelabs/repos","events_url":"https://api.github.com/users/seelabs/events{/privacy}","received_events_url":"https://api.github.com/users/seelabs/received_events","type":"User","site_admin":false},"body":"Addressed in f69d726530ea5dc51951985db5b2a88ea8c9252e\r\n\r\nBTW, it was only ~20 lines, not 50 :-)","created_at":"2018-11-21T13:07:21Z","updated_at":"2018-11-21T13:07:21Z","html_url":"https://github.com/ripple/rippled/pull/2774#discussion_r235379331","pull_request_url":"https://api.github.com/repos/ripple/rippled/pulls/2774","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments/235379331"},"html":{"href":"https://github.com/ripple/rippled/pull/2774#discussion_r235379331"},"pull_request":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2774"}},"in_reply_to_id":235266926},"pull_request":{"url":"https://api.github.com/repos/ripple/rippled/pulls/2774","id":231653082,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMxNjUzMDgy","html_url":"https://github.com/ripple/rippled/pull/2774","diff_url":"https://github.com/ripple/rippled/pull/2774.diff","patch_url":"https://github.com/ripple/rippled/pull/2774.patch","issue_url":"https://api.github.com/repos/ripple/rippled/issues/2774","number":2774,"state":"open","locked":false,"title":"Refactor base58 decoding (RIPD-1679):","user":{"login":"seelabs","id":5853458,"node_id":"MDQ6VXNlcjU4NTM0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/5853458?v=4","gravatar_id":"","url":"https://api.github.com/users/seelabs","html_url":"https://github.com/seelabs","followers_url":"https://api.github.com/users/seelabs/followers","following_url":"https://api.github.com/users/seelabs/following{/other_user}","gists_url":"https://api.github.com/users/seelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/seelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seelabs/subscriptions","organizations_url":"https://api.github.com/users/seelabs/orgs","repos_url":"https://api.github.com/users/seelabs/repos","events_url":"https://api.github.com/users/seelabs/events{/privacy}","received_events_url":"https://api.github.com/users/seelabs/received_events","type":"User","site_admin":false},"body":"1) Change the interface to the decoding functions so the caller provides the\r\nbuffer that is decoded into.\r\n\r\nThis allows for an implementation that allocates less memory from the heap, and\r\npotentially makes less memory copies. Since all token types except public keys\r\nhave know decoded sizes, it is easy for the caller to provide the buffer. If the\r\ndecoded result does not fit exactly in the provided buffer (except for public\r\nkeys), the decode fails, as the encoded string cannot represent the expected\r\ntoken. A flag may be passed to the low-level decoding functions to allow to\r\ndecode into a smaller buffer. This is used for public keys, which may decode to\r\neither 32 or 33 bytes.\r\n\r\n2) Securely zero memory used in decoding in more situations.\r\n\r\nWhen the low-level decoding routines are decoding a potential secret - like\r\nseeds - then intermediate memory is securely zeroed. When decoding non-secrets -\r\nlike account ids - then it does not zero the memory.\r\n\r\n3) Use a new algorithm for base 58 decoding.\r\n\r\nThe algorithm first encodes the base 58 number as a base 58^10 number. All these\r\ncoefficients will fit into a 64-bit number. This base 58^10 is then decoded\r\nusing boost's multi-precision integer library. This greatly improves decoding\r\ntimes. My benchmark shows approx 10x improvement on 256-bit decodes, not\r\nincluding the checksum. An end-to-end test of the old and new decoder shows a\r\n2x-4x improvement, depending on what's being decoded.\r\n\r\n4) Decode ripple lib encoded seeds at a low level.\r\n\r\nED25519 encoded with ripple lib used a special encoding. Instead of\r\n<TokenId::FamilySeed><16-bytes seed data>, it uses\r\n<TokenId::None><0xE1><0x4B><16-bytes seed data>. This encoding is handled at the\r\nlowest level. A special flag is passed into the decoder to control if this\r\ndecoding should be checked for or not. This simplifies calling client code.\r\nAlthough it does make testing more complex.\r\n\r\nNote that I have not finished writing all the tests I intend for this PR. However, it was suggested to get this in review before all the tests were finished. Also note that as of now some of test are marked \"manual\" b/c they take ~10 minutes to run.","created_at":"2018-11-16T20:56:24Z","updated_at":"2018-11-21T13:07:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9491d1b7f42fb3964a8723960c29a85741006ab","assignee":{"login":"mellery451","id":463430,"node_id":"MDQ6VXNlcjQ2MzQzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/463430?v=4","gravatar_id":"","url":"https://api.github.com/users/mellery451","html_url":"https://github.com/mellery451","followers_url":"https://api.github.com/users/mellery451/followers","following_url":"https://api.github.com/users/mellery451/following{/other_user}","gists_url":"https://api.github.com/users/mellery451/gists{/gist_id}","starred_url":"https://api.github.com/users/mellery451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mellery451/subscriptions","organizations_url":"https://api.github.com/users/mellery451/orgs","repos_url":"https://api.github.com/users/mellery451/repos","events_url":"https://api.github.com/users/mellery451/events{/privacy}","received_events_url":"https://api.github.com/users/mellery451/received_events","type":"User","site_admin":false},"assignees":[{"login":"mellery451","id":463430,"node_id":"MDQ6VXNlcjQ2MzQzMA==","avatar_url":"https://avatars1.githubusercontent.com/u/463430?v=4","gravatar_id":"","url":"https://api.github.com/users/mellery451","html_url":"https://github.com/mellery451","followers_url":"https://api.github.com/users/mellery451/followers","following_url":"https://api.github.com/users/mellery451/following{/other_user}","gists_url":"https://api.github.com/users/mellery451/gists{/gist_id}","starred_url":"https://api.github.com/users/mellery451/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mellery451/subscriptions","organizations_url":"https://api.github.com/users/mellery451/orgs","repos_url":"https://api.github.com/users/mellery451/repos","events_url":"https://api.github.com/users/mellery451/events{/privacy}","received_events_url":"https://api.github.com/users/mellery451/received_events","type":"User","site_admin":false},{"login":"HowardHinnant","id":6708789,"node_id":"MDQ6VXNlcjY3MDg3ODk=","avatar_url":"https://avatars2.githubusercontent.com/u/6708789?v=4","gravatar_id":"","url":"https://api.github.com/users/HowardHinnant","html_url":"https://github.com/HowardHinnant","followers_url":"https://api.github.com/users/HowardHinnant/followers","following_url":"https://api.github.com/users/HowardHinnant/following{/other_user}","gists_url":"https://api.github.com/users/HowardHinnant/gists{/gist_id}","starred_url":"https://api.github.com/users/HowardHinnant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HowardHinnant/subscriptions","organizations_url":"https://api.github.com/users/HowardHinnant/orgs","repos_url":"https://api.github.com/users/HowardHinnant/repos","events_url":"https://api.github.com/users/HowardHinnant/events{/privacy}","received_events_url":"https://api.github.com/users/HowardHinnant/received_events","type":"User","site_admin":false},{"login":"jwbusch","id":9566946,"node_id":"MDQ6VXNlcjk1NjY5NDY=","avatar_url":"https://avatars2.githubusercontent.com/u/9566946?v=4","gravatar_id":"","url":"https://api.github.com/users/jwbusch","html_url":"https://github.com/jwbusch","followers_url":"https://api.github.com/users/jwbusch/followers","following_url":"https://api.github.com/users/jwbusch/following{/other_user}","gists_url":"https://api.github.com/users/jwbusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jwbusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwbusch/subscriptions","organizations_url":"https://api.github.com/users/jwbusch/orgs","repos_url":"https://api.github.com/users/jwbusch/repos","events_url":"https://api.github.com/users/jwbusch/events{/privacy}","received_events_url":"https://api.github.com/users/jwbusch/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/ripple/rippled/pulls/2774/commits","review_comments_url":"https://api.github.com/repos/ripple/rippled/pulls/2774/comments","review_comment_url":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ripple/rippled/issues/2774/comments","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/f69d726530ea5dc51951985db5b2a88ea8c9252e","head":{"label":"seelabs:token-decode","ref":"token-decode","sha":"f69d726530ea5dc51951985db5b2a88ea8c9252e","user":{"login":"seelabs","id":5853458,"node_id":"MDQ6VXNlcjU4NTM0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/5853458?v=4","gravatar_id":"","url":"https://api.github.com/users/seelabs","html_url":"https://github.com/seelabs","followers_url":"https://api.github.com/users/seelabs/followers","following_url":"https://api.github.com/users/seelabs/following{/other_user}","gists_url":"https://api.github.com/users/seelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/seelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seelabs/subscriptions","organizations_url":"https://api.github.com/users/seelabs/orgs","repos_url":"https://api.github.com/users/seelabs/repos","events_url":"https://api.github.com/users/seelabs/events{/privacy}","received_events_url":"https://api.github.com/users/seelabs/received_events","type":"User","site_admin":false},"repo":{"id":28865026,"node_id":"MDEwOlJlcG9zaXRvcnkyODg2NTAyNg==","name":"rippled","full_name":"seelabs/rippled","private":false,"owner":{"login":"seelabs","id":5853458,"node_id":"MDQ6VXNlcjU4NTM0NTg=","avatar_url":"https://avatars0.githubusercontent.com/u/5853458?v=4","gravatar_id":"","url":"https://api.github.com/users/seelabs","html_url":"https://github.com/seelabs","followers_url":"https://api.github.com/users/seelabs/followers","following_url":"https://api.github.com/users/seelabs/following{/other_user}","gists_url":"https://api.github.com/users/seelabs/gists{/gist_id}","starred_url":"https://api.github.com/users/seelabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seelabs/subscriptions","organizations_url":"https://api.github.com/users/seelabs/orgs","repos_url":"https://api.github.com/users/seelabs/repos","events_url":"https://api.github.com/users/seelabs/events{/privacy}","received_events_url":"https://api.github.com/users/seelabs/received_events","type":"User","site_admin":false},"html_url":"https://github.com/seelabs/rippled","description":"Ripple peer-to-peer network daemon","fork":true,"url":"https://api.github.com/repos/seelabs/rippled","forks_url":"https://api.github.com/repos/seelabs/rippled/forks","keys_url":"https://api.github.com/repos/seelabs/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/seelabs/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/seelabs/rippled/teams","hooks_url":"https://api.github.com/repos/seelabs/rippled/hooks","issue_events_url":"https://api.github.com/repos/seelabs/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/seelabs/rippled/events","assignees_url":"https://api.github.com/repos/seelabs/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/seelabs/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/seelabs/rippled/tags","blobs_url":"https://api.github.com/repos/seelabs/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/seelabs/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/seelabs/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/seelabs/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/seelabs/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/seelabs/rippled/languages","stargazers_url":"https://api.github.com/repos/seelabs/rippled/stargazers","contributors_url":"https://api.github.com/repos/seelabs/rippled/contributors","subscribers_url":"https://api.github.com/repos/seelabs/rippled/subscribers","subscription_url":"https://api.github.com/repos/seelabs/rippled/subscription","commits_url":"https://api.github.com/repos/seelabs/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/seelabs/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/seelabs/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/seelabs/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/seelabs/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/seelabs/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/seelabs/rippled/merges","archive_url":"https://api.github.com/repos/seelabs/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/seelabs/rippled/downloads","issues_url":"https://api.github.com/repos/seelabs/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/seelabs/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/seelabs/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/seelabs/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/seelabs/rippled/labels{/name}","releases_url":"https://api.github.com/repos/seelabs/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/seelabs/rippled/deployments","created_at":"2015-01-06T13:36:16Z","updated_at":"2018-11-12T15:18:01Z","pushed_at":"2018-11-21T13:00:21Z","git_url":"git://github.com/seelabs/rippled.git","ssh_url":"git@github.com:seelabs/rippled.git","clone_url":"https://github.com/seelabs/rippled.git","svn_url":"https://github.com/seelabs/rippled","homepage":"https://ripple.com","size":96736,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":1,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"ripple:develop","ref":"develop","sha":"cc824685e7e13ba857374d96e29e2abafbef36da","user":{"login":"ripple","id":3165523,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNjU1MjM=","avatar_url":"https://avatars2.githubusercontent.com/u/3165523?v=4","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"repo":{"id":2724167,"node_id":"MDEwOlJlcG9zaXRvcnkyNzI0MTY3","name":"rippled","full_name":"ripple/rippled","private":false,"owner":{"login":"ripple","id":3165523,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMxNjU1MjM=","avatar_url":"https://avatars2.githubusercontent.com/u/3165523?v=4","gravatar_id":"","url":"https://api.github.com/users/ripple","html_url":"https://github.com/ripple","followers_url":"https://api.github.com/users/ripple/followers","following_url":"https://api.github.com/users/ripple/following{/other_user}","gists_url":"https://api.github.com/users/ripple/gists{/gist_id}","starred_url":"https://api.github.com/users/ripple/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ripple/subscriptions","organizations_url":"https://api.github.com/users/ripple/orgs","repos_url":"https://api.github.com/users/ripple/repos","events_url":"https://api.github.com/users/ripple/events{/privacy}","received_events_url":"https://api.github.com/users/ripple/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ripple/rippled","description":"Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger in C++","fork":false,"url":"https://api.github.com/repos/ripple/rippled","forks_url":"https://api.github.com/repos/ripple/rippled/forks","keys_url":"https://api.github.com/repos/ripple/rippled/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ripple/rippled/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ripple/rippled/teams","hooks_url":"https://api.github.com/repos/ripple/rippled/hooks","issue_events_url":"https://api.github.com/repos/ripple/rippled/issues/events{/number}","events_url":"https://api.github.com/repos/ripple/rippled/events","assignees_url":"https://api.github.com/repos/ripple/rippled/assignees{/user}","branches_url":"https://api.github.com/repos/ripple/rippled/branches{/branch}","tags_url":"https://api.github.com/repos/ripple/rippled/tags","blobs_url":"https://api.github.com/repos/ripple/rippled/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ripple/rippled/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ripple/rippled/git/refs{/sha}","trees_url":"https://api.github.com/repos/ripple/rippled/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ripple/rippled/statuses/{sha}","languages_url":"https://api.github.com/repos/ripple/rippled/languages","stargazers_url":"https://api.github.com/repos/ripple/rippled/stargazers","contributors_url":"https://api.github.com/repos/ripple/rippled/contributors","subscribers_url":"https://api.github.com/repos/ripple/rippled/subscribers","subscription_url":"https://api.github.com/repos/ripple/rippled/subscription","commits_url":"https://api.github.com/repos/ripple/rippled/commits{/sha}","git_commits_url":"https://api.github.com/repos/ripple/rippled/git/commits{/sha}","comments_url":"https://api.github.com/repos/ripple/rippled/comments{/number}","issue_comment_url":"https://api.github.com/repos/ripple/rippled/issues/comments{/number}","contents_url":"https://api.github.com/repos/ripple/rippled/contents/{+path}","compare_url":"https://api.github.com/repos/ripple/rippled/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ripple/rippled/merges","archive_url":"https://api.github.com/repos/ripple/rippled/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ripple/rippled/downloads","issues_url":"https://api.github.com/repos/ripple/rippled/issues{/number}","pulls_url":"https://api.github.com/repos/ripple/rippled/pulls{/number}","milestones_url":"https://api.github.com/repos/ripple/rippled/milestones{/number}","notifications_url":"https://api.github.com/repos/ripple/rippled/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ripple/rippled/labels{/name}","releases_url":"https://api.github.com/repos/ripple/rippled/releases{/id}","deployments_url":"https://api.github.com/repos/ripple/rippled/deployments","created_at":"2011-11-07T04:40:15Z","updated_at":"2018-11-21T08:25:41Z","pushed_at":"2018-11-21T13:00:23Z","git_url":"git://github.com/ripple/rippled.git","ssh_url":"git@github.com:ripple/rippled.git","clone_url":"https://github.com/ripple/rippled.git","svn_url":"https://github.com/ripple/rippled","homepage":"https://ripple.com/xrp","size":94965,"stargazers_count":3038,"watchers_count":3038,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":912,"mirror_url":null,"archived":false,"open_issues_count":90,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":912,"open_issues":90,"watchers":3038,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2774"},"html":{"href":"https://github.com/ripple/rippled/pull/2774"},"issue":{"href":"https://api.github.com/repos/ripple/rippled/issues/2774"},"comments":{"href":"https://api.github.com/repos/ripple/rippled/issues/2774/comments"},"review_comments":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2774/comments"},"review_comment":{"href":"https://api.github.com/repos/ripple/rippled/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ripple/rippled/pulls/2774/commits"},"statuses":{"href":"https://api.github.com/repos/ripple/rippled/statuses/f69d726530ea5dc51951985db5b2a88ea8c9252e"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"seelabs"}}