{"comment":{"url":"https://api.github.com/repos/freebsd/freebsd/comments/31670768","html_url":"https://github.com/freebsd/freebsd/commit/53c4fca8e5700ed611488f3569d4705a86d3121f#commitcomment-31670768","id":31670768,"node_id":"MDEzOkNvbW1pdENvbW1lbnQzMTY3MDc2OA==","user":{"login":"cotequeiroz","id":35331380,"node_id":"MDQ6VXNlcjM1MzMxMzgw","avatar_url":"https://avatars2.githubusercontent.com/u/35331380?v=4","gravatar_id":"","url":"https://api.github.com/users/cotequeiroz","html_url":"https://github.com/cotequeiroz","followers_url":"https://api.github.com/users/cotequeiroz/followers","following_url":"https://api.github.com/users/cotequeiroz/following{/other_user}","gists_url":"https://api.github.com/users/cotequeiroz/gists{/gist_id}","starred_url":"https://api.github.com/users/cotequeiroz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cotequeiroz/subscriptions","organizations_url":"https://api.github.com/users/cotequeiroz/orgs","repos_url":"https://api.github.com/users/cotequeiroz/repos","events_url":"https://api.github.com/users/cotequeiroz/events{/privacy}","received_events_url":"https://api.github.com/users/cotequeiroz/received_events","type":"User","site_admin":false},"position":null,"line":null,"path":null,"commit_id":"53c4fca8e5700ed611488f3569d4705a86d3121f","created_at":"2018-12-13T19:45:06Z","updated_at":"2018-12-13T19:45:06Z","author_association":"NONE","body":"I shall start this by disclosing that I'm not an expert on how the kernel (linux or bsd) handle crypto.  I know enough to be able to run the engine :smiley: .  Most of the cryptodev is documented by examples, but I figured most of it out.\r\nBasic, non-AEAD ciphers are handled pretty much the same way in both linux and BSD, so that's out of the question for now.\r\nFor digests/hashes, the basic one-shot operation is done the same way in both linux and BSD:  you initialize a session with CIOCGSESSION, then pass the plaintext and get the result with CIOCCRYPT, then close the session with CIOCFSESSION.  The old openssl cryptodev engine used exclusively that mode of operation.\r\n\r\nOpenssl, on the other hand, works like this.  First you initialize a context with `EVP_DigestInit_ex` analogous to CIOCGSESSION.  Then you may call `DigestUpdate` multiple times to pass plaintext.  Finaly, you call `EVP_DigestFinal_ex` to get the digest result."}}
{"actor":{"display_login":"cotequeiroz"}}