From 6d4ac89477808f027b63e3fff2c113ff2dcdf47d Mon Sep 17 00:00:00 2001 From: Lavakrishna Dussa Date: Fri, 15 Sep 2023 10:54:07 +0100 Subject: [PATCH] Squashed 'applications/' changes from b27957b..840a440 840a440 Merged user-crypto source code version 2.1.100. 02f8a51 Squashed 'user-crypto/' changes from 9b8af09..415d929 git-subtree-dir: applications git-subtree-split: 840a440b1697acb44b1e6269d3c846030c484374 --- .../miv-rv32-aes-cryptography/.cproject | 2 +- .../miv-rv32-aes-cryptography/.gitignore | 2 +- ..._Cryptography.ttl => AES_Cryptography.ttl} | 16 +- .../miv-rv32-aes-cryptography/README.md | 61 ++- .../src/application/main.c | 8 +- .../src/platform/LICENSE.md | 26 + user-crypto/miv-rv32-ccm-services/.cproject | 2 +- user-crypto/miv-rv32-ccm-services/.gitignore | 2 +- ...RV32_CCM_msg_auth.ttl => CCM_Msg_Auth.ttl} | 2 +- user-crypto/miv-rv32-ccm-services/README.md | 59 +-- .../src/platform/LICENSE.md | 26 + user-crypto/miv-rv32-dsa-services/.cproject | 2 +- user-crypto/miv-rv32-dsa-services/.gitignore | 2 +- .../{dsa_services.ttl => DSA_Service.ttl} | 496 +++++++++--------- user-crypto/miv-rv32-dsa-services/README.md | 85 ++- .../src/platform/LICENSE.md | 26 + user-crypto/miv-rv32-ecdsa-services/.cproject | 2 +- .../miv-rv32-ecdsa-services/.gitignore | 2 +- user-crypto/miv-rv32-ecdsa-services/README.md | 63 ++- .../ecdsa_services.ttl | 2 +- .../src/application/main.c | 8 +- .../src/platform/LICENSE.md | 26 + user-crypto/miv-rv32-key-agreement/.cproject | 2 +- user-crypto/miv-rv32-key-agreement/.gitignore | 2 +- ...32_Key_agreement.ttl => Key_Agreement.ttl} | 2 +- user-crypto/miv-rv32-key-agreement/README.md | 62 ++- .../src/platform/LICENSE.md | 26 + .../miv-rv32-keytree-services/.cproject | 2 +- .../miv-rv32-keytree-services/.gitignore | 2 +- .../miv-rv32-keytree-services/README.md | 59 +-- .../{miv-rv32-key-tree.ttl => key-tree.ttl} | 14 +- .../src/platform/LICENSE.md | 26 + .../miv-rv32-message-authentication/.cproject | 2 +- .../.gitignore | 2 +- .../miv-rv32-message-authentication/README.md | 132 ++--- .../src/application/main.c | 4 +- .../src/platform/LICENSE.md | 26 + user-crypto/miv-rv32-ndrbg-services/.cproject | 2 +- .../miv-rv32-ndrbg-services/.gitignore | 2 +- user-crypto/miv-rv32-ndrbg-services/README.md | 56 +- .../src/platform/LICENSE.md | 26 + .../miv-rv32-rsa-cryptography/.cproject | 2 +- .../miv-rv32-rsa-cryptography/.gitignore | 2 +- .../miv-rv32-rsa-cryptography/README.md | 60 +-- ..._cryptography.ttl => RSA_Cryptography.ttl} | 2 +- .../src/platform/LICENSE.md | 26 + user-crypto/miv-rv32-rsa-services/.cproject | 2 +- user-crypto/miv-rv32-rsa-services/.gitignore | 2 +- user-crypto/miv-rv32-rsa-services/README.md | 65 ++- .../miv-rv32-rsa-services/rsa_services.ttl | 2 +- .../src/application/main.c | 1 - .../src/platform/LICENSE.md | 26 + 52 files changed, 901 insertions(+), 658 deletions(-) rename user-crypto/miv-rv32-aes-cryptography/{RV32_AES_Cryptography.ttl => AES_Cryptography.ttl} (96%) create mode 100644 user-crypto/miv-rv32-aes-cryptography/src/platform/LICENSE.md rename user-crypto/miv-rv32-ccm-services/{RV32_CCM_msg_auth.ttl => CCM_Msg_Auth.ttl} (99%) create mode 100644 user-crypto/miv-rv32-ccm-services/src/platform/LICENSE.md rename user-crypto/miv-rv32-dsa-services/{dsa_services.ttl => DSA_Service.ttl} (97%) mode change 100755 => 100644 create mode 100644 user-crypto/miv-rv32-dsa-services/src/platform/LICENSE.md create mode 100644 user-crypto/miv-rv32-ecdsa-services/src/platform/LICENSE.md rename user-crypto/miv-rv32-key-agreement/{RV32_Key_agreement.ttl => Key_Agreement.ttl} (99%) create mode 100644 user-crypto/miv-rv32-key-agreement/src/platform/LICENSE.md rename user-crypto/miv-rv32-keytree-services/{miv-rv32-key-tree.ttl => key-tree.ttl} (83%) create mode 100644 user-crypto/miv-rv32-keytree-services/src/platform/LICENSE.md create mode 100644 user-crypto/miv-rv32-message-authentication/src/platform/LICENSE.md create mode 100644 user-crypto/miv-rv32-ndrbg-services/src/platform/LICENSE.md rename user-crypto/miv-rv32-rsa-cryptography/{RV32_RSA_cryptography.ttl => RSA_Cryptography.ttl} (99%) create mode 100644 user-crypto/miv-rv32-rsa-cryptography/src/platform/LICENSE.md create mode 100644 user-crypto/miv-rv32-rsa-services/src/platform/LICENSE.md diff --git a/user-crypto/miv-rv32-aes-cryptography/.cproject b/user-crypto/miv-rv32-aes-cryptography/.cproject index a4390e1..2301941 100644 --- a/user-crypto/miv-rv32-aes-cryptography/.cproject +++ b/user-crypto/miv-rv32-aes-cryptography/.cproject @@ -330,4 +330,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-aes-cryptography/.gitignore b/user-crypto/miv-rv32-aes-cryptography/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-aes-cryptography/.gitignore +++ b/user-crypto/miv-rv32-aes-cryptography/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-aes-cryptography/RV32_AES_Cryptography.ttl b/user-crypto/miv-rv32-aes-cryptography/AES_Cryptography.ttl similarity index 96% rename from user-crypto/miv-rv32-aes-cryptography/RV32_AES_Cryptography.ttl rename to user-crypto/miv-rv32-aes-cryptography/AES_Cryptography.ttl index f175060..66ce481 100644 --- a/user-crypto/miv-rv32-aes-cryptography/RV32_AES_Cryptography.ttl +++ b/user-crypto/miv-rv32-aes-cryptography/AES_Cryptography.ttl @@ -27,7 +27,6 @@ send $0 ; --------------------------------------------------------------------------------------------------------------- ;Test Case 1 - using DMA ; INPUT -; COUNT = 0 ; KEY = c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558 ; PLAINTEXT = 00000000000000000000000000000000 ; OUTPUT @@ -40,7 +39,7 @@ pause 1 send 'c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558' pause 1 -;IV +;Initialization Vector(IV) send '00000000000000000000000000000000' pause 1 @@ -59,7 +58,6 @@ send $0 ; --------------------------------------------------------------------------------------------------------------- ;Test Case 2 - non DMA ; INPUT -; COUNT = 0 ; KEY = c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558 ; PLAINTEXT = 00000000000000000000000000000000 ; OUTPUT @@ -72,7 +70,7 @@ pause 1 send 'c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558' pause 1 -;IV +;Initialization Vector(IV) send '00000000000000000000000000000000' pause 1 @@ -103,7 +101,7 @@ pause 1 send '0000000000000000000000000000000000000000000000000000000000000000' pause 1 -;IV +;Initialization Vector(IV) send '00000000000000000000000000000000' pause 1 @@ -134,7 +132,7 @@ pause 1 send '0000000000000000000000000000000000000000000000000000000000000000' pause 1 -;IV +;Initialization Vector(IV) send '00000000000000000000000000000000' pause 1 @@ -166,7 +164,7 @@ pause 1 send '1d85a181b54cde51f0e098095b2962fdc93b51fe9b88602b3f54130bf76a5bd9' pause 1 -;IV +;Initialization Vector(IV) send '00000000000000000000000000000000' pause 1 @@ -200,7 +198,7 @@ pause 1 send '28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64' pause 1 -;IV +;Initialization Vector(IV) send '00000000000000000000000000000000' pause 1 @@ -231,7 +229,7 @@ pause 1 send '28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64' pause 1 -;IV +;Initialization Vector(IV) send '00000000000000000000000000000000' pause 1 diff --git a/user-crypto/miv-rv32-aes-cryptography/README.md b/user-crypto/miv-rv32-aes-cryptography/README.md index 323fd24..a541b5f 100644 --- a/user-crypto/miv-rv32-aes-cryptography/README.md +++ b/user-crypto/miv-rv32-aes-cryptography/README.md @@ -1,7 +1,9 @@ -PolarFire User Crypto AES Cryptography Services example -================================================================================ + +# PolarFire User Crypto AES Cryptography Services example + This example project demonstrate the use of symmetric key encryption and -decryption services. The following PolarFire User Crypto service functions are used +decryption services. The following PolarFire User Crypto service functions are +used: - CALSymEncrypt() - CALSymEncryptDMA() @@ -15,24 +17,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -49,8 +50,8 @@ UART terminal followed by a menu system and instructions. This program displays the return data from User Crypto processor for encryption and decryption services. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -62,7 +63,7 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a @@ -104,11 +105,11 @@ This application provides following settings as per CAL requirement 2. A symbol INC_STDINT_H is defined in project preprocessor setting. For more detail, please refer to caltypes.h file present in CAL folder. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. You can use -RV32_AES_Cryptography.ttl Tera Term Macro script present in project directory for +AES_Cryptography.ttl Tera Term Macro script present in project directory for testing AES Cryptography example project. **NOTE:** @@ -119,10 +120,10 @@ testing AES Cryptography example project. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -133,7 +134,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -145,14 +146,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-aes-cryptography/src/application/main.c b/user-crypto/miv-rv32-aes-cryptography/src/application/main.c index 30427c6..82c465a 100644 --- a/user-crypto/miv-rv32-aes-cryptography/src/application/main.c +++ b/user-crypto/miv-rv32-aes-cryptography/src/application/main.c @@ -45,9 +45,9 @@ uint32_t g_user_crypto_base_addr = 0x62000000UL; */ const uint8_t g_greeting_msg[] = "\r\n\r\n\ -******************************************************************************\r\n\ -********* PolarFire User Crypto AES Cryptography Service Example Project *********\r\n\ -******************************************************************************\r\n\ +***************************************************************************\r\n\ +******* PolarFire User Crypto AES Cryptography Service Example Project ****\r\n\ +***************************************************************************\r\n\ This example project demonstrates the use of the PolarFire User Crypto \r\n\ Cryptography Services. The following User Athena services are demonstrated:\r\n\ 1 - AES-256 encryption.\r\n\ @@ -317,4 +317,4 @@ int main( void ) } } } -} \ No newline at end of file +} diff --git a/user-crypto/miv-rv32-aes-cryptography/src/platform/LICENSE.md b/user-crypto/miv-rv32-aes-cryptography/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-aes-cryptography/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-ccm-services/.cproject b/user-crypto/miv-rv32-ccm-services/.cproject index 3465f7a..7b4d106 100644 --- a/user-crypto/miv-rv32-ccm-services/.cproject +++ b/user-crypto/miv-rv32-ccm-services/.cproject @@ -329,4 +329,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-ccm-services/.gitignore b/user-crypto/miv-rv32-ccm-services/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-ccm-services/.gitignore +++ b/user-crypto/miv-rv32-ccm-services/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-ccm-services/RV32_CCM_msg_auth.ttl b/user-crypto/miv-rv32-ccm-services/CCM_Msg_Auth.ttl similarity index 99% rename from user-crypto/miv-rv32-ccm-services/RV32_CCM_msg_auth.ttl rename to user-crypto/miv-rv32-ccm-services/CCM_Msg_Auth.ttl index d8cef0b..62532ce 100644 --- a/user-crypto/miv-rv32-ccm-services/RV32_CCM_msg_auth.ttl +++ b/user-crypto/miv-rv32-ccm-services/CCM_Msg_Auth.ttl @@ -4,7 +4,7 @@ ; 2. By default, Tera Term log will be stored in Tera Term installation Directory. changedir '.' -logopen "MAC_ccm_msg_auth.log" 0 0 0 1 +logopen "CCM_Msg_Auth.log" 0 0 0 1 settitle 'PolarFire User Crypto CCM service' diff --git a/user-crypto/miv-rv32-ccm-services/README.md b/user-crypto/miv-rv32-ccm-services/README.md index c2a0798..a1bff73 100644 --- a/user-crypto/miv-rv32-ccm-services/README.md +++ b/user-crypto/miv-rv32-ccm-services/README.md @@ -1,5 +1,6 @@ -PolarFire User Crypto CCM Services example -================================================================================ + +# PolarFire User Crypto CCM Services Example + This example project demonstrates the use of the following User Crypto Services for demonstrating CBC Counter Mode (CCM) @@ -26,24 +27,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). + +## How to use this example -How to use this example --------------------------------------------------------------------------------- This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -60,8 +60,8 @@ UART terminal followed by a menu system and instructions. This program displays the return data from User Crypto processor for digital signature generation and verification services. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -73,7 +73,7 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a @@ -116,6 +116,7 @@ authentication code and are displayed on UART terminal. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -132,11 +133,11 @@ This application provides following settings as per CAL requirement key {1230...0} as 0x12 0x3 and press return, this will be treated as byte0 = 0x12, byte1 = 0x30, byte2-127 = 0x00. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality.You can use -the RV32_CCM_msg_auth.ttl Tera Term Macro script present in project directory +the CCM_Msg_Auth.ttl Tera Term Macro script present in project directory for testing Data Authenticated Encryption/Decryption Services. **NOTE:** @@ -147,10 +148,10 @@ for testing Data Authenticated Encryption/Decryption Services. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -161,7 +162,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -173,14 +174,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. diff --git a/user-crypto/miv-rv32-ccm-services/src/platform/LICENSE.md b/user-crypto/miv-rv32-ccm-services/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-ccm-services/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-dsa-services/.cproject b/user-crypto/miv-rv32-dsa-services/.cproject index 442ce3b..4d87a97 100755 --- a/user-crypto/miv-rv32-dsa-services/.cproject +++ b/user-crypto/miv-rv32-dsa-services/.cproject @@ -329,4 +329,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-dsa-services/.gitignore b/user-crypto/miv-rv32-dsa-services/.gitignore index f1b6b72..4d0cf27 100755 --- a/user-crypto/miv-rv32-dsa-services/.gitignore +++ b/user-crypto/miv-rv32-dsa-services/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-dsa-services/dsa_services.ttl b/user-crypto/miv-rv32-dsa-services/DSA_Service.ttl old mode 100755 new mode 100644 similarity index 97% rename from user-crypto/miv-rv32-dsa-services/dsa_services.ttl rename to user-crypto/miv-rv32-dsa-services/DSA_Service.ttl index 94db886..b383c7e --- a/user-crypto/miv-rv32-dsa-services/dsa_services.ttl +++ b/user-crypto/miv-rv32-dsa-services/DSA_Service.ttl @@ -1,249 +1,249 @@ -; Tera Term Setting: -; 1. Before running Tera Term Macro script, you should set language as English -; and transmit delay in Serial port setup to 5msec/char and 5msec/line. -; 2. By default, Tera Term log will be stored in Tera Term installation Directory. - -changedir '.' -logopen "DSA_service.log" 0 0 0 1 - -settitle 'PolarFire SoC MSS User Crypto DSA service' - -setsync 1 - -;Clear screen -clearscreen 0 - -; Set baud rate to 115200 -setbaud 115200 - -; local echo off -setecho 0 - -; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -; Test Case 1 -; INPUT -; P = -; a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885 -; 9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c -; 881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577 -; d9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f451829159 -; 8221fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a -; 99be254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97b -; bcaa07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb2969 -; 7d7d541348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877 -; Q = abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045 -; G = -; 867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27 -; c2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed6 -; 8e79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d81 -; 4d1ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdf -; b8098e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad105951 -; 6a1d45755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f7763884 -; 5b00e59ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6db -; a64562085f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930 - -;Msg = -; ed9a64d3109ef8a9292956b946873ca4bd887ce624b81be81b82c69c67aaddf5655f70fe4768114db2834c71787f858e516 -; 5da1a7fa961d855ad7e5bc4b7be31b97dbe770798ef7966152b14b86ae35625a28aee5663b9ef3067cbdfbabd87197e5c84 -; 2d3092eb88dca57c6c8ad4c00a19ddf2e1967b59bd06ccaef933bc28e7 -;X = 6d4c934391b7f6fb6e19e3141f8c0018ef5726118a11064358c7d35b37737377 -;Y = -; 1f0a5c75e7985d6e70e4fbfda51a10b925f6accb600d7c6510db90ec367b93bb069bd286e8f979b22ef0702f717a8755c18 -; 309c87dae3fe82cc3dc8f4b7aa3d5f3876f4d4b3eb68bfe910c43076d6cd0d39fc88dde78f09480db55234e6c8ca59fe270 -; 0efec04feee6b4e8ee2413721858be7190dbe905f456edcab55b2dc2916dc1e8731988d9ef8b619abcf8955aa960ef02b3f -; 02a8dc649369222af50f1338ed28d667f3f10cae2a3c28a3c1d08df639c81ada13c8fd198c6dae3d62a3fe9f04c985c65f6 -; 10c06cb8faea68edb80de6cf07a8e89c00218185a952b23572e34df07ce5b4261e5de427eb503ee1baf5992db6d438b4743 -; 4c40c22657bc163e7953fa33eff39dc2734607039aadd6ac27e4367131041f845ffa1a13f556bfba2307a5c78f2ccf11298 -; c762e08871968e48dc3d1569d09965cd09da43cf0309a16af1e20fee7da3dc21b364c4615cd5123fa5f9b23cfc4ffd9cfdc -; ea670623840b062d4648d2eba786ad3f7ae337a4284324ace236f9f7174fbf442b99043002f -;K = 40b5cc685c3d1f59072228af9551683b5b8c8ff65240114ad2dacfccf3928057 - -; OUTPUT -;R = 7695698a14755db4206e850b4f5f19c540b07d07e08aac591e20081646e6eedc -;S = 3dae01154ecff7b19007a953f185f0663ef7f2537f0b15e04fb343c961f36de2 -; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -; Signature Generation -;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -;select signature generation -send '1' -pause 1 - -; Msg -pause 1 -send 'ed9a64d3109ef8a9292956b946873ca4bd887ce624b81be81b82c69c67aaddf5655f70fe4768114db2834c71787f858e516' -send '5da1a7fa961d855ad7e5bc4b7be31b97dbe770798ef7966152b14b86ae35625a28aee5663b9ef3067cbdfbabd87197e5c84' -send '2d3092eb88dca57c6c8ad4c00a19ddf2e1967b59bd06ccaef933bc28e7' -pause 1 - -;G -pause 4 -send '867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27c' -send '2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed68e' -send '79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d814d1' -pause 4 -send 'ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdfb809' -send '8e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad1059516a1d4' -send '5755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f77638845b00e5' -send '9ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6dba645620' -send '85f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930' -pause 4 - -;K -send '40b5cc685c3d1f59072228af9551683b5b8c8ff65240114ad2dacfccf3928057' -pause 2 - -;X -send '6d4c934391b7f6fb6e19e3141f8c0018ef5726118a11064358c7d35b37737377' - -pause 4 - -;P -send 'a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885' -send '9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c' -pause 4 -send '881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577d' -send '9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f45182915982' -send '21fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a99b' -send 'e254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97bbcaa' -send '07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb29697d7d5' -send '41348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877' -pause 4 - -;Q -send 'abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045' - -pause 4 -; send dummy -send '1' -pause 3 - -; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -; Signature verification -;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -;select verification -send '2' -pause 1 - -; send option 1 to automatically generate the public key -send '1' -pause 5 - -; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -; Test Case 2 -; INPUT -; P = -; a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885 -; 9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c -; 881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577 -; d9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f451829159 -; 8221fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a -; 99be254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97b -; bcaa07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb2969 -; 7d7d541348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877 -; Q = -; abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045 -; G = -; 867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27 -; c2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed6 -; 8e79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d81 -; 4d1ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdf -; b8098e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad105951 -; 6a1d45755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f7763884 -; 5b00e59ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6db -; a64562085f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930 -; Msg = -; c737d5ae248a96062d6afa8dcacc0384c5fbfb9d8b6052b52493c60d3edfc524b567b1f896e7447d0e24019403ed83e4889 -; c0c4de57c70fada6c8b5a09904350a44dfaf77d60af62de3edfd8760d077473f26df2837cfc2015f227dd7d351a5350f142 -; 8f2699fd3f518326fea8aef98fc4ea673130c8079fac3895fe856c77f8 -; X = -; 40dbd496fc4644be7ccb24d9dc55895c1b923a05f4da5610589d564ee8aac33f -; Y = -; 6112d3cd3191d17dee7788f568815a0aab50006002c9de2bd1a9bba245ba02894b02e9247517ace698ae0a05176b62b3a02 -; 5a563dda8deb7f2fc3e177ae3477448d39ae4ebe7ae8ec65a4421f754667fd6d7c2eb93f1a18d3d1a6235736bcdb74746f4 -; 6d88e65dc07c2591e1f95dda5e5e20e105ee8b4ddcaaf36021290d6b6493671d8aafae145d9b90bec3cc60179bb8fc30f14 -; 3c575d5d861623721b6547d3aaaade455f05fef9318abcd29bd19b12c35ca756de5108c185ece4aa1bf1a8e38809797067b -; d1f52b6cf2c415e73f9246bd5bfadd7b9a9d2b5369701e72147e22da7e092d9b578fb0c044a36effcbd709258500a00cff2 -; 30962c44225712fc43f9e802baead7f9cb46ab4931f663c6e3ed4082d59610f01741b5f24566b01b3e3933b29e028c54bd2 -; fc75b549fd05e64c58c9ae0ba417a9e98581db77be75233a42f771c99f0a49b494f0955202b19d6c740e866066104e463e6 -; 5e4bad9a081636d05367426153f04bcb2712186dca6834388e82520d34efd8a89313b2c7e60 -; K = -; aa63e91cb3fa545c447a8b8309a569d48104e14d5d05b8951033ac8a7d711c3f - -; OUTPUT -;R = 0041b1c756dd2e42714f9ee7edce21ea33ef49dbf452ccd9357d5f45ffab08f9 -;S = 102c6eaad38d39c0d036335ae19dd0d75e8dcabae59b120f69cbd2b5cf48abdb -; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -; Signature Generation -;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -send '5' -pause 1 - -;select signature generation -send '1' -pause 1 - -; Msg -pause 1 -send 'c737d5ae248a96062d6afa8dcacc0384c5fbfb9d8b6052b52493c60d3edfc524b567b1f896e7447d0e24019403ed83e4889' -send 'c0c4de57c70fada6c8b5a09904350a44dfaf77d60af62de3edfd8760d077473f26df2837cfc2015f227dd7d351a5350f142' -send '8f2699fd3f518326fea8aef98fc4ea673130c8079fac3895fe856c77f8' -pause 1 - -;G -pause 4 -send '867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27' -send 'c2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed6' -send '8e79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d81' -pause 4 -send '4d1ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdf' -send 'b8098e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad105951' -send '6a1d45755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f7763884' -send '5b00e59ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6db' -send 'a64562085f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930' -pause 4 - -;K -send 'aa63e91cb3fa545c447a8b8309a569d48104e14d5d05b8951033ac8a7d711c3f' -pause 2 - -;X -send '40dbd496fc4644be7ccb24d9dc55895c1b923a05f4da5610589d564ee8aac33f' - -pause 4 - -;P -send 'a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885' -send '9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c' -pause 4 -send '881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577d' -send '9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f45182915982' -send '21fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a99b' -send 'e254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97bbcaa' -send '07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb29697d7d5' -send '41348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877' -pause 4 - -;Q -send 'abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045' - -pause 4 -; send dummy -send '1' -pause 3 - -; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -; Signature verification -;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - -;select verification -send '2' -pause 1 - -; send option 1 to automatically generate the public key -send '1' -pause 5 - +; Tera Term Setting: +; 1. Before running Tera Term Macro script, you should set language as English +; and transmit delay in Serial port setup to 5msec/char and 5msec/line. +; 2. By default, Tera Term log will be stored in Tera Term installation Directory. + +changedir '.' +logopen "DSA_Service.log" 0 0 0 1 + +settitle 'PolarFire SoC MSS User Crypto DSA service' + +setsync 1 + +;Clear screen +clearscreen 0 + +; Set baud rate to 115200 +setbaud 115200 + +; local echo off +setecho 0 + +; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +; Test Case 1 +; INPUT +; P = +; a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885 +; 9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c +; 881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577 +; d9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f451829159 +; 8221fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a +; 99be254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97b +; bcaa07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb2969 +; 7d7d541348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877 +; Q = abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045 +; G = +; 867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27 +; c2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed6 +; 8e79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d81 +; 4d1ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdf +; b8098e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad105951 +; 6a1d45755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f7763884 +; 5b00e59ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6db +; a64562085f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930 + +;Msg = +; ed9a64d3109ef8a9292956b946873ca4bd887ce624b81be81b82c69c67aaddf5655f70fe4768114db2834c71787f858e516 +; 5da1a7fa961d855ad7e5bc4b7be31b97dbe770798ef7966152b14b86ae35625a28aee5663b9ef3067cbdfbabd87197e5c84 +; 2d3092eb88dca57c6c8ad4c00a19ddf2e1967b59bd06ccaef933bc28e7 +;X = 6d4c934391b7f6fb6e19e3141f8c0018ef5726118a11064358c7d35b37737377 +;Y = +; 1f0a5c75e7985d6e70e4fbfda51a10b925f6accb600d7c6510db90ec367b93bb069bd286e8f979b22ef0702f717a8755c18 +; 309c87dae3fe82cc3dc8f4b7aa3d5f3876f4d4b3eb68bfe910c43076d6cd0d39fc88dde78f09480db55234e6c8ca59fe270 +; 0efec04feee6b4e8ee2413721858be7190dbe905f456edcab55b2dc2916dc1e8731988d9ef8b619abcf8955aa960ef02b3f +; 02a8dc649369222af50f1338ed28d667f3f10cae2a3c28a3c1d08df639c81ada13c8fd198c6dae3d62a3fe9f04c985c65f6 +; 10c06cb8faea68edb80de6cf07a8e89c00218185a952b23572e34df07ce5b4261e5de427eb503ee1baf5992db6d438b4743 +; 4c40c22657bc163e7953fa33eff39dc2734607039aadd6ac27e4367131041f845ffa1a13f556bfba2307a5c78f2ccf11298 +; c762e08871968e48dc3d1569d09965cd09da43cf0309a16af1e20fee7da3dc21b364c4615cd5123fa5f9b23cfc4ffd9cfdc +; ea670623840b062d4648d2eba786ad3f7ae337a4284324ace236f9f7174fbf442b99043002f +;K = 40b5cc685c3d1f59072228af9551683b5b8c8ff65240114ad2dacfccf3928057 + +; OUTPUT +;R = 7695698a14755db4206e850b4f5f19c540b07d07e08aac591e20081646e6eedc +;S = 3dae01154ecff7b19007a953f185f0663ef7f2537f0b15e04fb343c961f36de2 +; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +; Signature Generation +;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +;select signature generation +send '1' +pause 1 + +; Msg +pause 1 +send 'ed9a64d3109ef8a9292956b946873ca4bd887ce624b81be81b82c69c67aaddf5655f70fe4768114db2834c71787f858e516' +send '5da1a7fa961d855ad7e5bc4b7be31b97dbe770798ef7966152b14b86ae35625a28aee5663b9ef3067cbdfbabd87197e5c84' +send '2d3092eb88dca57c6c8ad4c00a19ddf2e1967b59bd06ccaef933bc28e7' +pause 1 + +;G +pause 4 +send '867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27c' +send '2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed68e' +send '79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d814d1' +pause 4 +send 'ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdfb809' +send '8e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad1059516a1d4' +send '5755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f77638845b00e5' +send '9ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6dba645620' +send '85f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930' +pause 4 + +;K +send '40b5cc685c3d1f59072228af9551683b5b8c8ff65240114ad2dacfccf3928057' +pause 2 + +;X +send '6d4c934391b7f6fb6e19e3141f8c0018ef5726118a11064358c7d35b37737377' + +pause 4 + +;P +send 'a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885' +send '9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c' +pause 4 +send '881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577d' +send '9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f45182915982' +send '21fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a99b' +send 'e254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97bbcaa' +send '07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb29697d7d5' +send '41348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877' +pause 4 + +;Q +send 'abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045' + +pause 4 +; send dummy +send '1' +pause 3 + +; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +; Signature verification +;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +;select verification +send '2' +pause 1 + +; send option 1 to automatically generate the public key +send '1' +pause 5 + +; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +; Test Case 2 +; INPUT +; P = +; a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885 +; 9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c +; 881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577 +; d9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f451829159 +; 8221fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a +; 99be254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97b +; bcaa07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb2969 +; 7d7d541348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877 +; Q = +; abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045 +; G = +; 867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27 +; c2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed6 +; 8e79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d81 +; 4d1ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdf +; b8098e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad105951 +; 6a1d45755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f7763884 +; 5b00e59ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6db +; a64562085f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930 +; Msg = +; c737d5ae248a96062d6afa8dcacc0384c5fbfb9d8b6052b52493c60d3edfc524b567b1f896e7447d0e24019403ed83e4889 +; c0c4de57c70fada6c8b5a09904350a44dfaf77d60af62de3edfd8760d077473f26df2837cfc2015f227dd7d351a5350f142 +; 8f2699fd3f518326fea8aef98fc4ea673130c8079fac3895fe856c77f8 +; X = +; 40dbd496fc4644be7ccb24d9dc55895c1b923a05f4da5610589d564ee8aac33f +; Y = +; 6112d3cd3191d17dee7788f568815a0aab50006002c9de2bd1a9bba245ba02894b02e9247517ace698ae0a05176b62b3a02 +; 5a563dda8deb7f2fc3e177ae3477448d39ae4ebe7ae8ec65a4421f754667fd6d7c2eb93f1a18d3d1a6235736bcdb74746f4 +; 6d88e65dc07c2591e1f95dda5e5e20e105ee8b4ddcaaf36021290d6b6493671d8aafae145d9b90bec3cc60179bb8fc30f14 +; 3c575d5d861623721b6547d3aaaade455f05fef9318abcd29bd19b12c35ca756de5108c185ece4aa1bf1a8e38809797067b +; d1f52b6cf2c415e73f9246bd5bfadd7b9a9d2b5369701e72147e22da7e092d9b578fb0c044a36effcbd709258500a00cff2 +; 30962c44225712fc43f9e802baead7f9cb46ab4931f663c6e3ed4082d59610f01741b5f24566b01b3e3933b29e028c54bd2 +; fc75b549fd05e64c58c9ae0ba417a9e98581db77be75233a42f771c99f0a49b494f0955202b19d6c740e866066104e463e6 +; 5e4bad9a081636d05367426153f04bcb2712186dca6834388e82520d34efd8a89313b2c7e60 +; K = +; aa63e91cb3fa545c447a8b8309a569d48104e14d5d05b8951033ac8a7d711c3f + +; OUTPUT +;R = 0041b1c756dd2e42714f9ee7edce21ea33ef49dbf452ccd9357d5f45ffab08f9 +;S = 102c6eaad38d39c0d036335ae19dd0d75e8dcabae59b120f69cbd2b5cf48abdb +; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +; Signature Generation +;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +send '5' +pause 1 + +;select signature generation +send '1' +pause 1 + +; Msg +pause 1 +send 'c737d5ae248a96062d6afa8dcacc0384c5fbfb9d8b6052b52493c60d3edfc524b567b1f896e7447d0e24019403ed83e4889' +send 'c0c4de57c70fada6c8b5a09904350a44dfaf77d60af62de3edfd8760d077473f26df2837cfc2015f227dd7d351a5350f142' +send '8f2699fd3f518326fea8aef98fc4ea673130c8079fac3895fe856c77f8' +pause 1 + +;G +pause 4 +send '867d5fb72f5936d1a14ed3b60499662f3124686ef108c5b3da6663a0e86197ec2cc4c9460193a74ff16028ac9441b0c7d27' +send 'c2272d483ac7cd794d598416c4ff9099a61679d417d478ce5dd974bf349a14575afe74a88b12dd5f6d1cbd3f91ddd597ed6' +send '8e79eba402613130c224b94ac28714a1f1c552475a5d29cfcdd8e08a6b1d65661e28ef313514d1408f5abd3e06ebe3a7d81' +pause 4 +send '4d1ede316bf495273ca1d574f42b482eea30db53466f454b51a175a0b89b3c05dda006e719a2e6371669080d768cc038cdf' +send 'b8098e9aad9b8d83d4b759f43ac9d22b353ed88a33723550150de0361b7a376f37b45d437f71cb711f2847de671ad105951' +send '6a1d45755224a15d37b4aeada3f58c69a136daef0636fe38e3752064afe598433e80089fda24b144a462734bef8f7763884' +send '5b00e59ce7fa4f1daf487a2cada11eaba72bb23e1df6b66a183edd226c440272dd9b06bec0e57f1a0822d2e00212064b6db' +send 'a64562085f5a75929afa5fe509e0b78e630aaf12f91e4980c9b0d6f7e059a2ea3e23479d930' +pause 4 + +;K +send 'aa63e91cb3fa545c447a8b8309a569d48104e14d5d05b8951033ac8a7d711c3f' +pause 2 + +;X +send '40dbd496fc4644be7ccb24d9dc55895c1b923a05f4da5610589d564ee8aac33f' + +pause 4 + +;P +send 'a410d23ed9ad9964d3e401cb9317a25213f75712acbc5c12191abf3f1c0e723e2333b49eb1f95b0f9748d952f04a5ae35885' +send '9d384403ce364aa3f58dd9769909b45048548c55872a6afbb3b15c54882f96c20df1b2df164f0bac849ca17ad2df63abd75c' +pause 4 +send '881922e79a5009f00b7d631622e90e7fa4e980618575e1d6bd1a72d5b6a50f4f6a68b793937c4af95fc11541759a1736577d' +send '9448b87792dff07232415512e933755e12250d466e9cc8df150727d747e51fea7964158326b1365d580cb190f45182915982' +send '21fdf36c6305c8b8a8ed05663dd7b006e945f592abbecae460f77c71b6ec649d3fd5394202ed7bbbd040f7b8fd57cb06a99b' +send 'e254fa25d71a3760734046c2a0db383e02397913ae67ce65870d9f6c6f67a9d00497be1d763b21937cf9cbf9a24ef97bbcaa' +send '07916f8894e5b7fb03258821ac46140965b23c5409ca49026efb2bf95bce025c4183a5f659bf6aaeef56d7933bb29697d7d5' +send '41348c871fa01f869678b2e34506f6dc0a4c132b689a0ed27dc3c8d53702aa584877' +pause 4 + +;Q +send 'abc67417725cf28fc7640d5de43825f416ebfa80e191c42ee886303338f56045' + +pause 4 +; send dummy +send '1' +pause 3 + +; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +; Signature verification +;------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +;select verification +send '2' +pause 1 + +; send option 1 to automatically generate the public key +send '1' +pause 5 + logclose \ No newline at end of file diff --git a/user-crypto/miv-rv32-dsa-services/README.md b/user-crypto/miv-rv32-dsa-services/README.md index 5022f8a..6a450e9 100755 --- a/user-crypto/miv-rv32-dsa-services/README.md +++ b/user-crypto/miv-rv32-dsa-services/README.md @@ -1,6 +1,7 @@ -PolarFire User Crypto ECDSA Services example -================================================================================ -This Example Project demonstrates the usage of the User Crypto hardware block for + +# PolarFire User Crypto DSA Services Example + +This example project demonstrates the usage of the User Crypto hardware block for the signature generation and verification using DSA service functions. It uses - CALDSASignHash() is used to generate digital signature. @@ -13,24 +14,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). + +## How to use this example -How to use this example --------------------------------------------------------------------------------- This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -47,8 +47,8 @@ UART terminal followed by a menu system and instructions. This program displays the return data from User Crypto processor for digital signature generation and verification services. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -60,16 +60,16 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a CoreUARTapb mapped to STDIO, etc. -### Generate digital signature +### Generate Digital Signature -Select option '1' to generate a digital signature for DSA public-key cryptographic service. -The signature generation function take following parameters as an input. +Select option '1' to generate a digital signature for DSA public-key cryptographic +service. The signature generation function take following parameters as an input. 1. *msg* -: message string 2. *G* -: A generator point 3. *K* -: A random per message parameter. @@ -81,14 +81,14 @@ The **CALDSASignHash()** function performs signature generation and after the successful generation program displays a success message along with generated signature set {R,S} on the UART terminal. -### Verify digital signature +### Verify Digital Signature -Select *2* to verify the digital signature set {R,S} generated by DSA public key -cryptographic services. The program takes a public key to verify the message signature -along with other domain parameters. -The **CALDSAVerifyHash()** function performs DSA signature verification and after -successful completion it returns the result of verification process,an -appropriate message will be displayed on the UART terminal based on the returned result. +Select option '2' to verify the digital signature set {R,S} generated by DSA +public key cryptographic services. The program takes a public key to verify the +message signature along with other domain parameters. The **CALDSAVerifyHash()** +function performs DSA signature verification and after successful completion it +returns the result of verification process,an appropriate message will be +displayed on the UART terminal based on the returned result. **NOTE:** The DSA signature Generation operation should be executed before executing @@ -97,6 +97,7 @@ ECDSA signature verification operation. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -107,14 +108,14 @@ This application provides following settings as per CAL requirement For more detail, please refer to caltypes.h file present in CAL folder. **NOTE:** - 1. If you try to enter data values other than 0 - 9, a - f, A - F, an error - message will be displayed on the serial terminal. + If you try to enter data values other than 0 - 9, a - f, A - F, an error + message will be displayed on the serial terminal. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. You can use -dsa_services.ttl Tera Term Macro script present in project directory for +DSA_Service.ttl Tera Term Macro script present in project directory for testing DSA Signature Services example project. **NOTE:** @@ -125,10 +126,10 @@ testing DSA Signature Services example project. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -139,7 +140,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -151,14 +152,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-dsa-services/src/platform/LICENSE.md b/user-crypto/miv-rv32-dsa-services/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-dsa-services/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-ecdsa-services/.cproject b/user-crypto/miv-rv32-ecdsa-services/.cproject index 20076af..49fb6d2 100755 --- a/user-crypto/miv-rv32-ecdsa-services/.cproject +++ b/user-crypto/miv-rv32-ecdsa-services/.cproject @@ -330,4 +330,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-ecdsa-services/.gitignore b/user-crypto/miv-rv32-ecdsa-services/.gitignore index f1b6b72..4d0cf27 100755 --- a/user-crypto/miv-rv32-ecdsa-services/.gitignore +++ b/user-crypto/miv-rv32-ecdsa-services/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-ecdsa-services/README.md b/user-crypto/miv-rv32-ecdsa-services/README.md index 8c66f19..17b1ac8 100755 --- a/user-crypto/miv-rv32-ecdsa-services/README.md +++ b/user-crypto/miv-rv32-ecdsa-services/README.md @@ -1,5 +1,6 @@ -PolarFire User Crypto ECDSA Services example -================================================================================ + +# PolarFire User Crypto ECDSA Services Example + This Example Project demonstrates the usage of the User Crypto hardware block for the signature generation and verification using ECDSA service functions. It uses **NIST-P384** elliptic curve for signature generation and verification. @@ -11,7 +12,7 @@ User can Experiment with different standard elliptic curves supported by user- crypto core by changing curve domain parameters. Here's the list of supported NIST-P curves -- *P192*,*P224*,*P256*,*P384*,*P512* +- *P192*, *P224*, *P256*, *P384*, *P512* **NOTE** -: Athena core uses an Elliptic curve of the following format. @@ -27,24 +28,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -62,8 +62,8 @@ to select the options as shown over the serial port. This program displays the return data from User Crypto processor for digital signature generation and verification services. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -75,13 +75,13 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a CoreUARTapb mapped to STDIO, etc. -### Generate digital signature +### Generate Digital Signature Select '1' to generate a digital signature for ECDSA public-key cryptographic service. The signature generation function take following parameters as an input. @@ -98,7 +98,7 @@ message along with generated signature set {R,S} on the UART terminal. *NOTE* -: **b** parameter of P384 elliptic is fixed as far as this example is concerned. -### Verify digital signature: +### Verify Digital Signature: Select '2' to verify the digital signature set {R,S} generated by ECDSA public key cryptographic services. The program takes a public key to verify the message @@ -113,6 +113,7 @@ executing ECDSA signature verification operation. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -122,7 +123,7 @@ This application provides following settings as per CAL requirement 2. A symbol INC_STDINT_H is defined in project preprocessor setting. For more detail, please refer to caltypes.h file present in CAL folder. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. You can use @@ -137,10 +138,10 @@ testing ECDSA Signature Services example project. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -151,7 +152,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -163,14 +164,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-ecdsa-services/ecdsa_services.ttl b/user-crypto/miv-rv32-ecdsa-services/ecdsa_services.ttl index 80a6dc6..6ea7ec3 100755 --- a/user-crypto/miv-rv32-ecdsa-services/ecdsa_services.ttl +++ b/user-crypto/miv-rv32-ecdsa-services/ecdsa_services.ttl @@ -4,7 +4,7 @@ ; 2. By default, Tera Term log will be stored in Tera Term installation Directory. changedir '.' -logopen "ECDSA_service.log" 0 0 0 1 +logopen "ecdsa_service.log" 0 0 0 1 settitle 'PolarFire SoC MSS User Crypto ECDSA service' diff --git a/user-crypto/miv-rv32-ecdsa-services/src/application/main.c b/user-crypto/miv-rv32-ecdsa-services/src/application/main.c index e7bca98..ec89db7 100755 --- a/user-crypto/miv-rv32-ecdsa-services/src/application/main.c +++ b/user-crypto/miv-rv32-ecdsa-services/src/application/main.c @@ -418,16 +418,16 @@ void ecdsa_verify(void) sizeof(read_public_key_qx)); /* adjust endianness */ - CALWordReverse(public_key_qx, sizeof(public_key_qx)); - CALByteReverseWord(public_key_qx, sizeof(public_key_qx)); + CALWordReverse(public_key_qx, sizeof(public_key_qx)/4); + CALByteReverseWord(public_key_qx, sizeof(public_key_qx)/4); /* get public key y point */ get_input_data((uint8_t*)&public_key_qy[0], sizeof(public_key_qy), read_public_key_qy, sizeof(read_public_key_qy)); /* adjust endianness */ - CALWordReverse(public_key_qy, sizeof(public_key_qy)); - CALByteReverseWord(public_key_qy, sizeof(public_key_qy)); + CALWordReverse(public_key_qy, sizeof(public_key_qy)/4); + CALByteReverseWord(public_key_qy, sizeof(public_key_qy)/4); } // validate that public key is on the curve diff --git a/user-crypto/miv-rv32-ecdsa-services/src/platform/LICENSE.md b/user-crypto/miv-rv32-ecdsa-services/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-ecdsa-services/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-key-agreement/.cproject b/user-crypto/miv-rv32-key-agreement/.cproject index c82262a..824be62 100644 --- a/user-crypto/miv-rv32-key-agreement/.cproject +++ b/user-crypto/miv-rv32-key-agreement/.cproject @@ -330,4 +330,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-key-agreement/.gitignore b/user-crypto/miv-rv32-key-agreement/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-key-agreement/.gitignore +++ b/user-crypto/miv-rv32-key-agreement/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-key-agreement/RV32_Key_agreement.ttl b/user-crypto/miv-rv32-key-agreement/Key_Agreement.ttl similarity index 99% rename from user-crypto/miv-rv32-key-agreement/RV32_Key_agreement.ttl rename to user-crypto/miv-rv32-key-agreement/Key_Agreement.ttl index e7381ff..9984f30 100644 --- a/user-crypto/miv-rv32-key-agreement/RV32_Key_agreement.ttl +++ b/user-crypto/miv-rv32-key-agreement/Key_Agreement.ttl @@ -3,7 +3,7 @@ ; and transmit delay in Serial port setup to 5msec/char and 5msec/line. ; 2. By default, Tera Term log will be stored in Tera Term installation Directory. changedir '.' -logopen "KEY_AGREEMENT.log" 0 0 0 1 +logopen "Key_Agreement.log" 0 0 0 1 settitle 'PolarFire User Crypto Key Agreement service' diff --git a/user-crypto/miv-rv32-key-agreement/README.md b/user-crypto/miv-rv32-key-agreement/README.md index 8ebd9be..9b76c71 100644 --- a/user-crypto/miv-rv32-key-agreement/README.md +++ b/user-crypto/miv-rv32-key-agreement/README.md @@ -1,5 +1,6 @@ -PolarFire User Crypto Key Agreement service -================================================================================ + +# PolarFire User Crypto Key Agreement Service + This example project demonstrates the use of the PolarFire User Crypto key agreement Services using the following functions @@ -13,24 +14,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -42,8 +42,7 @@ such as TeraTerm or Putty configured as follows: - no flow control. Run the example project using a debugger. A greeting message will appear over the -UART terminal.This program displays the return shared secret key data from User -Crypto processor. +UART terminal followed by a menu system and instructions. This example project demonstrates the use of User Cyrpto – key agreement service to derive the shared secret key. It is primarily used as a method of exchanging @@ -52,8 +51,8 @@ service reads the base value, modules, private key of user A, public key of user B, and derive the secret key, which can be used for encryption/decryption of data and also displayed on the UART terminal. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -65,7 +64,7 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a @@ -74,6 +73,7 @@ CoreUARTapb mapped to STDIO, etc. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -90,11 +90,11 @@ This application provides following settings as per CAL requirement {1230...0} as 0x12 0x3 and press return, this will be treated as byte0 = 0x12, byte1 = 0x30, byte2-127 = 0x00. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. You can use -RV32_Key_agreement.ttl Tera Term Macro script present in project directory for +Key_Agreement.ttl Tera Term Macro script present in project directory for testing key agreement example project. **NOTE:** @@ -105,10 +105,10 @@ testing key agreement example project. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -119,7 +119,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -131,14 +131,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-key-agreement/src/platform/LICENSE.md b/user-crypto/miv-rv32-key-agreement/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-key-agreement/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-keytree-services/.cproject b/user-crypto/miv-rv32-keytree-services/.cproject index d523f8c..cca99ef 100644 --- a/user-crypto/miv-rv32-keytree-services/.cproject +++ b/user-crypto/miv-rv32-keytree-services/.cproject @@ -330,4 +330,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-keytree-services/.gitignore b/user-crypto/miv-rv32-keytree-services/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-keytree-services/.gitignore +++ b/user-crypto/miv-rv32-keytree-services/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-keytree-services/README.md b/user-crypto/miv-rv32-keytree-services/README.md index 9faa683..60aa82c 100644 --- a/user-crypto/miv-rv32-keytree-services/README.md +++ b/user-crypto/miv-rv32-keytree-services/README.md @@ -1,5 +1,6 @@ -PolarFire User Crypto - Key Tree Services example -================================================================================ + +# PolarFire User Crypto - Key Tree Services Example + This example project demonstrates the use of following the PolarFire User Crypto Services functions: @@ -12,24 +13,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -52,8 +52,8 @@ function. The **CALKeyTree()** function derive a session key using a 128-bit or of this service is a eight 32-bit word that is stored in a user buffer as well displayed on the UART terminal. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -65,7 +65,7 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a @@ -74,6 +74,7 @@ CoreUARTapb mapped to STDIO, etc. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -83,11 +84,11 @@ This application provides following settings as per CAL requirement 2. A symbol INC_STDINT_H is defined in project preprocessor setting. For more detail, please refer to caltypes.h file present in CAL folder. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. You can use -miv-rv32-key-tree.ttl Tera Term Macro script present in project directory for +key-tree.ttl Tera Term Macro script present in project directory for testing keytree services example project. **NOTE:** @@ -105,10 +106,10 @@ testing keytree services example project. of CALKeyTree() function is check to determine key service is successful or not. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -119,7 +120,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -131,14 +132,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-keytree-services/miv-rv32-key-tree.ttl b/user-crypto/miv-rv32-keytree-services/key-tree.ttl similarity index 83% rename from user-crypto/miv-rv32-keytree-services/miv-rv32-key-tree.ttl rename to user-crypto/miv-rv32-keytree-services/key-tree.ttl index f7044de..db72f42 100644 --- a/user-crypto/miv-rv32-keytree-services/miv-rv32-key-tree.ttl +++ b/user-crypto/miv-rv32-keytree-services/key-tree.ttl @@ -4,9 +4,9 @@ ; 2. By default, Tera Term log will be stored in Tera Term installation Directory. changedir '.' -logopen "Cryptography.log" 0 0 0 1 +logopen "key-tree.log" 0 0 0 1 -settitle 'PolarFire User Crypto AES-128' +settitle 'PolarFire User Crypto Key Tree Service' setsync 1 @@ -25,15 +25,13 @@ send $0 ; --------------------------------------------------------------------------------------------------------------- ; KEY DERIVATION SERVICES ; --------------------------------------------------------------------------------------------------------------- -; --------------------------------------------------------------------------------------------------------------- - ; INPUT ; KEY = 2c82552b5e75eefbe716a1c377292232b2e281bd4d11060dfe3226218a0d4f8b ; NONCE = 46A85E18A798BE38010549CA17983E0D8B7DD1B55B953FB2321A1D66910EB3B0 ; OPTION = 1 ; OUTPUT -; SESSION_KEY = 8EA304523CD9E68D756451AE24A3B114 -; ␀ A75AEF0EA52483DC87AF2DAB422EA974 +; SESSION_KEY = 4DDD52C6509F4F10099743E76B400258 +; 23BC8D5BA10DBB3CFEC42ECACBB0562C ; --------------------------------------------------------------------------------------------------------------- ;key @@ -66,8 +64,6 @@ pause 2 ;select send path nonce send '2' -pause 2 - - +pause 2 logclose diff --git a/user-crypto/miv-rv32-keytree-services/src/platform/LICENSE.md b/user-crypto/miv-rv32-keytree-services/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-keytree-services/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-message-authentication/.cproject b/user-crypto/miv-rv32-message-authentication/.cproject index ba31722..fcd80e0 100644 --- a/user-crypto/miv-rv32-message-authentication/.cproject +++ b/user-crypto/miv-rv32-message-authentication/.cproject @@ -330,4 +330,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-message-authentication/.gitignore b/user-crypto/miv-rv32-message-authentication/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-message-authentication/.gitignore +++ b/user-crypto/miv-rv32-message-authentication/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-message-authentication/README.md b/user-crypto/miv-rv32-message-authentication/README.md index 2620ff3..ef6fb3c 100644 --- a/user-crypto/miv-rv32-message-authentication/README.md +++ b/user-crypto/miv-rv32-message-authentication/README.md @@ -1,5 +1,6 @@ -PolarFire User Crypto - Message Authentication And Hash Service Example -================================================================================ + +# PolarFire User Crypto - Message Authentication and Hash Service Example + This example project demonstrates the use of the following PolarFire User Crypto Services functions: @@ -23,24 +24,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -54,11 +54,11 @@ such as TeraTerm or Putty configured as follows: Run the example project using a debugger. A greeting message will appear over the UART terminal followed by a menu system and instructions. -This program displays the return data from User Crypto processor for message -authentication and hash service. +This program displays the return data from User Crypto processor for encryption +and decryption services. + +## fpga_design_config (formerly known as hw_config.h) -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -70,7 +70,7 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a @@ -78,47 +78,51 @@ CoreUARTapb mapped to STDIO, etc. ### Data Authenticated Encryption Using AES 256-bit key -Select option '1' to perform authenticated encryption using Galois/counter mode (GCM) -algorithm. This example project reads the 256 bit key, IV, 16 bytes plain text, -and additional authentication data (AAD) from UART terminal and calls the -**CALSymEncAuth()** or **CALSymEncAuthDMA()** function. This function performs -authenticated encryption with associated data for confidentiality and integrity. -The plain text is both encrypted and used in computation of message -authentication code according to the **SATSYMTYPE_AES256** encryption algorithm and -GCM mode. Both the encrypted data and tag are displayed on UART terminal. +Select option '1' to perform authenticated encryption using Galois/counter mode +(GCM) algorithm. This example project reads the 256 bit key, IV, 16 bytes +plain text, and additional authentication data (AAD) from UART terminal and +calls the **CALSymEncAuth()** or **CALSymEncAuthDMA()** function. This function +performs authenticated encryption with associated data for confidentiality and +integrity. The plain text is both encrypted and used in computation of message +authentication code according to the **SATSYMTYPE_AES256** encryption algorithm +and GCM mode. Both the encrypted data and tag are displayed on UART terminal. -**NOTE** -: +**NOTE**: In Case of GCM, in place of IV paramter user has to pass JO value which is calculated - according to the algorithm - mentioned in the following document. - [document](http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf) - -Generate MAC Using **HMACSHA-256** Algorithms -Press 2 to calculate message authentication code using HMAC SHA-256 algorithms. -This example project reads the key and message from UART terminal and calls the -**CALMAC()** or **CALMACDMA()** function. The **CALMAC()** and **CALMACDMA()** functions -calculate the MAC for the message based on SHA256 algorithm and the secret key. -The calculated MAC is also displayed on UART terminal. - -Generate MAC Using AES-CMAC-256 Algorithms -Press 3 to calculated message authentication code using AES-CMAC-256 algorithms. -This example project reads the key and message from UART terminal and calls -the CALMAC function. The **CALMAC()** functions calculates the MAC for the message -based on AES CMAC 256 algorithm and the secret key. The calculated MAC is also -displayed on UART terminal. -NOTE: - MAC computation using DMA (i.e. **CALMACDMA** function) doesn’t support - **AES-CMAC-256** Algorithm. - -Hashing -Press 4 to perform hashing. This service reads 64 bytes of message value and -performs the hash operation using SHA-256 hash algorithm on the stored data. -The hash results are stored at user memory location and also displayed on UART + according to the algorithm mentioned in the following [document.](http://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf) + +### Generate MAC Using **HMACSHA-256** Algorithms + +Select option '2' to calculate message authentication code using HMAC SHA-256 +algorithms. This example project reads the key and message from UART terminal +and calls the **CALMAC()** or **CALMACDMA()** function. The **CALMAC()** and +**CALMACDMA()** functions calculate the MAC for the message based on SHA256 +algorithm and the secret key. The calculated MAC is also displayed on UART terminal. +### Generate MAC Using AES-CMAC-256 Algorithms + +Select option '3' to calculated message authentication code using AES-CMAC-256 +algorithms. This example project reads the key and message from UART terminal +and calls the CALMAC function. The **CALMAC()** functions calculates the MAC for +the message based on AES CMAC 256 algorithm and the secret key. The calculated +MAC is also displayed on UART terminal. + +**NOTE**: + MAC computation using DMA (i.e. **CALMACDMA** function) doesn’t support + **AES-CMAC-256** Algorithm. + +### Hashing + +Select option '4' to perform hashing. This service reads 64 bytes of message +value and performs the hash operation using SHA-256 hash algorithm on the stored +data. The hash results are stored at user memory location and also displayed on +UART terminal. + ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -135,7 +139,7 @@ This application provides following settings as per CAL requirement {1230...0} as 0x12 0x3 and press return, this will be treated as byte0 = 0x12, byte1 = 0x30, byte2-127 = 0x00. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. @@ -156,10 +160,10 @@ services. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -170,7 +174,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -182,14 +186,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-message-authentication/src/application/main.c b/user-crypto/miv-rv32-message-authentication/src/application/main.c index e787166..479eb71 100644 --- a/user-crypto/miv-rv32-message-authentication/src/application/main.c +++ b/user-crypto/miv-rv32-message-authentication/src/application/main.c @@ -57,8 +57,8 @@ const uint8_t g_greeting_msg[] = ************* PolarFire User Crypto Example Project **************************\r\n\ ******************************************************************************\r\n\ This example project demonstrates the use of the User Crypto Message \r\n\ - authentication services and hash services. The following User Crypto service\r\n\ - are demonstrated:\r\n\ + authentication services and hash services. The following User Crypto service are\r\n\ + demonstrated:\r\n\ 1 - Galois/Counter Mode, GCM Message Authentication.\r\n\ 2 - Message authentication code - HMAC-SHA-256.\r\n\ 3 - Message authentication code - AES-CMAC-256.\r\n\ diff --git a/user-crypto/miv-rv32-message-authentication/src/platform/LICENSE.md b/user-crypto/miv-rv32-message-authentication/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-message-authentication/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-ndrbg-services/.cproject b/user-crypto/miv-rv32-ndrbg-services/.cproject index e0d068b..0939065 100644 --- a/user-crypto/miv-rv32-ndrbg-services/.cproject +++ b/user-crypto/miv-rv32-ndrbg-services/.cproject @@ -331,4 +331,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-ndrbg-services/.gitignore b/user-crypto/miv-rv32-ndrbg-services/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-ndrbg-services/.gitignore +++ b/user-crypto/miv-rv32-ndrbg-services/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-ndrbg-services/README.md b/user-crypto/miv-rv32-ndrbg-services/README.md index 1075dc2..65e3b03 100644 --- a/user-crypto/miv-rv32-ndrbg-services/README.md +++ b/user-crypto/miv-rv32-ndrbg-services/README.md @@ -1,5 +1,6 @@ -PolarFire User Crypto DRBG Services example -================================================================================ + +# PolarFire User Crypto DRBG Services Example + This example project demonstrates the use of PolarFire User Crypto deterministic random bit generator using functions: @@ -14,24 +15,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -51,8 +51,8 @@ number. Press "d" to un-instantiate the currently instantiated DRBG. Please note that you will not be able to generate random numbers once the DRBG instance has been un-instantiates DRBG service. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -64,7 +64,7 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a @@ -73,6 +73,7 @@ CoreUARTapb mapped to STDIO, etc. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -89,11 +90,10 @@ This application provides following settings as per CAL requirement {1230...0} as 0x12 0x3 and press return, this will be treated as byte0 = 0x12, byte1 = 0x30, byte2-127 = 0x00. +## Target Hardware -## Target hardware - -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -104,7 +104,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -116,14 +116,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-ndrbg-services/src/platform/LICENSE.md b/user-crypto/miv-rv32-ndrbg-services/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-ndrbg-services/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-rsa-cryptography/.cproject b/user-crypto/miv-rv32-rsa-cryptography/.cproject index 507c5ba..b3f0388 100644 --- a/user-crypto/miv-rv32-rsa-cryptography/.cproject +++ b/user-crypto/miv-rv32-rsa-cryptography/.cproject @@ -330,4 +330,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-rsa-cryptography/.gitignore b/user-crypto/miv-rv32-rsa-cryptography/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-rsa-cryptography/.gitignore +++ b/user-crypto/miv-rv32-rsa-cryptography/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-rsa-cryptography/README.md b/user-crypto/miv-rv32-rsa-cryptography/README.md index 11ac2e2..22208a8 100644 --- a/user-crypto/miv-rv32-rsa-cryptography/README.md +++ b/user-crypto/miv-rv32-rsa-cryptography/README.md @@ -1,6 +1,6 @@ -PolarFire User Crypto RSA Encyption/Deryption Services example -================================================================================ +# PolarFire User Crypto RSA Encyption/Deryption Services Example + This example project demonstrates the use of the PolarFire RSA service to encrypt and decrypt the message. The following User Athena service are used: @@ -14,24 +14,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -56,8 +55,8 @@ RSA involves a public key and private key. The public key can be known to everyone, it is used to encrypt messages. Messages encrypted using the public key can only be decrypted with the private key. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -69,7 +68,7 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a @@ -90,12 +89,13 @@ This service decrypt the message based on private key. This service performs an RSA private key decryption operation with CRT and SCA countermeasures on the data buffer. This example project will read the cipher text, private key (n & d), public key(n & e), private prime modulus i.e. P modulus and q modulus from UART -terminal and computes the plain text corresponding to m = c^d mod n = m^(de) mod n +terminal and computes the plain text corresponding to m = c^d mod n = m^(de) mod n. The computed plain text is displayed on UART terminal. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -112,11 +112,11 @@ This application provides following settings as per CAL requirement {1230...0} as 0x12 0x3 and press return, this will be treated as byte0 = 0x12, byte1 = 0x30, byte2-127 = 0x00. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. You can use -RV32_RSA_cryptography.ttl Tera Term Macro script present in project directory for +RSA_Cryptography.ttl Tera Term Macro script present in project directory for testing rsa cryptography example project. **NOTE:** @@ -127,10 +127,10 @@ testing rsa cryptography example project. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -141,7 +141,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -153,14 +153,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-rsa-cryptography/RV32_RSA_cryptography.ttl b/user-crypto/miv-rv32-rsa-cryptography/RSA_Cryptography.ttl similarity index 99% rename from user-crypto/miv-rv32-rsa-cryptography/RV32_RSA_cryptography.ttl rename to user-crypto/miv-rv32-rsa-cryptography/RSA_Cryptography.ttl index f6f702a..f0a1e1d 100644 --- a/user-crypto/miv-rv32-rsa-cryptography/RV32_RSA_cryptography.ttl +++ b/user-crypto/miv-rv32-rsa-cryptography/RSA_Cryptography.ttl @@ -4,7 +4,7 @@ ; 2. By default, Tera Term log will be stored in Tera Term installation Directory. changedir '.' -logopen "RSA_CRYPTO.log" 0 0 0 1 +logopen "RSA_Cryptography.log" 0 0 0 1 settitle 'PolarFire User Crypto RSA Crypto service' diff --git a/user-crypto/miv-rv32-rsa-cryptography/src/platform/LICENSE.md b/user-crypto/miv-rv32-rsa-cryptography/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-rsa-cryptography/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE. diff --git a/user-crypto/miv-rv32-rsa-services/.cproject b/user-crypto/miv-rv32-rsa-services/.cproject index 1be698d..de43996 100644 --- a/user-crypto/miv-rv32-rsa-services/.cproject +++ b/user-crypto/miv-rv32-rsa-services/.cproject @@ -330,4 +330,4 @@ - \ No newline at end of file + diff --git a/user-crypto/miv-rv32-rsa-services/.gitignore b/user-crypto/miv-rv32-rsa-services/.gitignore index f1b6b72..4d0cf27 100644 --- a/user-crypto/miv-rv32-rsa-services/.gitignore +++ b/user-crypto/miv-rv32-rsa-services/.gitignore @@ -1,3 +1,3 @@ /.settings/ /*miv-rv32-imc-debug*/ -/*miv-rv32-imc-release*/ \ No newline at end of file +/*miv-rv32-imc-release*/ diff --git a/user-crypto/miv-rv32-rsa-services/README.md b/user-crypto/miv-rv32-rsa-services/README.md index 015d2d6..c01b7b3 100644 --- a/user-crypto/miv-rv32-rsa-services/README.md +++ b/user-crypto/miv-rv32-rsa-services/README.md @@ -1,6 +1,7 @@ -PolarFire User Crypto RSA Services example -================================================================================ -This Example Project demonstrates the usage of the User Crypto hardware block for + +# PolarFire User Crypto RSA Services Example + +This example project demonstrates the usage of the user crypto hardware block for the signature generation and verification using RSA service functions: - CALRSASignHash() is used to generate digital signature. @@ -13,24 +14,23 @@ The following configurations are provided with the example: - miv-rv32-imc-debug - miv-rv32-imc-release -Mi-V Soft Processor --------------------------------------------------------------------------------- -This example uses Mi-V SoftProcessor MiV_RV32.The design is built for debugging -MiV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. +## Mi-V Soft Processor + +This example uses Mi-V SoftProcessor MIV_RV32.The design is built for debugging +MIV_RV32 through the PolarFire FPGA programming JTAG port using a FlashPro5. To achieve this the CoreJTAGDebug IP is used to connect to the JTAG port of the -MiV_RV32. +MIV_RV32. All the platform/design specific definitions such as peripheral base addresses, -system clock frequency etc. are included in fpga_design_config.h. The -fpga_design_config.h is located at the root folder of this project. +system clock frequency etc. are included in fpga_design_config.h. -The Mi-V Soft Processor MiV_RV32 firmware projects needs the miv_rv32_hal and +The Mi-V Soft Processor MIV_RV32 firmware projects needs the MIV_RV32 HAL and the hal firmware(RISC-V HAL). -The RISC-V HAL is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). +The hal is available at GitHub [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/platform). -How to use this example --------------------------------------------------------------------------------- +## How to use this example + This example project is targeted at a MIV_RV32 design running on a PolarFire-Eval-Kit connected via a USB-UART serial cable to a host PC running a terminal emulator such as TeraTerm or Putty configured as follows: @@ -48,8 +48,8 @@ to select the options as shown over the serial port. This program displays the return data from User Crypto processor for digital signature generation and verification services. -fpga_design_config (formerly known as hw_config.h) --------------------------------------------------------------------------------- +## fpga_design_config (formerly known as hw_config.h) + The SoftConsole project targeted for Mi-V processors now use an improved directory structure. The fpga_design_config.h must be stored as shown below @@ -61,13 +61,13 @@ Currently, this file must be hand crafted when using the Mi-V Soft Processor. In future, all the design and soft IP configurations will be automatically generated from the Libero design description data. -You can use the sample file provided with MIV_RV32 HAL as an example. Rename it +You can use the sample file provided with miv_rv32_hal as an example. Rename it from sample_fpga_design_config.h to fpga_design_config.h and then customize it per your hardware design such as SYS_CLK_FREQ, peripheral BASE addresses, interrupt numbers, definition of MSCC_STDIO_UART_BASE_ADDR if you want a CoreUARTapb mapped to STDIO, etc. -### Generate digital signature +### Generate Digital Signature Select 1 to generate digital signature for RSA public-key cryptography service. This example project reads the message, hash type, RSA encoding, and private @@ -77,7 +77,7 @@ cryptography on the hash produced using the RSA encoding type. After successful completion, displays a success message along with the generated signature or displays a failure message. -### Verify digital signature: +### Verify Digital Signature: Select 2 to verify digital signature for RSA public-key cryptography service. This example project reads the message, hash type, RSA encoding, public key, @@ -90,6 +90,7 @@ along with the generated signature or displays a failure message. ### Configurations The CAL library needs a config_user.h containing the configuration data. + This application provides following settings as per CAL requirement 1. A variable which provides the base address of the User Crypto hardware block is defined in main.c @@ -106,11 +107,11 @@ This application provides following settings as per CAL requirement {1230...0} as 0x12 0x3 and press return, this will be treated as byte0 = 0x12, byte1 = 0x30, byte2-127 = 0x00. -### Test script +### Test Script A test script is provided with this example which automatically enters the NIST vectors and associated data to verify the functionality. You can use -RV32_RSA_services.ttl Tera Term Macro script present in project directory for +rsa_services.ttl Tera Term Macro script present in project directory for testing RSA Signature Services example project. **NOTE:** @@ -121,10 +122,10 @@ testing RSA Signature Services example project. to 5msec/char and 5msec/line. 3. By default, Tera Term log will be stored in Tera Term installation Directory. -## Target hardware +## Target Hardware -This project was tested on PolarFire-Eval-Kit with CFG4 configuration of the -MIV_RV32 design available [here](https://github.com/Mi-V-Soft-RISC-V/PolarFire-Eval-Kit/tree/main/Libero_Projects) +This project is tested on PolarFire-Eval-Kit with CFG4 configuration of the +MIV_RV32 base design available at github [Mi-V-Soft-RISC-V](https://mi-v-ecosystem.github.io/redirects/repo-polarfire-evaluation-kit-mi-v-sample-fpga-designs) All the design specific definitions such as peripheral base addresses, system clock frequency etc. are included in fpga_design_config.h. @@ -135,7 +136,7 @@ This example project can be used with another design using a different hardware configurations. This can be achieved by overwriting the content of this example project's "fpga_design_config.h" file with the correct data per your Libero design. -### Booting the system +### Booting the System Currently the example project is configured to use FlashPro debugger to execute from LSRAM in both Debug and Release mode. @@ -147,14 +148,12 @@ Tool Settings > Cross RISCV GNU Create Flash Image > General > Other flags. This will allow you to attach the release mode executable as the memory initialization client in Libero when you want to execute it from non-volatile memory. -## Silicon revision dependencies +## Silicon Revision Dependencies This example is tested on PolarFire MPF300TS device. -### CAL library src - -To obtain the CAL source code and a SoftConsole project to generate the CAL -library archive file (*.a) refer [SoftConsole Documentation](https://mi-v-ecosystem.github.io/SoftConsole-Documentation/SoftConsole-v2021.3/using_softconsole/other.html#crypto-application-library). -The CAL source code is bound by license agreement and it will be available as -part of the SoftConsole installation if the CAL specific license was agreed -while installing it. \ No newline at end of file +### CAL Library Src + +The CAL source code is bound by license agreement. If you need access to the CAL +source code, please contact FPGA_marketing@microchip.com for further details on +NDA requirements. \ No newline at end of file diff --git a/user-crypto/miv-rv32-rsa-services/rsa_services.ttl b/user-crypto/miv-rv32-rsa-services/rsa_services.ttl index 2e1d26a..bf6914f 100644 --- a/user-crypto/miv-rv32-rsa-services/rsa_services.ttl +++ b/user-crypto/miv-rv32-rsa-services/rsa_services.ttl @@ -4,7 +4,7 @@ ; 2. By default, Tera Term log will be stored in Tera Term installation Directory. changedir '.' -logopen "RSAservice.log" 0 0 0 1 +logopen "rsa_services.log" 0 0 0 1 settitle 'PolarFire SoC MSS User Crypto RSA service' diff --git a/user-crypto/miv-rv32-rsa-services/src/application/main.c b/user-crypto/miv-rv32-rsa-services/src/application/main.c index 25a4580..a437758 100644 --- a/user-crypto/miv-rv32-rsa-services/src/application/main.c +++ b/user-crypto/miv-rv32-rsa-services/src/application/main.c @@ -1,4 +1,3 @@ - /******************************************************************************* * Copyright 2019 Microchip FPGA Embedded Systems Solutions. * diff --git a/user-crypto/miv-rv32-rsa-services/src/platform/LICENSE.md b/user-crypto/miv-rv32-rsa-services/src/platform/LICENSE.md new file mode 100644 index 0000000..f2e6956 --- /dev/null +++ b/user-crypto/miv-rv32-rsa-services/src/platform/LICENSE.md @@ -0,0 +1,26 @@ +# The Mi-V soft processor Platform Software License + +The Mi-V soft processor Platform Software is released under the following +software license: + + Copyright 2019 Microchip Corporation. + + SPDX-License-Identifier: MIT + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + IN THE SOFTWARE.