Skip to content

Commit

Permalink
Merged applications source code version main.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lavakrishna Dussa authored and Lavakrishna Dussa committed Sep 15, 2023
2 parents 6988233 + 6d4ac89 commit eda7139
Show file tree
Hide file tree
Showing 52 changed files with 901 additions and 658 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,4 +330,4 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>
</cproject>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/.settings/
/*miv-rv32-imc-debug*/
/*miv-rv32-imc-release*/
/*miv-rv32-imc-release*/
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ send $0
; ---------------------------------------------------------------------------------------------------------------
;Test Case 1 - using DMA
; INPUT
; COUNT = 0
; KEY = c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558
; PLAINTEXT = 00000000000000000000000000000000
; OUTPUT
Expand All @@ -40,7 +39,7 @@ pause 1
send 'c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558'
pause 1

;IV
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1

Expand All @@ -59,7 +58,6 @@ send $0
; ---------------------------------------------------------------------------------------------------------------
;Test Case 2 - non DMA
; INPUT
; COUNT = 0
; KEY = c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558
; PLAINTEXT = 00000000000000000000000000000000
; OUTPUT
Expand All @@ -72,7 +70,7 @@ pause 1
send 'c47b0294dbbbee0fec4757f22ffeee3587ca4730c3d33b691df38bab076bc558'
pause 1

;IV
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1

Expand Down Expand Up @@ -103,7 +101,7 @@ pause 1
send '0000000000000000000000000000000000000000000000000000000000000000'
pause 1

;IV
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1

Expand Down Expand Up @@ -134,7 +132,7 @@ pause 1
send '0000000000000000000000000000000000000000000000000000000000000000'
pause 1

;IV
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1

Expand Down Expand Up @@ -166,7 +164,7 @@ pause 1
send '1d85a181b54cde51f0e098095b2962fdc93b51fe9b88602b3f54130bf76a5bd9'
pause 1

;IV
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1

Expand Down Expand Up @@ -200,7 +198,7 @@ pause 1
send '28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64'
pause 1

;IV
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1

Expand Down Expand Up @@ -231,7 +229,7 @@ pause 1
send '28d46cffa158533194214a91e712fc2b45b518076675affd910edeca5f41ac64'
pause 1

;IV
;Initialization Vector(IV)
send '00000000000000000000000000000000'
pause 1

Expand Down
61 changes: 30 additions & 31 deletions applications/user-crypto/miv-rv32-aes-cryptography/README.md
Original file line number Diff line number Diff line change
@@ -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()
Expand All @@ -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:
Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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:**
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
### 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.
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down Expand Up @@ -317,4 +317,4 @@ int main( void )
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion applications/user-crypto/miv-rv32-ccm-services/.cproject
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,4 @@
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>
</cproject>
2 changes: 1 addition & 1 deletion applications/user-crypto/miv-rv32-ccm-services/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
/.settings/
/*miv-rv32-imc-debug*/
/*miv-rv32-imc-release*/
/*miv-rv32-imc-release*/
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down
Loading

0 comments on commit eda7139

Please sign in to comment.