1 /* SCTP reference Implementation
2 * Copyright (C) 1999 Cisco, Inc.
3 * Copyright (C) 1999 Motorola, Inc.
5 * This file originates from Randy Stewart's SCTP reference Implementation.
7 * The SCTP reference implementation is distributed in the hope that it
8 * will be useful, but WITHOUT ANY WARRANTY; without even the implied
9 * ************************
10 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 * See the GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with GNU CC; see the file COPYING. If not, write to
15 * the Free Software Foundation, 59 Temple Place - Suite 330,
16 * Boston, MA 02111-1307, USA.
18 * Please send any bug reports or fixes you make to the
20 * lksctp developers <lksctp-developers@lists.sourceforge.net>
22 * Or submit a bug report through the following website:
23 * http://www.sf.net/projects/lksctp
25 * Written or modified by:
26 * Randy Stewart <rstewar1@email.mot.com>
27 * Ken Morneau <kmorneau@cisco.com>
28 * Qiaobing Xie <qxie1@email.mot.com>
34 struct SLA_1_Context {
45 unsigned int words[80];
48 /* block I am collecting to process */
51 /* collected so far */
53 unsigned int runningTotal;
57 #define F1(B,C,D) (((B & C) | ((~B) & D))) /* 0 <= t <= 19 */
58 #define F2(B,C,D) (B ^ C ^ D) /* 20 <= t <= 39 */
59 #define F3(B,C,D) ((B & C) | (B & D) | (C & D)) /* 40 <= t <= 59 */
60 #define F4(B,C,D) (B ^ C ^ D) /*600 <= t <= 79 */
63 #define CSHIFT(A,B) ((B << A) | (B >> (32-A)))
65 #define K1 0x5a827999 /* 0 <= t <= 19 */
66 #define K2 0x6ed9eba1 /* 20 <= t <= 39 */
67 #define K3 0x8f1bbcdc /* 40 <= t <= 59 */
68 #define K4 0xca62c1d6 /* 60 <= t <= 79 */
70 #define H0INIT 0x67452301
71 #define H1INIT 0xefcdab89
72 #define H2INIT 0x98badcfe
73 #define H3INIT 0x10325476
74 #define H4INIT 0xc3d2e1f0
76 extern void SLA1_Init(struct SLA_1_Context *);
77 extern void SLA1_Process(struct SLA_1_Context *, const unsigned char *, int);
78 extern void SLA1_Final(struct SLA_1_Context *, unsigned char *);