mirror from https://www.codeaurora.org/git/projects/hisense-ts7008/repository/
[huawei.git] / AMSS / diagd3des.h
1 #ifndef DIAGD3DES_H\r
2 #define DIAGD3DES_H\r
3 \r
4 /* D3DES \r
5  *\r
6  * A portable, public domain, version of the Data Encryption Standard.\r
7  *\r
8  * Copyright (c) 2004 by Hisense Incorporated. All Rights Reserved.\r
9  */\r
10 \r
11 #define EN0     0       /* MODE == encrypt */\r
12 #define DE1     1       /* MODE == decrypt */\r
13 \r
14 /* A useful alias on 68000-ish machines, but NOT USED HERE. */\r
15 \r
16 typedef union {\r
17         unsigned long blok[2];\r
18         unsigned short word[4];\r
19         unsigned char byte[8];\r
20         } M68K;\r
21 \r
22 extern void diag_deskey(unsigned char *, short);\r
23 /*                    hexkey[8]     MODE\r
24  * Sets the internal key register according to the hexadecimal\r
25  * key contained in the 8 bytes of hexkey, according to the DES,\r
26  * for encryption or decryption according to MODE.\r
27  */\r
28 \r
29 extern void diag_usekey(unsigned long *);\r
30 /*                  cookedkey[32]\r
31  * Loads the internal key register with the data in cookedkey.\r
32  */\r
33 \r
34 extern void diag_cpkey(unsigned long *);\r
35 /*                 cookedkey[32]\r
36  * Copies the contents of the internal key register into the storage\r
37  * located at &cookedkey[0].\r
38  */\r
39 \r
40 extern void diag_des(unsigned char *, unsigned char *);\r
41 /*                  from[8]           to[8]\r
42  * Encrypts/Decrypts (according to the key currently loaded in the\r
43  * internal key register) one block of eight bytes at address 'from'\r
44  * into the block at address 'to'.  They can be the same.\r
45  */\r
46 \r
47 #endif\r
48 \r
49 \r