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

📄 turing.h

📁 au1200 linux2.6.11 硬件解码mae驱动和maiplayer播放器源码
💻 H
字号:
/* @(#)Turing.h	1.4 (QUALCOMM) 03/02/24 *//* * Interface definition of Turing * * Copyright C 2002, Qualcomm Inc. Written by Greg Rose *//*This software is free for commercial and non-commercial use subject tothe following conditions:1.  Copyright remains vested in QUALCOMM Incorporated, and Copyrightnotices in the code are not to be removed.  If this package is used ina product, QUALCOMM should be given attribution as the author of theTuring encryption algorithm. This can be in the form of a textualmessage at program startup or in documentation (online or textual)provided with the package.2.  Redistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditions aremet:a. Redistributions of source code must retain the copyright notice,   this list of conditions and the following disclaimer.b. Redistributions in binary form must reproduce the above copyright   notice, this list of conditions and the following disclaimer in the   documentation and/or other materials provided with the   distribution.c. All advertising materials mentioning features or use of this   software must display the following acknowledgement:  This product   includes software developed by QUALCOMM Incorporated.3.  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIEDWARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OFMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND AGAINSTINFRINGEMENT ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR ORCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ORPROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OFLIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGNEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.4.  The license and distribution terms for any publically available versionor derivative of this code cannot be changed, that is, this code cannotsimply be copied and put under another distribution license includingthe GNU Public License.5.  The Turing family of encryption algorithms are covered by patents inthe United States of America and other countries. A free andirrevocable license is hereby granted for the use of such patents tothe extent required to utilize the Turing family of encryptionalgorithms for any purpose, subject to the condition that anycommercial product utilising any of the Turing family of encryptionalgorithms should show the words "Encryption by QUALCOMM" either on theproduct or in the associated documentation.*/#ifndef TURING_H#define TURING_H 1typedef unsigned char	TURING_BYTE;typedef unsigned long	TURING_WORD;#define MAXKEY	    32 /*bytes*/#define MAXKIV	    48 /*bytes*/#define MAXSTREAM   340 /* bytes, maximum stream generated by one call */#define LFSRLEN	    17 /*words*/#define OUTLEN	    20 /*bytes*/#define POLY	    0x4D	/* x^8 + x^6 + x^3 + x^2 + 1 *//* some useful macros -- big-endian */#define B(x,i) ((TURING_BYTE)(((x) >> (24 - 8*i)) & 0xFF))#define WORD2BYTE(w, b) { \	(b)[3] = B(w,3); \	(b)[2] = B(w,2); \	(b)[1] = B(w,1); \	(b)[0] = B(w,0); \}#define BYTE2WORD(b) ( \	(((TURING_WORD)(b)[0] & 0xFF)<<24) | \	(((TURING_WORD)(b)[1] & 0xFF)<<16) | \	(((TURING_WORD)(b)[2] & 0xFF)<<8) | \	(((TURING_WORD)(b)[3] & 0xFF)) \)#define ROTL(w,x) (((w) << (x))|((w) >> (32 - (x))))#endif

⌨️ 快捷键说明

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