{"action":"created","issue":{"url":"https://api.github.com/repos/google/end-to-end/issues/204","repository_url":"https://api.github.com/repos/google/end-to-end","labels_url":"https://api.github.com/repos/google/end-to-end/issues/204/labels{/name}","comments_url":"https://api.github.com/repos/google/end-to-end/issues/204/comments","events_url":"https://api.github.com/repos/google/end-to-end/issues/204/events","html_url":"https://github.com/google/end-to-end/issues/204","id":52736947,"number":204,"title":"Implement CRT for RSA / BigNum","user":{"login":"calvinmetcalf","id":1128607,"avatar_url":"https://avatars.githubusercontent.com/u/1128607?v=3","gravatar_id":"","url":"https://api.github.com/users/calvinmetcalf","html_url":"https://github.com/calvinmetcalf","followers_url":"https://api.github.com/users/calvinmetcalf/followers","following_url":"https://api.github.com/users/calvinmetcalf/following{/other_user}","gists_url":"https://api.github.com/users/calvinmetcalf/gists{/gist_id}","starred_url":"https://api.github.com/users/calvinmetcalf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calvinmetcalf/subscriptions","organizations_url":"https://api.github.com/users/calvinmetcalf/orgs","repos_url":"https://api.github.com/users/calvinmetcalf/repos","events_url":"https://api.github.com/users/calvinmetcalf/events{/privacy}","received_events_url":"https://api.github.com/users/calvinmetcalf/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/google/end-to-end/labels/crypto","name":"crypto","color":"207de5"},{"url":"https://api.github.com/repos/google/end-to-end/labels/enhancement","name":"enhancement","color":"ffdddd"},{"url":"https://api.github.com/repos/google/end-to-end/labels/performance","name":"performance","color":"f7c6c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2014-12-23T12:30:57Z","updated_at":"2016-05-03T18:21:27Z","closed_at":null,"body":"The rsa calculations can be speed up by using the [Chinese remainder theorem](http://en.wikipedia.org/wiki/Chinese_remainder_theorem) instead of just a the [straight forward modpow](https://github.com/google/end-to-end/blob/bd14d9607e742cd94b1a5af39e0f9e8c454b4a32/src/javascript/crypto/e2e/asymmetric/rsa.js#L231).  In my own library this caused speeds to more then double.  Additionally the [inverse of the blind](https://github.com/google/end-to-end/blob/bd14d9607e742cd94b1a5af39e0f9e8c454b4a32/src/javascript/crypto/e2e/asymmetric/rsa.js#L204-L205) can be calculated more efficiently, switching from something like what you have to [the one in bn.js](https://github.com/indutny/bn.js/blob/c6e4bd0744d4cf913071ae3ece7942e253dabd56/lib/bn.js#L1271) caused performance to more then triple, in other words that one operation was more then twice as costly as all the rest of decryption combined. "},"comment":{"url":"https://api.github.com/repos/google/end-to-end/issues/comments/216619426","html_url":"https://github.com/google/end-to-end/issues/204#issuecomment-216619426","issue_url":"https://api.github.com/repos/google/end-to-end/issues/204","id":216619426,"user":{"login":"sirdarckcat","id":33089,"avatar_url":"https://avatars.githubusercontent.com/u/33089?v=3","gravatar_id":"","url":"https://api.github.com/users/sirdarckcat","html_url":"https://github.com/sirdarckcat","followers_url":"https://api.github.com/users/sirdarckcat/followers","following_url":"https://api.github.com/users/sirdarckcat/following{/other_user}","gists_url":"https://api.github.com/users/sirdarckcat/gists{/gist_id}","starred_url":"https://api.github.com/users/sirdarckcat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sirdarckcat/subscriptions","organizations_url":"https://api.github.com/users/sirdarckcat/orgs","repos_url":"https://api.github.com/users/sirdarckcat/repos","events_url":"https://api.github.com/users/sirdarckcat/events{/privacy}","received_events_url":"https://api.github.com/users/sirdarckcat/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T18:21:27Z","updated_at":"2016-05-03T18:21:27Z","body":"leaving it open for (a)\r\n\r\nas per (b) the inverse blind is as-is to keep the algorithm fixed timing."}}