{"action":"created","issue":{"url":"https://api.github.com/repos/briansmith/ring/issues/702","repository_url":"https://api.github.com/repos/briansmith/ring","labels_url":"https://api.github.com/repos/briansmith/ring/issues/702/labels{/name}","comments_url":"https://api.github.com/repos/briansmith/ring/issues/702/comments","events_url":"https://api.github.com/repos/briansmith/ring/issues/702/events","html_url":"https://github.com/briansmith/ring/pull/702","id":369324796,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIyMjk0NzAz","number":702,"title":"Make caller enforce invariants when setting AES encryption key","user":{"login":"ecstatic-morse","id":29463364,"node_id":"MDQ6VXNlcjI5NDYzMzY0","avatar_url":"https://avatars1.githubusercontent.com/u/29463364?v=4","gravatar_id":"","url":"https://api.github.com/users/ecstatic-morse","html_url":"https://github.com/ecstatic-morse","followers_url":"https://api.github.com/users/ecstatic-morse/followers","following_url":"https://api.github.com/users/ecstatic-morse/following{/other_user}","gists_url":"https://api.github.com/users/ecstatic-morse/gists{/gist_id}","starred_url":"https://api.github.com/users/ecstatic-morse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecstatic-morse/subscriptions","organizations_url":"https://api.github.com/users/ecstatic-morse/orgs","repos_url":"https://api.github.com/users/ecstatic-morse/repos","events_url":"https://api.github.com/users/ecstatic-morse/events{/privacy}","received_events_url":"https://api.github.com/users/ecstatic-morse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-11T22:10:18Z","updated_at":"2018-10-23T00:55:14Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/briansmith/ring/pulls/702","html_url":"https://github.com/briansmith/ring/pull/702","diff_url":"https://github.com/briansmith/ring/pull/702.diff","patch_url":"https://github.com/briansmith/ring/pull/702.patch"},"body":"Resolves #113.\r\n\r\n`GFp_AES_set_encrypt_key` can fail if and only if the following invariants are violated.\r\n\r\n* All pointer arguments must be non-null.\r\n* The key size must be either 128 or 256 bits (192 bit keys [aren't supported](https://github.com/briansmith/ring/commit/b3e91be71edde28f5d2884d3c3c34260b6a79378)).\r\n\r\nThe first invariant should not be checked at runtime (except via assertion) as it is the responsibility of the caller.\r\n\r\nThe second could be expressed statically by accepting an enum with the valid key lengths, but enums don't provide any type safety in C. Instead, we document the acceptable key lengths and make them the responsibility of the caller.\r\n\r\nAs a result of these changes, `GFp_AES_set_encrypt_key` (as well as `GFp_aes_c_set_encrypt_key`) no longer needs to return an error code. The assembly functions still return an error code and do input validation."},"comment":{"url":"https://api.github.com/repos/briansmith/ring/issues/comments/432044115","html_url":"https://github.com/briansmith/ring/pull/702#issuecomment-432044115","issue_url":"https://api.github.com/repos/briansmith/ring/issues/702","id":432044115,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjA0NDExNQ==","user":{"login":"ecstatic-morse","id":29463364,"node_id":"MDQ6VXNlcjI5NDYzMzY0","avatar_url":"https://avatars1.githubusercontent.com/u/29463364?v=4","gravatar_id":"","url":"https://api.github.com/users/ecstatic-morse","html_url":"https://github.com/ecstatic-morse","followers_url":"https://api.github.com/users/ecstatic-morse/followers","following_url":"https://api.github.com/users/ecstatic-morse/following{/other_user}","gists_url":"https://api.github.com/users/ecstatic-morse/gists{/gist_id}","starred_url":"https://api.github.com/users/ecstatic-morse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecstatic-morse/subscriptions","organizations_url":"https://api.github.com/users/ecstatic-morse/orgs","repos_url":"https://api.github.com/users/ecstatic-morse/repos","events_url":"https://api.github.com/users/ecstatic-morse/events{/privacy}","received_events_url":"https://api.github.com/users/ecstatic-morse/received_events","type":"User","site_admin":false},"created_at":"2018-10-23T00:55:14Z","updated_at":"2018-10-23T00:55:14Z","author_association":"CONTRIBUTOR","body":"I refactored the C AES key expansion routines [in this branch](https://github.com/ecstatic-morse/ring/blob/aes-key-expansion/crypto/fipsmodule/aes/aes.c). I'll submit a PR when this gets merged."}}
{"actor":{"display_login":"ecstatic-morse"}}