This repository contains an example demonstrating the compilation and use of Mbed Crypto on Mbed OS.

Committer:
mbed_official
Date:
Mon Nov 18 15:02:35 2019 +0000
Revision:
2:b0f0cdcada7f
Parent:
0:f34b7234a060
Merge pull request #52 from dgreen-arm/add-jenkinsfile

Add Jenkinsfile for PR testing
.
Commit copied from https://github.com/ARMmbed/mbed-os-example-mbed-crypto

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 0:f34b7234a060 1 # Running Mbed Crypto examples on Mbed OS
mbed_official 0:f34b7234a060 2 This repository contains a set of examples demonstrating the compilation and use of Mbed Crypto on Mbed OS.
mbed_official 0:f34b7234a060 3
mbed_official 0:f34b7234a060 4 List of examples contained within this repository:
mbed_official 0:f34b7234a060 5 * Example code snippets for using the library, with [documentation](https://github.com/ARMmbed/mbed-crypto/blob/development/docs/getting_started.md).
mbed_official 0:f34b7234a060 6
mbed_official 0:f34b7234a060 7 ## Prerequisites
mbed_official 0:f34b7234a060 8 * Install <a href='https://github.com/ARMmbed/mbed-cli#installing-mbed-cli'>Mbed CLI</a>
mbed_official 0:f34b7234a060 9
mbed_official 0:f34b7234a060 10 ## Import
mbed_official 0:f34b7234a060 11 The following are the steps required to install the application:
mbed_official 0:f34b7234a060 12 * Clone the repository and deploy the Mbed OS project: `mbed import https://github.com/ARMmbed/mbed-os-example-mbed-crypto`
mbed_official 0:f34b7234a060 13 * Change your current directory: `cd mbed-os-example-mbed-crypto/getting-started`
mbed_official 0:f34b7234a060 14
mbed_official 0:f34b7234a060 15 ## Compile
mbed_official 0:f34b7234a060 16 To compile the example program use `mbed compile` while specifying the target platform and the compiler.
mbed_official 0:f34b7234a060 17 For example, in order to compile using the ARM GCC compiler and a K64F target platform use: `mbed compile -m K64F -t GCC_ARM`.
mbed_official 0:f34b7234a060 18
mbed_official 0:f34b7234a060 19 Once the compilation is completed successfully a binary file will be created: `./BUILD/K64F/GCC_ARM/getting-started.bin`
mbed_official 0:f34b7234a060 20
mbed_official 0:f34b7234a060 21 ## Program your board
mbed_official 0:f34b7234a060 22 1. Connect your Mbed device to the computer over USB.
mbed_official 0:f34b7234a060 23 1. Copy the binary file (`getting-started.bin`) to the Mbed device.
mbed_official 0:f34b7234a060 24
mbed_official 0:f34b7234a060 25 ## Run
mbed_official 0:f34b7234a060 26 1. Connect to the Mbed Device using a serial client application of your choice.
mbed_official 0:f34b7234a060 27 1. Press the reset button on the Mbed device to run the program.
mbed_official 0:f34b7234a060 28
mbed_official 0:f34b7234a060 29 The expected output from the first successful execution of the example program should be as follows:
mbed_official 0:f34b7234a060 30 ```
mbed_official 0:f34b7234a060 31 -- Begin Mbed Crypto Getting Started --
mbed_official 0:f34b7234a060 32
mbed_official 0:f34b7234a060 33 Import an AES key... Imported a key
mbed_official 0:f34b7234a060 34 Sign a message... Signed a message
mbed_official 0:f34b7234a060 35 Encrypt with cipher... Encrypted plaintext
mbed_official 0:f34b7234a060 36 Decrypt with cipher... Decrypted ciphertext
mbed_official 0:f34b7234a060 37 Hash a message... Hashed a message
mbed_official 0:f34b7234a060 38 Verify a hash... Verified a hash
mbed_official 0:f34b7234a060 39 Generate random... Generated random data
mbed_official 0:f34b7234a060 40 Derive a key (HKDF)... Derived key
mbed_official 0:f34b7234a060 41 Authenticate encrypt... Authenticated and encrypted
mbed_official 0:f34b7234a060 42 Authenticate decrypt... Authenticated and decrypted
mbed_official 0:f34b7234a060 43 Generate a key pair... Exported a public key
mbed_official 0:f34b7234a060 44
mbed_official 0:f34b7234a060 45 -- End Mbed Crypto Getting Started --
mbed_official 0:f34b7234a060 46 ```
mbed_official 0:f34b7234a060 47
mbed_official 0:f34b7234a060 48 ## Troubleshooting
mbed_official 0:f34b7234a060 49 If you have problems, you can review the [documentation](https://os.mbed.com/docs/latest/tutorials/debugging.html) for suggestions on what could be wrong and how to fix it.
mbed_official 0:f34b7234a060 50
mbed_official 0:f34b7234a060 51 ## License and contributions
mbed_official 0:f34b7234a060 52
mbed_official 0:f34b7234a060 53 The software is provided under Apache-2.0 license. Contributions to this project are accepted under the same license. Please see [contributing.md](CONTRIBUTING.md) for more info.
mbed_official 0:f34b7234a060 54
mbed_official 0:f34b7234a060 55 This project contains code from other projects. The original license text is included in those source files. They must comply with our license guide.