| v_hdmirxss Vitis Drivers API Documentation

- Overview
- Data Structures
- APIs
- File List
- Examples

Functions
xhdcp22_common.h File Reference

## Overview

This file contains common functions shared between HDCP22 drivers.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes

     1.00  MH   10/30/15 First Release.
     1.01  MH   01/15/16 Added prefix to function names.

## Functions
void | XHdcp22Cmn_Sha256Hash (const u8 *Data, u32 DataSize, u8 *HashedData)
| This function computes a SHA256 hash on a array of data. More...
int | XHdcp22Cmn_HmacSha256Hash (const u8 *Data, int DataSize, const u8 *Key, int KeySize, u8 *HashedData)
| This function does a HMAC_SHA256 transform: SHA256(K XOR opad, SHA256(K XOR ipad, text)) More...
void | XHdcp22Cmn_Aes128Encrypt (const u8 *Data, const u8 *Key, u8 *Output)
| This function encrypts 128 bits data with a key of size 128 bits. More...
void | XHdcp22Cmn_Aes128Decrypt (const u8 *Data, const u8 *Key, u8 *Output)
| This function encrypts 128 bits data with a key of size 128 bits. More...

## Function Documentation

void XHdcp22Cmn_Aes128Decrypt | ( | const u8 * | Data,
|  | const u8 * | Key,
|  | u8 * | Output
| ) |  |

This function encrypts 128 bits data with a key of size 128 bits.

Parameters

  Input | is the 16 byte ciphertext
  Key | is the user supplied input key
  Output | is the 16 byte plaintext

Returns
  None.

Note
  None.

void XHdcp22Cmn_Aes128Encrypt | ( | const u8 * | Data,
|  | const u8 * | Key,
|  | u8 * | Output
| ) |  |

This function encrypts 128 bits data with a key of size 128 bits.

Parameters

  Input | is the 16 byte plaintext
  Key | is the user supplied input key
  Output | is the 16 byte ciphertext

Returns
  None.

Note
  None.

int XHdcp22Cmn_HmacSha256Hash | ( | const u8 * | Data,
|  | int | DataSize,
|  | const u8 * | Key,
|  | int | KeySize,
|  | u8 * | HashedData
| ) |  |

This function does a HMAC_SHA256 transform: SHA256(K XOR opad, SHA256(K XOR ipad, text))

ipad is the byte 0x36 repeated 64 times opad is the byte 0x5c repeated 64 times and text is the data being protected

Parameters

  Data | is the input data.
  DataSize | is the size of the data buffer.
  Key | is the hash-key to use.
  KeySize | is the size of the hash key.
  HashedData | is the output of this function.

Returns
  - XST_SUCCESS if no errors occured
  - XST_FAILURE if the datasize execeeds the size of the local buffer.

Note
  None.

References SHA256_SIZE, and XHdcp22Cmn_Sha256Hash().

void XHdcp22Cmn_Sha256Hash | ( | const u8 * | Data,
|  | u32 | DataSize,
|  | u8 * | HashedData
| ) |  |

This function computes a SHA256 hash on a array of data.

Parameters

  Data | is the data on which a hash is calculated.
  DataSize | is the size of the data array..
  HashedData | is a 256-bits size hash.

Returns
  None.

Note
  None.

Referenced by XHdcp22Cmn_HmacSha256Hash().