{"action":"created","comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/174600071","pull_request_review_id":103986830,"id":174600071,"diff_hunk":"@@ -0,0 +1,114 @@\n+/*\n+ * Copyright (C) 2016-2018 Bas Stottelaar <basstottelaar@gmail.com>\n+ *\n+ * This file is subject to the terms and conditions of the GNU Lesser\n+ * General Public License v2.1. See the file LICENSE in the top level\n+ * directory for more details.\n+ */\n+\n+/**\n+ * @ingroup     drivers\n+ * @{\n+ *\n+ * @file\n+ * @brief       Shared hardware crypto code\n+ *\n+ * @author      Bas Stottelaar <basstottelaar@gmail.com>\n+ *\n+ * @}\n+ */\n+\n+#include \"periph/hwcrypto.h\"\n+\n+#ifndef PERIPH_HWCRYPTO_PROVIDES_CIPHER_SUPPORTED\n+/**\n+ * @brief Bitmap of supported ciphers.\n+ */\n+static uint32_t cipher_bitmap = (\n+#ifdef HAVE_HWCRYPTO_AES128\n+    (1 << HWCRYPTO_AES128) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_AES192\n+    (1 << HWCRYPTO_AES192) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_AES256\n+    (1 << HWCRYPTO_AES256) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_DES\n+    (1 << HWCRYPTO_DES) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_3DES\n+    (1 << HWCRYPTO_3DES) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_TWOFISH\n+    (1 << HWCRYPTO_TWOFISH) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_RSA512\n+    (1 << HWCRYPTO_RSA512) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_RSA1024\n+    (1 << HWCRYPTO_RSA1024) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_RSA2048\n+    (1 << HWCRYPTO_RSA2048) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_RSA4096\n+    (1 << HWCRYPTO_RSA4096) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_ECC128\n+    (1 << HWCRYPTO_ECC128) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_ECC192\n+    (1 << HWCRYPTO_ECC192) +\n+#endif\n+#ifdef HAVE_HWCRYPTO_ECC256\n+    (1 << HWCRYPTO_ECC256) +\n+#endif\n+    0);\n+\n+inline int hwcrypto_cipher_supported(hwcrypto_t dev, hwcrypto_cipher_t cipher)\n+{\n+    (void) dev;\n+\n+    return cipher_bitmap & (1 << cipher);\n+}\n+#endif /* PERIPH_HWCRYPTO_PROVIDES_CIPHER_SUPPORTED */\n+\n+#ifndef PERIPH_HWCRYPTO_PROVIDES_HASH_SUPPORTED\n+/**\n+ * @brief Bitmap of supported hashes.\n+ */\n+static uint32_t hash_bitmap = (","path":"drivers/periph_common/hwcrypto.c","position":null,"original_position":81,"commit_id":"3f00d6ad611d11a0f4029aedfbb090424936e355","original_commit_id":"381d11f64afda64c66bcafb7c5690b97302a4199","user":{"login":"basilfx","id":815976,"avatar_url":"https://avatars3.githubusercontent.com/u/815976?v=4","gravatar_id":"","url":"https://api.github.com/users/basilfx","html_url":"https://github.com/basilfx","followers_url":"https://api.github.com/users/basilfx/followers","following_url":"https://api.github.com/users/basilfx/following{/other_user}","gists_url":"https://api.github.com/users/basilfx/gists{/gist_id}","starred_url":"https://api.github.com/users/basilfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basilfx/subscriptions","organizations_url":"https://api.github.com/users/basilfx/orgs","repos_url":"https://api.github.com/users/basilfx/repos","events_url":"https://api.github.com/users/basilfx/events{/privacy}","received_events_url":"https://api.github.com/users/basilfx/received_events","type":"User","site_admin":false},"body":"Fixed.","created_at":"2018-03-14T20:30:09Z","updated_at":"2018-03-14T20:30:09Z","html_url":"https://github.com/RIOT-OS/RIOT/pull/8775#discussion_r174600071","pull_request_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments/174600071"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/8775#discussion_r174600071"},"pull_request":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775"}},"in_reply_to_id":174440205},"pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775","id":174821053,"html_url":"https://github.com/RIOT-OS/RIOT/pull/8775","diff_url":"https://github.com/RIOT-OS/RIOT/pull/8775.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/8775.patch","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8775","number":8775,"state":"open","locked":false,"title":"periph: hwcrypto: initial draft for hardware crypto support (version 2)","user":{"login":"basilfx","id":815976,"avatar_url":"https://avatars3.githubusercontent.com/u/815976?v=4","gravatar_id":"","url":"https://api.github.com/users/basilfx","html_url":"https://github.com/basilfx","followers_url":"https://api.github.com/users/basilfx/followers","following_url":"https://api.github.com/users/basilfx/following{/other_user}","gists_url":"https://api.github.com/users/basilfx/gists{/gist_id}","starred_url":"https://api.github.com/users/basilfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basilfx/subscriptions","organizations_url":"https://api.github.com/users/basilfx/orgs","repos_url":"https://api.github.com/users/basilfx/repos","events_url":"https://api.github.com/users/basilfx/events{/privacy}","received_events_url":"https://api.github.com/users/basilfx/received_events","type":"User","site_admin":false},"body":"### Contribution description\r\n\r\nThis is my second attempt to define a peripheral interface for hardware crypto devices. In this version, hardware accelerated (block) ciphers and hashing algorithms are supported.\r\n\r\nIt is a complete rewrite of #5429:\r\n\r\n* Dropped the context parameter (peripherals should define state if needed)\r\n* Added support for multiple hardware crypto peripherals (EFM32 has support)\r\n* Removed long list of defines\r\n* Removed the weird include structure\r\n\r\nI have also added a peripheral test and a working implementation for the EFM32.\r\n\r\n### Issues/PRs references\r\n\r\n#5429 (first version)","created_at":"2018-03-13T23:53:39Z","updated_at":"2018-03-14T20:30:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e846bbf3520d84bd7efde69c69b687deb49a6cfa","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":100135107,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/Request%20for%20Comments","name":"Request for Comments","color":"23F823","default":false},{"id":97458574,"url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/new%20feature","name":"new feature","color":"e11d21","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775/commits","review_comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775/comments","review_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8775/comments","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/3f00d6ad611d11a0f4029aedfbb090424936e355","head":{"label":"basilfx:feature/hwcrypto_v2","ref":"feature/hwcrypto_v2","sha":"3f00d6ad611d11a0f4029aedfbb090424936e355","user":{"login":"basilfx","id":815976,"avatar_url":"https://avatars3.githubusercontent.com/u/815976?v=4","gravatar_id":"","url":"https://api.github.com/users/basilfx","html_url":"https://github.com/basilfx","followers_url":"https://api.github.com/users/basilfx/followers","following_url":"https://api.github.com/users/basilfx/following{/other_user}","gists_url":"https://api.github.com/users/basilfx/gists{/gist_id}","starred_url":"https://api.github.com/users/basilfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basilfx/subscriptions","organizations_url":"https://api.github.com/users/basilfx/orgs","repos_url":"https://api.github.com/users/basilfx/repos","events_url":"https://api.github.com/users/basilfx/events{/privacy}","received_events_url":"https://api.github.com/users/basilfx/received_events","type":"User","site_admin":false},"repo":{"id":45756594,"name":"RIOT","full_name":"basilfx/RIOT","owner":{"login":"basilfx","id":815976,"avatar_url":"https://avatars3.githubusercontent.com/u/815976?v=4","gravatar_id":"","url":"https://api.github.com/users/basilfx","html_url":"https://github.com/basilfx","followers_url":"https://api.github.com/users/basilfx/followers","following_url":"https://api.github.com/users/basilfx/following{/other_user}","gists_url":"https://api.github.com/users/basilfx/gists{/gist_id}","starred_url":"https://api.github.com/users/basilfx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/basilfx/subscriptions","organizations_url":"https://api.github.com/users/basilfx/orgs","repos_url":"https://api.github.com/users/basilfx/repos","events_url":"https://api.github.com/users/basilfx/events{/privacy}","received_events_url":"https://api.github.com/users/basilfx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/basilfx/RIOT","description":"RIOT -  The friendly OS for IoT","fork":true,"url":"https://api.github.com/repos/basilfx/RIOT","forks_url":"https://api.github.com/repos/basilfx/RIOT/forks","keys_url":"https://api.github.com/repos/basilfx/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/basilfx/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/basilfx/RIOT/teams","hooks_url":"https://api.github.com/repos/basilfx/RIOT/hooks","issue_events_url":"https://api.github.com/repos/basilfx/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/basilfx/RIOT/events","assignees_url":"https://api.github.com/repos/basilfx/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/basilfx/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/basilfx/RIOT/tags","blobs_url":"https://api.github.com/repos/basilfx/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/basilfx/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/basilfx/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/basilfx/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/basilfx/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/basilfx/RIOT/languages","stargazers_url":"https://api.github.com/repos/basilfx/RIOT/stargazers","contributors_url":"https://api.github.com/repos/basilfx/RIOT/contributors","subscribers_url":"https://api.github.com/repos/basilfx/RIOT/subscribers","subscription_url":"https://api.github.com/repos/basilfx/RIOT/subscription","commits_url":"https://api.github.com/repos/basilfx/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/basilfx/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/basilfx/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/basilfx/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/basilfx/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/basilfx/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/basilfx/RIOT/merges","archive_url":"https://api.github.com/repos/basilfx/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/basilfx/RIOT/downloads","issues_url":"https://api.github.com/repos/basilfx/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/basilfx/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/basilfx/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/basilfx/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/basilfx/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/basilfx/RIOT/releases{/id}","deployments_url":"https://api.github.com/repos/basilfx/RIOT/deployments","created_at":"2015-11-07T22:01:27Z","updated_at":"2017-12-27T11:39:32Z","pushed_at":"2018-03-14T20:29:44Z","git_url":"git://github.com/basilfx/RIOT.git","ssh_url":"git@github.com:basilfx/RIOT.git","clone_url":"https://github.com/basilfx/RIOT.git","svn_url":"https://github.com/basilfx/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":50194,"stargazers_count":1,"watchers_count":1,"language":"C","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":2,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"RIOT-OS:master","ref":"master","sha":"3af570bd57ff3ea54ccee08a0e81e99ef6b3da18","user":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars2.githubusercontent.com/u/3079480?v=4","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"repo":{"id":7370241,"name":"RIOT","full_name":"RIOT-OS/RIOT","owner":{"login":"RIOT-OS","id":3079480,"avatar_url":"https://avatars2.githubusercontent.com/u/3079480?v=4","gravatar_id":"","url":"https://api.github.com/users/RIOT-OS","html_url":"https://github.com/RIOT-OS","followers_url":"https://api.github.com/users/RIOT-OS/followers","following_url":"https://api.github.com/users/RIOT-OS/following{/other_user}","gists_url":"https://api.github.com/users/RIOT-OS/gists{/gist_id}","starred_url":"https://api.github.com/users/RIOT-OS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RIOT-OS/subscriptions","organizations_url":"https://api.github.com/users/RIOT-OS/orgs","repos_url":"https://api.github.com/users/RIOT-OS/repos","events_url":"https://api.github.com/users/RIOT-OS/events{/privacy}","received_events_url":"https://api.github.com/users/RIOT-OS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/RIOT-OS/RIOT","description":"RIOT -  The friendly OS for IoT","fork":false,"url":"https://api.github.com/repos/RIOT-OS/RIOT","forks_url":"https://api.github.com/repos/RIOT-OS/RIOT/forks","keys_url":"https://api.github.com/repos/RIOT-OS/RIOT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/RIOT-OS/RIOT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/RIOT-OS/RIOT/teams","hooks_url":"https://api.github.com/repos/RIOT-OS/RIOT/hooks","issue_events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/events{/number}","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/events","assignees_url":"https://api.github.com/repos/RIOT-OS/RIOT/assignees{/user}","branches_url":"https://api.github.com/repos/RIOT-OS/RIOT/branches{/branch}","tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/tags","blobs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/refs{/sha}","trees_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/{sha}","languages_url":"https://api.github.com/repos/RIOT-OS/RIOT/languages","stargazers_url":"https://api.github.com/repos/RIOT-OS/RIOT/stargazers","contributors_url":"https://api.github.com/repos/RIOT-OS/RIOT/contributors","subscribers_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscribers","subscription_url":"https://api.github.com/repos/RIOT-OS/RIOT/subscription","commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/commits{/sha}","git_commits_url":"https://api.github.com/repos/RIOT-OS/RIOT/git/commits{/sha}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/comments{/number}","issue_comment_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments{/number}","contents_url":"https://api.github.com/repos/RIOT-OS/RIOT/contents/{+path}","compare_url":"https://api.github.com/repos/RIOT-OS/RIOT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/RIOT-OS/RIOT/merges","archive_url":"https://api.github.com/repos/RIOT-OS/RIOT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/RIOT-OS/RIOT/downloads","issues_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues{/number}","pulls_url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls{/number}","milestones_url":"https://api.github.com/repos/RIOT-OS/RIOT/milestones{/number}","notifications_url":"https://api.github.com/repos/RIOT-OS/RIOT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/labels{/name}","releases_url":"https://api.github.com/repos/RIOT-OS/RIOT/releases{/id}","deployments_url":"https://api.github.com/repos/RIOT-OS/RIOT/deployments","created_at":"2012-12-29T20:38:40Z","updated_at":"2018-03-14T18:29:23Z","pushed_at":"2018-03-14T20:29:46Z","git_url":"git://github.com/RIOT-OS/RIOT.git","ssh_url":"git@github.com:RIOT-OS/RIOT.git","clone_url":"https://github.com/RIOT-OS/RIOT.git","svn_url":"https://github.com/RIOT-OS/RIOT","homepage":"https://github.com/RIOT-OS/RIOT/wiki","size":50092,"stargazers_count":1682,"watchers_count":1682,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":987,"mirror_url":null,"archived":false,"open_issues_count":711,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1"},"forks":987,"open_issues":711,"watchers":1682,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775"},"html":{"href":"https://github.com/RIOT-OS/RIOT/pull/8775"},"issue":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8775"},"comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/issues/8775/comments"},"review_comments":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775/comments"},"review_comment":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/8775/commits"},"statuses":{"href":"https://api.github.com/repos/RIOT-OS/RIOT/statuses/3f00d6ad611d11a0f4029aedfbb090424936e355"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"basilfx"}}