drmaes.h

来自「本程序为ST公司开发的源代码」· C头文件 代码 · 共 143 行

H
143
字号
/**@@@+++@@@@********************************************************************** Microsoft Windows Media** Copyright (C) Microsoft Corporation. All rights reserved.*****@@@---@@@@*******************************************************************//* * DrmAes.h * * Header file for AES encryption of a single block sized buffer * * Each OEM is expected to implement its own version of these routines. * */#ifndef _DRMAES_H_#define _DRMAES_H_#ifdef  __cplusplusextern "C"{#endif#include "drmcommon.h"/* * Constants */#define DRM_AES_BLOCKLEN    (16) /* Size (in bytes) of a single encrypted/decrypted block */#define DRM_AES_KEYSIZE_128 (16) /* Size (in bytes) of a 128 bit key *//* * AES secret key * * The actual contents of the structure is opaque. * * The opaque data is represented as a signle byte array below. * Don't access the array or assume the size of this structure. */typedef struct {    DRM_BYTE opaque[1];} DRM_AES_KEY;/* * Encrypt versus Decrypt enum */typedef enum _DRM_AES_ENCRYPT_OPTION{    DRM_AES_DECRYPT = 0,    DRM_AES_ENCRYPT = 1,} DRM_AES_ENCRYPT_OPTION;/* * The DrmAesSetKey routine allocates an AES secret key given the value of the key * * The returned opaque secret key structure is used as a parameter to all of the * other AES encryption routines. * * Parameters: * *      pbKey - Specifies the value of the key *          Only 128-bit, 192-bit, and 256-bit keys are supported * *      cbKey - Specifies the size (in bytes) of the key * * Return Value: *      A pointer to the allocated secret key. *      The returned key must be freed using DrmAesDeleteKey(). */DRM_AES_KEY *OEM_DrmAesSetKey(    IN DRM_BYTE *pbKey,    IN DRM_DWORD cbKey    );/* * The DrmAesDeleteKey routine deletes an AES secret key * * Parameters: * *      pKey - Specifies the key to delete * * Return Value: *      None */DRM_VOIDOEM_DrmAesDeleteKey(    IN DRM_AES_KEY *pKey    );/* * The DrmAesKeySize routine returns the size in bytes of the AES secret key * * Note, this size is the size of the key and not the size of the passed in DRM_AES_KEY structure. * * Parameters: * *      pKey - Specifies the AES secret key to determine the size of * * Return Value: *  The key size in bytes. */DRM_DWORDOEM_DrmAesKeySize(    IN DRM_AES_KEY *pKey    );/* * The DrmAesOne routine does one round of AES encryption or decryption * * Parameters: * *      pKey - Specifies the AES secret key used to encrypt or decrypt buffer * *      pbOut - Returns the encrypted data. *          The returned data is DRM_AES_BLOCKLEN bytes long * *      pbIn - Specifies the data to encrypt. *          The specified data is DRM_AES_BLOCKLEN bytes long. * *      Op - Specifies whether encryption or decryption should be done * * Return Value: *      None */DRM_VOIDOEM_DrmAesOne(    IN DRM_AES_KEY *pKey,    OUT DRM_BYTE pbOut[DRM_AES_BLOCKLEN],    IN DRM_BYTE pbIn[DRM_AES_BLOCKLEN],    IN DRM_AES_ENCRYPT_OPTION Op    );#ifdef  __cplusplus}#endif#endif /* _DRMAES_H_ */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?