{"action":"created","issue":{"url":"https://api.github.com/repos/floodyberry/chacha-opt/issues/2","labels_url":"https://api.github.com/repos/floodyberry/chacha-opt/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/floodyberry/chacha-opt/issues/2/comments","events_url":"https://api.github.com/repos/floodyberry/chacha-opt/issues/2/events","html_url":"https://github.com/floodyberry/chacha-opt/pull/2","id":54075733,"number":2,"title":"Several fixes to the reference implementation and alignment","user":{"login":"vstakhov","id":487344,"avatar_url":"https://avatars.githubusercontent.com/u/487344?v=3","gravatar_id":"","url":"https://api.github.com/users/vstakhov","html_url":"https://github.com/vstakhov","followers_url":"https://api.github.com/users/vstakhov/followers","following_url":"https://api.github.com/users/vstakhov/following{/other_user}","gists_url":"https://api.github.com/users/vstakhov/gists{/gist_id}","starred_url":"https://api.github.com/users/vstakhov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vstakhov/subscriptions","organizations_url":"https://api.github.com/users/vstakhov/orgs","repos_url":"https://api.github.com/users/vstakhov/repos","events_url":"https://api.github.com/users/vstakhov/events{/privacy}","received_events_url":"https://api.github.com/users/vstakhov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-12T16:40:10Z","updated_at":"2015-01-13T00:28:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/floodyberry/chacha-opt/pulls/2","html_url":"https://github.com/floodyberry/chacha-opt/pull/2","diff_url":"https://github.com/floodyberry/chacha-opt/pull/2.diff","patch_url":"https://github.com/floodyberry/chacha-opt/pull/2.patch"},"body":"I have found that using chacha-opt with avx2 is not possible unless chacha_state structure is aligned on 64 bytes boundary. Therefore, I have added explicit alignment for this structure that has fixed the problem. Moreover, the reference implementation leaves session key in the stack variable named `j` after `chacha_blocks` function. I suppose, cleaning is a desired behaviour in this case."},"comment":{"url":"https://api.github.com/repos/floodyberry/chacha-opt/issues/comments/69674463","html_url":"https://github.com/floodyberry/chacha-opt/pull/2#issuecomment-69674463","issue_url":"https://api.github.com/repos/floodyberry/chacha-opt/issues/2","id":69674463,"user":{"login":"vstakhov","id":487344,"avatar_url":"https://avatars.githubusercontent.com/u/487344?v=3","gravatar_id":"","url":"https://api.github.com/users/vstakhov","html_url":"https://github.com/vstakhov","followers_url":"https://api.github.com/users/vstakhov/followers","following_url":"https://api.github.com/users/vstakhov/following{/other_user}","gists_url":"https://api.github.com/users/vstakhov/gists{/gist_id}","starred_url":"https://api.github.com/users/vstakhov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vstakhov/subscriptions","organizations_url":"https://api.github.com/users/vstakhov/orgs","repos_url":"https://api.github.com/users/vstakhov/repos","events_url":"https://api.github.com/users/vstakhov/events{/privacy}","received_events_url":"https://api.github.com/users/vstakhov/received_events","type":"User","site_admin":false},"created_at":"2015-01-13T00:28:07Z","updated_at":"2015-01-13T00:28:07Z","body":"I have also found that `chacha_final` is completely broken, since memset(state, 0, sizeof(state)) occurs *prior* to returning of `state->leftover`. Optimizing compiler might fix that but it is totally incorrect anyway. "}}