# RSA Driver

Linux RSA Driver for Zynq Ultrascale+ MPSoC

# Table of Contents

# Introduction

The Zynq UltraScale+ MPSoC includes an RSA accelerator to facilitate the RSA authentication process. This block performs the modulus math based on Rivest-Shamir-Adelman (RSA)-4096 algorithm. It is an asymmetric algorithm.

The RSA Linux driver is used for Authentication of Data blobs, where the data is encrypted with public key and encrypted data is decrypted with private key. The RSA terminology is explained by below table.

Operation | Key Used / Algorithm | Reason |

Signature Generation | Private Key / ALG_OP_DECRYPT | Only a signature authority should hold the secret (private) key. |

Signature Verification | Public Key / ALG_OP_ENCRYPT | Anyone should be able to verify a signature so the public key can be handed out freely. Additionally, signatures cannot be created with the public key. |

Data Encryption | Public Key / ALG_OP_ENCRYPT | Anyone should be able to encrypt data to send to someone that holds their own private key. No one can decrypt the data using the public key so the key is safe to hand out. |

Data Decryption | Private Key / ALG_OP_DECRYPT | Only the receiver of data should hold the secret (private) key in order to decrypt the data. |

# HW IP Features

- Supports Asymmetric algorithm.

## Features supported in driver

- Supports Asymmetric algorithm.

Note: Exponentiation value is an optional to the RSA core and core has inbuilt support to calculate this value. So from Linux driver Key components modulus and exponent only to be provided, whereas in bare metal driver user has an option.

# Kernel Configuration

# Devicetree

# Test Procedure

Cross compile the below example and Need to create the executable file to test the RSA functionality.**AF ALG Decrypt demo example (RSA)**

**AF ALG Encrypt demo example (RSA)**

# Expected Output

Please note as the data provided in user space will be located in virtual space, Linux driver before handing off to ATF converts the data buffers to physical address.

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/crypto/zynqmp-rsa.c

# Mainline status

- This driver is currently not available in mainline kernel.

# Change Log

**2017.3****Summary**- crypto: zynqmp-rsa: Adopted RSA support for ZynqMP SoC

**Commits**- f0cad69crypto: zynqmp-rsa: Adopted RSA support for ZynqMP SoC

**2017.4**- None.

**2018.1****None**

# Related Links

https://github.com/Xilinx/linux-xlnx/blob/master/drivers/crypto/zynqmp-rsa.c