{"action":"closed","issue":{"url":"https://api.github.com/repos/briansmith/ring/issues/17","labels_url":"https://api.github.com/repos/briansmith/ring/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/briansmith/ring/issues/17/comments","events_url":"https://api.github.com/repos/briansmith/ring/issues/17/events","html_url":"https://github.com/briansmith/ring/issues/17","id":107142089,"number":17,"title":"Refactor |ring::digest| to improve perf and reduce size.","user":{"login":"briansmith","id":16816,"avatar_url":"https://avatars.githubusercontent.com/u/16816?v=3","gravatar_id":"","url":"https://api.github.com/users/briansmith","html_url":"https://github.com/briansmith","followers_url":"https://api.github.com/users/briansmith/followers","following_url":"https://api.github.com/users/briansmith/following{/other_user}","gists_url":"https://api.github.com/users/briansmith/gists{/gist_id}","starred_url":"https://api.github.com/users/briansmith/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/briansmith/subscriptions","organizations_url":"https://api.github.com/users/briansmith/orgs","repos_url":"https://api.github.com/users/briansmith/repos","events_url":"https://api.github.com/users/briansmith/events{/privacy}","received_events_url":"https://api.github.com/users/briansmith/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-18T06:36:28Z","updated_at":"2015-11-09T02:53:18Z","closed_at":"2015-11-09T02:53:18Z","body":"1. The \"init\" functions just initialize the context with constant per-algorithm values. That can be done with a per-algorithm (static) initial context value array and a single init function that uses memcpy to copy that initial value into the context, avoiding the need for per-algorithm init functions. Then we can delete the C code for the init functions.\r\n\r\n2. The streaming interface requires the context to buffer data until an entire block of data is available. Right now, every digest implementation implements its own copy of this logic in C. Instead, w should implement one copy of tthe buffering logic in Rust and remove the C ```_Update``` and ```_Final```functions, leaving only the C ```_Transform``` functions for Rust to call into."}}