项目作者: ubirch

项目描述 :
Port of μNaCl for ARM Cortex M0
高级语言: C++
项目地址: git://github.com/ubirch/ubirch-mbed-nacl-cm0.git
创建时间: 2017-09-11T18:44:10Z
项目社区:https://github.com/ubirch/ubirch-mbed-nacl-cm0

开源协议:Apache License 2.0

下载


ubirch logo

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

  1. 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:

  1. {
  2. ...
  3. "dependencies": {
  4. "nacl": "ubirch/ubirch-mbed-nacl-cm0#v1.0.0"
  5. },
  6. ...
  7. }

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.

ESP32

To use this library within your esp32 project, you have to add it as a
git submodule to your components directory:

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

Afterwards, copy the esp32.cmake file to CMakeLists.txt or make a link.
This way the cmake of your project will know and include all components
of this library.

Testing

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

  1. mbed new .
  2. mbed target NRF52_DK
  3. mbed toolchain GCC_ARM
  4. 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:

  1. +------------------+---------------+-------------------------+--------+--------------------+-------------+
  2. | target | platform_name | test suite | result | elapsed_time (sec) | copy_method |
  3. +------------------+---------------+-------------------------+--------+--------------------+-------------+
  4. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-hash | OK | 191.01 | default |
  5. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-hashblocks | OK | 203.61 | default |
  6. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-sign | OK | 329.61 | default |
  7. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-verify | OK | 40.07 | default |
  8. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-hash | OK | 40.14 | default |
  9. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-hashblocks | OK | 40.23 | default |
  10. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-sign | OK | 180.06 | default |
  11. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-verify | OK | 40.68 | default |
  12. +------------------+---------------+-------------------------+--------+--------------------+-------------+

Individual test results:

  1. +------------------+---------------+-------------------------+------------------------------+--------+--------+--------+--------------------+
  2. | target | platform_name | test suite | test case | passed | failed | result | elapsed_time (sec) |
  3. +------------------+---------------+-------------------------+------------------------------+--------+--------+--------+--------------------+
  4. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-hash | Test crypto-hash | 1 | 0 | OK | 152.57 |
  5. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-hashblocks | Test crypto-hashblocks | 1 | 0 | OK | 164.14 |
  6. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-sign | Test crypto-sign | 1 | 0 | OK | 291.11 |
  7. | NRF52_DK-GCC_ARM | NRF52_DK | tests-crypto-verify | Test crypto-verify | 1 | 0 | OK | 2.47 |
  8. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-hash | Test stack-crypto-hash | 1 | 0 | OK | 1.47 |
  9. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-hashblocks | Test stack-crypto-hashblocks | 1 | 0 | OK | 1.16 |
  10. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-sign | Test stack-crypto-sign | 1 | 0 | OK | 137.2 |
  11. | NRF52_DK-GCC_ARM | NRF52_DK | tests-stack-verify | Test stack-crypto-verify | 1 | 0 | OK | 0.68 |
  12. +------------------+---------------+-------------------------+------------------------------+--------+--------+--------+--------------------+

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

  1. Copyright 2017 ubirch GmbH
  2. Licensed under the Apache License, Version 2.0 (the "License");
  3. you may not use this file except in compliance with the License.
  4. You may obtain a copy of the License at
  5. http://www.apache.org/licenses/LICENSE-2.0
  6. Unless required by applicable law or agreed to in writing, software
  7. distributed under the License is distributed on an "AS IS" BASIS,
  8. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  9. See the License for the specific language governing permissions and
  10. limitations under the License.
  11. `