⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crypt_util.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
字号:
// $Header: /I76/I76_Common/I76_Reference/Playcore/Nav_Clips/AviDrm/LibDrmCommon/crypt_util.c 1     20/01/04 12:15 Lotan $
// Copyright (c) 2003 DivXNetworks, Inc. http://www.divxnetworks.com
// All rights reserved.
//
// This software is the confidential and proprietary information of DivxNetworks
// Inc. ("Confidential Information").  You shall not disclose such Confidential
// Information and shall use it only in accordance with the terms of the license
// agreement you entered into with DivXNetworks, Inc.

#include "Playcore\Nav_Clips\AviDrm\libDrmCommon\crypt_util.h"

#ifdef AVI_DRM_SUPPORT

int crypt_util_make_key(unsigned char *keydata, int direction, keyInstance *key, int keyLength)
{
	int index=0;
	char buffer[100];

	for(index=0; index < keyLength; index++)
	{
		sprintf(&buffer[2*index], "%02X", keydata[index]);
	}

	if(!makeKey(key, direction, keyLength*8, buffer))
	{
		return -1;
	}

	return 1;
}
// <<< Robin_0915_2004
#ifndef AVI_DRM_OPTIMIZATION
void crypt_util_encrypt(cipherInstance * cipher, keyInstance *key, unsigned char *clearBuffer, int clearBufferSize, unsigned char *encryptedBuffer, int * encryptedBufferSize )
{

	*encryptedBufferSize = blockEncrypt(cipher, key, clearBuffer, clearBufferSize*8, encryptedBuffer);
	*encryptedBufferSize = (*encryptedBufferSize)/8;
}
#endif
// >>> Robin_0915_2004

void crypt_util_decrypt(cipherInstance * cipher, keyInstance *key, unsigned char *encryptedBuffer, int encryptedBufferSize, unsigned char *clearBuffer, int * clearBufferSize )
{

	*clearBufferSize = blockDecrypt(cipher, key, encryptedBuffer, encryptedBufferSize*8, clearBuffer);

	*clearBufferSize = (*clearBufferSize)/8;
}

#endif // AVI_DRM_SUPPORT

⌨️ 快捷键说明

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