dp14txss
Vitis Drivers API Documentation
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
Inputis the 16 byte ciphertext
Keyis the user supplied input key
Outputis 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
Inputis the 16 byte plaintext
Keyis the user supplied input key
Outputis 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
Datais the input data.
DataSizeis the size of the data buffer.
Keyis the hash-key to use.
KeySizeis the size of the hash key.
HashedDatais 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
Datais the data on which a hash is calculated.
DataSizeis the size of the data array..
HashedDatais a 256-bits size hash.
Returns
None.
Note
None.

Referenced by XHdcp22Cmn_HmacSha256Hash().