1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate /*
7*7c478bd9Sstevel@tonic-gate  * lib/krb5/rcache/rc_common.c
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  * This file of the Kerberos V5 software is derived from public-domain code
10*7c478bd9Sstevel@tonic-gate  * contributed by Daniel J. Bernstein, <brnstnd@acf10.nyu.edu>.
11*7c478bd9Sstevel@tonic-gate  *
12*7c478bd9Sstevel@tonic-gate  */
13*7c478bd9Sstevel@tonic-gate 
14*7c478bd9Sstevel@tonic-gate /*
15*7c478bd9Sstevel@tonic-gate  * An implementation for the common replay cache functions.
16*7c478bd9Sstevel@tonic-gate  */
17*7c478bd9Sstevel@tonic-gate #include "rc_common.h"
18*7c478bd9Sstevel@tonic-gate 
19*7c478bd9Sstevel@tonic-gate /*
20*7c478bd9Sstevel@tonic-gate  * Local stuff:
21*7c478bd9Sstevel@tonic-gate  *
22*7c478bd9Sstevel@tonic-gate  * static int hash(krb5_donot_replay *rep, int hsize)
23*7c478bd9Sstevel@tonic-gate  *  returns hash value of *rep, between 0 and hsize - 1
24*7c478bd9Sstevel@tonic-gate  */
25*7c478bd9Sstevel@tonic-gate 
26*7c478bd9Sstevel@tonic-gate int
hash(krb5_donot_replay * rep,int hsize)27*7c478bd9Sstevel@tonic-gate hash(krb5_donot_replay *rep, int hsize)
28*7c478bd9Sstevel@tonic-gate {
29*7c478bd9Sstevel@tonic-gate 	return ((int)((((rep->cusec + rep->ctime + *rep->server + *rep->client)
30*7c478bd9Sstevel@tonic-gate 	    % hsize) + hsize) % hsize));
31*7c478bd9Sstevel@tonic-gate }
32