summaryrefslogtreecommitdiff
path: root/common/curve25519.c
Commit message (Collapse)AuthorAgeFilesLines
* Revert boringssl clang-format changesTom Hughes2022-07-061-69/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The clang-format commits changed symlinks to copies of the files, so there are duplicates of each file. This reverts the following commits: c9501c326e164dceab6c87da57fa96c224c57155 4006ab6004daf645f5112c63307090f96abe08de 3c0dfa12e5cd96dc798ae2b4523c89f2021301da 4e35122258a2958a06866404e703370efcbe7c31 662b592c868995287a82174e5ed84205fa2230e9 862eae94c19760820f710195197dfe827df5fac6 761db14ef422056e76515a2a38f848d5fb410cbb 3c0dfa12e5cd96dc798ae2b4523c89f2021301da BRANCH=none BUG=b:236386294 TEST=none Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ic428544700a240f26f2032936a8b7cbb00cb35e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3749638 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* common/curve25519.c: Format with clang-formatJack Rosenthal2022-06-291-1/+69
| | | | | | | | | | | BUG=b:236386294 BRANCH=none TEST=none Change-Id: Ic57d4d91cd4de1fb5ca35e9720f58464f158ab56 Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3729603 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* curve25519: Move to third_partyNicolas Boichat2020-03-241-65/+1
| | | | | | | | | | | | | | | | curve25519 comes from boringssl as well, move it to that directory. See git log for which boringssl commit the implementation comes from, and changes that were applied. BRANCH=none BUG=chromium:884905 TEST=make buildall -j, which also include basic tests. Change-Id: I1dee4795009c1e2034a181f6083d1f9445c87d41 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1600946 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* LICENSE: remove unnecessary (c) after CopyrightTom Hughes2019-06-191-1/+1
| | | | | | | | | | | | | | | | Ran the following command: git grep -l 'Copyright (c)' | \ xargs sed -i 's/Copyright (c)/Copyright/g' BRANCH=none BUG=none TEST=make buildall -j Change-Id: I6cc4a0f7e8b30d5b5f97d53c031c299f3e164ca7 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1663262 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* core/cortex-m0/curve25519: Integrate fast curve25519 implementationNicolas Boichat2017-07-031-804/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move generic implementation to curve25519-generic.o - Always use optimized version on cortex-m0. - Rename .s files to .S, remove unnecessary lines in assembly files. - Rename crypto_scalarmult_curve25519 to x25519_scalar_mult to match the signature provided by the generic implementation. - Replace some handcoded memcpy with function calls - Remove unnecessary "volatile" specifications in the code. BRANCH=none BUG=b:62813194 TEST=To test old implementation only: - Increase CONFIG_RO_SIZE to 60kb - Increase console stack size to 2048 make BOARD=hammer PROJECT=x25519 TEST_BUILD=y ./util/flash_ec --board=hammer --image=build/hammer/x25519.bin EC console: runtest, taskinfo => Used to takes ~4'17" to run (X25519 duration 256347 us). 1496/2048 stack size usage in CONSOLE task => Now takes ~1'25" to run (X25519 duration 84520 us) 732/2048 stack size usage in CONSOLE task TEST=In test/x25519.c, uncomment #define TEST_X25519_1M_ITERATIONS make BOARD=hammer PROJECT=x25519 TEST_BUILD=y ./util/flash_ec --board=hammer --image=build/hammer/x25519.bin EC console: runtest, wait ~23 hours, test passes. TEST=- Define CONFIG_CURVE25519_CORTEXM0 (next patch) makes newsizes build/hammer/RW/ec.RW.flat shrank by 1888 bytes: (52208 to 50320) Change-Id: Icce38d3c32f431a85ac0f951cf34456b490dc665 Reviewed-on: https://chromium-review.googlesource.com/540962 Commit-Ready: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* curve25519: strip-down, build and testVincent Palatin2017-02-231-4087/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | Keep only the most compact version of the curve25519 code and remove the remaining unused code for easier compilation. Do the minimal changes to make it compile in the EC code base, there should be no real functional changes. Re-use the wording from BoringSSL include/openssl/curve25519.h for the header. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:62991 TEST=run x25519 on host (ie 'make run-x25519') and the STM32L4 target: make BOARD=eve_fp PROJECT=x25519 TEST_BUILD=y ./util/flash_ec --board=eve_fp --image=build/eve_fp/x25519.bin execute 'runtest' in the console. Change-Id: I13dbe453eff39b461effb1b3ffa549afc1749fef Reviewed-on: https://chromium-review.googlesource.com/444187 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Adam Langley <agl@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* import curve25519 code from BoringSSLVincent Palatin2017-02-231-0/+4937
Import the implementation of the curve25519 public key cryptography from BoringSSL. It's the unmodified crypto/curve25519/curve25519.c file from the repository at sha c034e2d3ce16df5f89134515bc113eb4f3a28e0e. (current HEAD of chromium-stable branch) It will be used as a primitive to implement a Diffie-Hellman exchange. The test code in test/x25519.c is also imported unmodified from BoringSSL crypto/curve25519/x25519_test.cc. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=chrome-os-partner:62991 TEST=with follow-up CLs, run curve25519 test vectors on host, MEC1322 and STM32 targets. Change-Id: Ie497f78249f505e32d8e025b0537e82bf4476298 Reviewed-on: https://chromium-review.googlesource.com/444186 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>