1 /*
2  * Copyright 2001-2002 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*
7  * lib/crypto/crc32/crc.c
8  *
9  * Copyright 1990 by the Massachusetts Institute of Technology.
10  * All Rights Reserved.
11  *
12  * Export of this software from the United States of America may
13  *   require a specific license from the United States Government.
14  *   It is the responsibility of any person or organization contemplating
15  *   export to obtain such a license before exporting.
16  *
17  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
18  * distribute this software and its documentation for any purpose and
19  * without fee is hereby granted, provided that the above copyright
20  * notice appear in all copies and that both that copyright notice and
21  * this permission notice appear in supporting documentation, and that
22  * the name of M.I.T. not be used in advertising or publicity pertaining
23  * to distribution of the software without specific, written prior
24  * permission.  M.I.T. makes no representations about the suitability of
25  * this software for any purpose.  It is provided "as is" without express
26  * or implied warranty.
27  *
28  *
29  * CRC-32/AUTODIN-II routines
30  */
31 
32 #include <k5-int.h>
33 #include <gssapiP_generic.h>
34 #include <crc-32.h>
35 #include <sys/crc32.h>
36 
37 static uint32_t const crc_table[256] = { CRC32_TABLE };
38 
39 void
mit_crc32(in,in_length,cksum)40 mit_crc32(in, in_length, cksum)
41 	krb5_const krb5_pointer in;
42 	krb5_const size_t in_length;
43 	unsigned long *cksum;
44 {
45 	unsigned int crc;
46 
47 	CRC32(crc, in, in_length, 0, crc_table);
48 
49 	*cksum = crc;
50 }
51