{"action":"opened","issue":{"url":"https://api.github.com/repos/pvial00/Cube/issues/1","repository_url":"https://api.github.com/repos/pvial00/Cube","labels_url":"https://api.github.com/repos/pvial00/Cube/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/pvial00/Cube/issues/1/comments","events_url":"https://api.github.com/repos/pvial00/Cube/issues/1/events","html_url":"https://github.com/pvial00/Cube/issues/1","id":305280028,"number":1,"title":"Inefficient shifting within gen_cube","user":{"login":"samuel-crypto","id":33577612,"avatar_url":"https://avatars2.githubusercontent.com/u/33577612?v=4","gravatar_id":"","url":"https://api.github.com/users/samuel-crypto","html_url":"https://github.com/samuel-crypto","followers_url":"https://api.github.com/users/samuel-crypto/followers","following_url":"https://api.github.com/users/samuel-crypto/following{/other_user}","gists_url":"https://api.github.com/users/samuel-crypto/gists{/gist_id}","starred_url":"https://api.github.com/users/samuel-crypto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samuel-crypto/subscriptions","organizations_url":"https://api.github.com/users/samuel-crypto/orgs","repos_url":"https://api.github.com/users/samuel-crypto/repos","events_url":"https://api.github.com/users/samuel-crypto/events{/privacy}","received_events_url":"https://api.github.com/users/samuel-crypto/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-14T18:33:21Z","updated_at":"2018-03-14T18:33:21Z","closed_at":null,"author_association":"NONE","body":"In the `gen_cube` function what is essentially a rotation (putting the first member in the last place), described by this code:\r\n```\r\nint shift;\r\nshift = alphabet.at(0);\r\nalphabet.erase(alphabet.begin()+0);\r\nalphabet.push_back(shift);\r\n```\r\nseems very inefficient - this is likely the reason for the slowness of this cipher (vs any complex operations), in implementations of ChaCha for instance use is made of the ultra-fast rotation `<<<` (which can be described in two C shifts with addition/subtraction and a gate), I would strongly suggest moving on a lower level (working with bytes, `uintX_t` types, the ultra fast binary and `<<` and `>>` operators, e.t.c.)"}}
{"actor":{"display_login":"samuel-crypto"}}