{"action":"created","issue":{"url":"https://api.github.com/repos/yesodweb/clientsession/issues/23","labels_url":"https://api.github.com/repos/yesodweb/clientsession/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/yesodweb/clientsession/issues/23/comments","events_url":"https://api.github.com/repos/yesodweb/clientsession/issues/23/events","html_url":"https://github.com/yesodweb/clientsession/issues/23","id":29621412,"number":23,"title":"Use AEAD's GCM / OCB instead of encryption+MAC.","user":{"login":"vincenthz","id":174631,"avatar_url":"https://avatars.githubusercontent.com/u/174631?v=3","gravatar_id":"","url":"https://api.github.com/users/vincenthz","html_url":"https://github.com/vincenthz","followers_url":"https://api.github.com/users/vincenthz/followers","following_url":"https://api.github.com/users/vincenthz/following{/other_user}","gists_url":"https://api.github.com/users/vincenthz/gists{/gist_id}","starred_url":"https://api.github.com/users/vincenthz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vincenthz/subscriptions","organizations_url":"https://api.github.com/users/vincenthz/orgs","repos_url":"https://api.github.com/users/vincenthz/repos","events_url":"https://api.github.com/users/vincenthz/events{/privacy}","received_events_url":"https://api.github.com/users/vincenthz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2014-03-18T05:43:14Z","updated_at":"2015-04-11T15:38:42Z","closed_at":null,"body":"The AES-CTR+Skein-MAC method used by clientsession could be replaced by AES-GCM or AES-OCB, and in theory it would be much faster (practically current version have *lot* of room for optimisations). Provided I send a PR for this, does clientsession need to remain backward compatible, and is that a good idea to provide different choosable alternatives to the user ?"},"comment":{"url":"https://api.github.com/repos/yesodweb/clientsession/issues/comments/91870713","html_url":"https://github.com/yesodweb/clientsession/issues/23#issuecomment-91870713","issue_url":"https://api.github.com/repos/yesodweb/clientsession/issues/23","id":91870713,"user":{"login":"meteficha","id":767816,"avatar_url":"https://avatars.githubusercontent.com/u/767816?v=3","gravatar_id":"","url":"https://api.github.com/users/meteficha","html_url":"https://github.com/meteficha","followers_url":"https://api.github.com/users/meteficha/followers","following_url":"https://api.github.com/users/meteficha/following{/other_user}","gists_url":"https://api.github.com/users/meteficha/gists{/gist_id}","starred_url":"https://api.github.com/users/meteficha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meteficha/subscriptions","organizations_url":"https://api.github.com/users/meteficha/orgs","repos_url":"https://api.github.com/users/meteficha/repos","events_url":"https://api.github.com/users/meteficha/events{/privacy}","received_events_url":"https://api.github.com/users/meteficha/received_events","type":"User","site_admin":false},"created_at":"2015-04-11T15:38:42Z","updated_at":"2015-04-11T15:38:42Z","body":"I just took a stab at using AES-GCM.  Unfortunately, the results weren't promising benchmark-wise.  You can see them here: https://gist.github.com/meteficha/a2bea768ef3255f8ab70.  At best AES-GCM was 28% slower, but on a unrealistic session size (80kb).  At worst it was 7.6x slower (0-byte session).\r\n\r\nMy CPU doesn't have AES-NI instructions, but the old version was using AES-CTR.  IIUC, AES-GCM should need just one more AES block encryption wrt AES-CTR.\r\n\r\nMy CPU also doesn't have the PCLMULQDQ instruction, perhaps this would make a huge difference?  Do most server CPUs have these instructions?\r\n\r\n@vincenthz Do you think there's room for improvement on my stab?  Besides lowering to AES128, as it would make for a unfair benchmark :P."}}