Port of μNaCl for ARM Cortex M0
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
TESTS
source
.gitignore
.mbedignore
.yotta.json
.yotta_ignore
LICENSE
README.md
esp32.cmake
go_cleanup.sh
go_runtests.sh
lib.cmake
mbed2.cmake
mbed5.cmake
module.json
project.cmake

README.md

A μNaCl port for ARM Cortex M0

This is an implementation of the NaCl API for the ARM Cortex-M0. It is based on the AVR implementation of μNaCl.

mbed-os 5

mbed add https://github.com/ubirch/ubirch-mbed-nacl-cm0

mbed-os 2

To use this library with a yotta project add this github repository as a dependency:

{
  ...
  "dependencies": {
    "nacl": "ubirch/ubirch-mbed-nacl-cm0#v1.0.0"
  },
  ...
}

About the CMakeLists.txt file. This is mainly used to get CLion to find headers and make the syntax highlighting useful. It includes lib.cmake which can be used in a another project and only adds the library sources.

Testing

The tests are long-running, so please be patient.

mbed new .
mbed target NRF52_DK
mbed toolchain GCC_ARM
mbed test -n 'tests-stack*,tests-crypto*'

These tests are the original tests that came with the library, adapted to run in the mbed test harness.

Test suites:

+------------------+---------------+-------------------------+--------+--------------------+-------------+
| target           | platform_name | test suite              | result | elapsed_time (sec) | copy_method |
+------------------+---------------+-------------------------+--------+--------------------+-------------+
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-hash       | OK     | 191.01             | default     |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-hashblocks | OK     | 203.61             | default     |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-sign       | OK     | 329.61             | default     |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-verify     | OK     | 40.07              | default     |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-hash        | OK     | 40.14              | default     |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-hashblocks  | OK     | 40.23              | default     |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-sign        | OK     | 180.06             | default     |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-verify      | OK     | 40.68              | default     |
+------------------+---------------+-------------------------+--------+--------------------+-------------+

Individual test results:

+------------------+---------------+-------------------------+------------------------------+--------+--------+--------+--------------------+
| target           | platform_name | test suite              | test case                    | passed | failed | result | elapsed_time (sec) |
+------------------+---------------+-------------------------+------------------------------+--------+--------+--------+--------------------+
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-hash       | Test crypto-hash             | 1      | 0      | OK     | 152.57             |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-hashblocks | Test crypto-hashblocks       | 1      | 0      | OK     | 164.14             |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-sign       | Test crypto-sign             | 1      | 0      | OK     | 291.11             |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-crypto-verify     | Test crypto-verify           | 1      | 0      | OK     | 2.47               |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-hash        | Test stack-crypto-hash       | 1      | 0      | OK     | 1.47               |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-hashblocks  | Test stack-crypto-hashblocks | 1      | 0      | OK     | 1.16               |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-sign        | Test stack-crypto-sign       | 1      | 0      | OK     | 137.2              |
| NRF52_DK-GCC_ARM | NRF52_DK      | tests-stack-verify      | Test stack-crypto-verify     | 1      | 0      | OK     | 0.68               |
+------------------+---------------+-------------------------+------------------------------+--------+--------+--------+--------------------+

Credits

The port was done by Andreas Schuler for ubirch GmbH and adapted for use with mbed and Calliope mini by Matthias L. Jugel.

Status

Work in progress. An audit for this implementation is pending.

License

This work is available under the Apache License

Copyright 2017 ubirch GmbH

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.