tty/serial: atmel_serial: whitespace and braces modifications
[zen-stable.git] / drivers / staging / vt6655 / michael.h
blob3131b161d6a9a235e7f507067637ee7dbb2f05bf
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 * File: Michael.h
22 * Purpose: Reference implementation for Michael
23 * written by Niels Ferguson
25 * Author: Kyle Hsu
27 * Date: Jan 2, 2003
31 #ifndef __MICHAEL_H__
32 #define __MICHAEL_H__
34 /*--------------------- Export Definitions -------------------------*/
36 /*--------------------- Export Types ------------------------------*/
38 void MIC_vInit(unsigned long dwK0, unsigned long dwK1);
40 void MIC_vUnInit(void);
42 // Append bytes to the message to be MICed
43 void MIC_vAppend(unsigned char *src, unsigned int nBytes);
45 // Get the MIC result. Destination should accept 8 bytes of result.
46 // This also resets the message to empty.
47 void MIC_vGetMIC(unsigned long *pdwL, unsigned long *pdwR);
49 /*--------------------- Export Macros ------------------------------*/
51 // Rotation functions on 32 bit values
52 #define ROL32( A, n ) \
53 ( ((A) << (n)) | ( ((A)>>(32-(n))) & ( (1UL << (n)) - 1 ) ) )
54 #define ROR32( A, n ) ROL32( (A), 32-(n) )
56 #endif //__MICHAEL_H__