hdcp22_common: hmac.c File Reference

| hdcp22_common Xilinx SDK Drivers API Documentation

- Overview
- APIs
- File List

Macros | Functions
hmac.c File Reference

## Overview

This file contains the implementation of the HMAC Hash Message Authentication Code.

     MODIFICATION HISTORY:

     Ver   Who  Date     Changes

     1.00  MH   10/30/15 First Release

## Macros
#define | SHA256_SIZE 256/8
| SHA256 Hash size. More...

## Functions
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...

## Macro Definition Documentation

#define SHA256_SIZE 256/8

SHA256 Hash size.

Referenced by XHdcp22Cmn_HmacSha256Hash().

## Function Documentation

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().