{"action":"created","issue":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9897","repository_url":"https://api.github.com/repos/RIOT-OS/RIOT","labels_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9897/labels{/name}","comments_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9897/comments","events_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9897/events","html_url":"https://github.com/RIOT-OS/RIOT/pull/9897","id":357748147,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzNjg5NTc2","number":9897,"title":"Include pqm4 package","user":{"login":"jowlo","id":6842104,"node_id":"MDQ6VXNlcjY4NDIxMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6842104?v=4","gravatar_id":"","url":"https://api.github.com/users/jowlo","html_url":"https://github.com/jowlo","followers_url":"https://api.github.com/users/jowlo/followers","following_url":"https://api.github.com/users/jowlo/following{/other_user}","gists_url":"https://api.github.com/users/jowlo/gists{/gist_id}","starred_url":"https://api.github.com/users/jowlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jowlo/subscriptions","organizations_url":"https://api.github.com/users/jowlo/orgs","repos_url":"https://api.github.com/users/jowlo/repos","events_url":"https://api.github.com/users/jowlo/events{/privacy}","received_events_url":"https://api.github.com/users/jowlo/received_events","type":"User","site_admin":false},"labels":[{"id":505738481,"node_id":"MDU6TGFiZWw1MDU3Mzg0ODE=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/crypto","name":"crypto","color":"ff00ff","default":false},{"id":114180965,"node_id":"MDU6TGFiZWwxMTQxODA5NjU=","url":"https://api.github.com/repos/RIOT-OS/RIOT/labels/pkg","name":"pkg","color":"006b75","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-09-06T17:12:35Z","updated_at":"2018-09-26T09:38:54Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/pulls/9897","html_url":"https://github.com/RIOT-OS/RIOT/pull/9897","diff_url":"https://github.com/RIOT-OS/RIOT/pull/9897.diff","patch_url":"https://github.com/RIOT-OS/RIOT/pull/9897.patch"},"body":"<!--\r\nThe RIOT community cares a lot about code quality.\r\nTherefore, before describing what your contribution is about, we would like\r\nyou to make sure that your modifications are compliant with the RIOT\r\ncoding conventions, see https://github.com/RIOT-OS/RIOT/wiki/Coding-conventions.\r\n-->\r\n\r\n### Contribution description\r\nThis PR adds a [fork](https://github.com/jowlo/pqm4) of the [pqm4](https://github.com/mupq/pqm4)-library as package to RIOT.\r\n\r\nThe pqm4 library includes quantum-resistant key encapsulation mechanisms (KEM) and signature algorithms that have been submitted for standardization to the [NIST Post-Quantum Standardization Process](https://csrc.nist.gov/Projects/Post-Quantum-Cryptography/Post-Quantum-Cryptography-Standardization).\r\nI am not the author of the pqm4 library, nor are the maintainers of the library authors of the individual schemes included. See the [License Section of pqm4's Readme](https://github.com/mupq/pqm4/blob/master/README.md#license) for detailed copyright information.\r\n\r\n**The included ciphers and schemes are not meant for production use and should only be used for evaluation purposes.**\r\n\r\nThe pqm4 library is targeted at the `stm32f4discovery` board only. The fork of the library that is pulled by this package uses `m4`-only code only for those targets that feature an `m4` CPU, adds target-specific code for `m0` targets and adds generic code for all others. \r\n\r\nThis PR also adds examples for key-generation (`examples/pqm4/keygen`), tests (`examples/pqm4/test`) and speed evaluation (`examples/pqm4/speed`). The `test` and `speed` examples are mere ports of the original library's main benchmarking tools.\r\n\r\nWhen executing any of the examples, it is neccessary to choose which key-encapsulation and/or signature scheme should be built by the library. This can be done via a Makefile variable `PQ_KEM` and/or `PQ_SIGN`. See the `Makefile` for possible schemes.\r\n\r\n<!--\r\nPut here the description of your contribution:\r\n- describe which part(s) of RIOT is (are) involved\r\n- if it's a bug fix, describe the bug that it solves and how it is solved\r\n- you can also give more information to reviewers about how to test your changes\r\n-->\r\n\r\n\r\n### Testing procedure\r\nThe `example/pqm4/test` directory contains a python script `buildall.py` that builds all KEM and signature scheme tests and executes them on `native`. (You might want to exclude `sphincs-shake256-128s` as it takes about half an hour.) Each build and output is written to a corresponding logfile.\r\n\r\nSome schemes need a quite large stack, for these it might be necessary to adapt the line in the Makefile defining `THREAD_STACKSIZE_MAIN`.\r\nFor testing implementation correctness on `native`, setting \r\n```\r\nCFLAGS += -DTHREAD_STACKSIZE_MAIN=\\(200*THREAD_STACKSIZE_DEFAULT\\)\r\n```\r\nlets all tests pass for all schemes.\r\n\r\n\r\n<!--\r\nDetails steps to test your contribution:\r\n- which test/example to compile for which board and is there a 'test' command\r\n- how to know that it was not working/available in master\r\n- the expected success test output\r\n-->\r\n\r\n\r\n### Issues/PRs references\r\n\r\n<!--\r\nExamples: Fixes #1234. See also #5678. Depends on PR #9876.\r\n\r\nPlease use keywords (e.g., fixes, resolve) with the links to the issues you\r\nresolved, this way they will be automatically closed when your pull request\r\nis merged. See https://help.github.com/articles/closing-issues-using-keywords/.\r\n-->\r\n"},"comment":{"url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/comments/424651894","html_url":"https://github.com/RIOT-OS/RIOT/pull/9897#issuecomment-424651894","issue_url":"https://api.github.com/repos/RIOT-OS/RIOT/issues/9897","id":424651894,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNDY1MTg5NA==","user":{"login":"jowlo","id":6842104,"node_id":"MDQ6VXNlcjY4NDIxMDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6842104?v=4","gravatar_id":"","url":"https://api.github.com/users/jowlo","html_url":"https://github.com/jowlo","followers_url":"https://api.github.com/users/jowlo/followers","following_url":"https://api.github.com/users/jowlo/following{/other_user}","gists_url":"https://api.github.com/users/jowlo/gists{/gist_id}","starred_url":"https://api.github.com/users/jowlo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jowlo/subscriptions","organizations_url":"https://api.github.com/users/jowlo/orgs","repos_url":"https://api.github.com/users/jowlo/repos","events_url":"https://api.github.com/users/jowlo/events{/privacy}","received_events_url":"https://api.github.com/users/jowlo/received_events","type":"User","site_admin":false},"created_at":"2018-09-26T09:38:54Z","updated_at":"2018-09-26T09:38:54Z","author_association":"NONE","body":"Yes, you are right that we should take care not to suggest in any way that this is production-ready cryptography. However, as the API only gives access to the basic cryptographic primitives, i would imagine anyone using these already knows what they are doing. The library also does not offer any application of the primitives.\r\n\r\nOn the other hand, as @cladmi said, RIOT is well suited as a benchmarking platform for these kind of things. The Crypto/PQC community at the moment focuses very much on the `stm32f4discovery` as a basis for benchmarks (as does the library originally), but having the ability to benchmark implementations on a multitude of devices (and with a network stack etc.) is very interesting addition.\r\n\r\nAdditionally - as did [Google](https://security.googleblog.com/2016/07/experimenting-with-post-quantum.html) with its `CECPQ1` [deployment](https://www.imperialviolet.org/2016/11/28/cecpq1.html) in [boringSSL](https://boringssl-review.googlesource.com/c/boringssl/+/7962) - the primitives in this library can be used as a building block for a hybrid scheme - in which essentially a \"traditional' cipher is combined with one of the PQ ciphers, s.t. even if the PQC cipher is broken you still get the traditional's security level.\r\n\r\ni am working on a Readme (in the pkg's repository) that also gives some benchmarking results for `m0`, `m3` and `m4` targets with RIOT. I will add a huge disclaimer about the security implications of using these ciphers out-of-the-box.\r\n\r\nAs a side note, by \"Readme\", do you mean the `pkg/*/doc.txt`? If so, i will add that as well - including the disclaimer."}}
{"actor":{"display_login":"jowlo"}}