| 1 | /* |
| 2 | * Copyright 2000, International Business Machines Corporation and others. |
| 3 | * All Rights Reserved. |
| 4 | * |
| 5 | * This software has been released under the terms of the IBM Public |
| 6 | * License. For details, see the LICENSE file in the top-level source |
| 7 | * directory or online at http://www.openafs.org/dl/license10.html |
| 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * |
| 12 | * COMPONENT_NAME: Delite Gateway |
| 13 | * |
| 14 | */ |
| 15 | |
| 16 | #ifndef _NSAFS_H_ |
| 17 | #define _NSAFS_H_ |
| 18 | |
| 19 | /* |
| 20 | * SHA is defined to work on unsigned 32 bit integers. |
| 21 | * These values should therefore not change. |
| 22 | */ |
| 23 | typedef afs_uint32 sha_int; |
| 24 | |
| 25 | #define SHA_BITS_PER_INT 32 |
| 26 | #define SHA_CHUNK_BITS 512 |
| 27 | #define SHA_CHUNK_BYTES 64 |
| 28 | #define SHA_CHUNK_INTS 16 |
| 29 | #define SHA_HASH_BITS 160 |
| 30 | #define SHA_HASH_BYTES 20 |
| 31 | #define SHA_HASH_INTS 5 |
| 32 | #define SHA_ROUNDS 80 |
| 33 | |
| 34 | |
| 35 | typedef struct shaState { |
| 36 | sha_int digest[SHA_HASH_INTS]; |
| 37 | sha_int bitcountLo; |
| 38 | sha_int bitcountHi; |
| 39 | sha_int leftoverLen; |
| 40 | char leftover[SHA_CHUNK_BYTES]; |
| 41 | } shaState; |
| 42 | |
| 43 | |
| 44 | void sha_clear(shaState * shaStateP); |
| 45 | void sha_update(shaState * shaStateP, const char *buffer, int bufferLen); |
| 46 | void sha_finish(shaState * shaStateP); |
| 47 | void sha_hash(shaState * shaStateP, const char *buffer, int bufferLen); |
| 48 | void sha_bytes(const shaState * shaStateP, char *bytes); |
| 49 | |
| 50 | extern afs_int32 nsafs_SetToken(struct ktc_principal *aserver, |
| 51 | struct ktc_token *atoken, |
| 52 | struct ktc_principal *aclient, |
| 53 | afs_int32 flags); |
| 54 | |
| 55 | #endif /* _NSAFS_H_ */ |