xref: /titanic_51/usr/src/lib/libsmbfs/smb/smb_crypt.h (revision 85e6b6747d07050e01ec91acef2453655821f9ab)
1613a2f6bSGordon Ross /*
2613a2f6bSGordon Ross  * Copyright (c) 2000-2001 Boris Popov
3613a2f6bSGordon Ross  * All rights reserved.
4613a2f6bSGordon Ross  *
5613a2f6bSGordon Ross  * Redistribution and use in source and binary forms, with or without
6613a2f6bSGordon Ross  * modification, are permitted provided that the following conditions
7613a2f6bSGordon Ross  * are met:
8613a2f6bSGordon Ross  * 1. Redistributions of source code must retain the above copyright
9613a2f6bSGordon Ross  *    notice, this list of conditions and the following disclaimer.
10613a2f6bSGordon Ross  * 2. Redistributions in binary form must reproduce the above copyright
11613a2f6bSGordon Ross  *    notice, this list of conditions and the following disclaimer in the
12613a2f6bSGordon Ross  *    documentation and/or other materials provided with the distribution.
13613a2f6bSGordon Ross  * 3. All advertising materials mentioning features or use of this software
14613a2f6bSGordon Ross  *    must display the following acknowledgement:
15613a2f6bSGordon Ross  *    This product includes software developed by Boris Popov.
16613a2f6bSGordon Ross  * 4. Neither the name of the author nor the names of any co-contributors
17613a2f6bSGordon Ross  *    may be used to endorse or promote products derived from this software
18613a2f6bSGordon Ross  *    without specific prior written permission.
19613a2f6bSGordon Ross  *
20613a2f6bSGordon Ross  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
21613a2f6bSGordon Ross  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22613a2f6bSGordon Ross  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23613a2f6bSGordon Ross  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
24613a2f6bSGordon Ross  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25613a2f6bSGordon Ross  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26613a2f6bSGordon Ross  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27613a2f6bSGordon Ross  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28613a2f6bSGordon Ross  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29613a2f6bSGordon Ross  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30613a2f6bSGordon Ross  * SUCH DAMAGE.
31613a2f6bSGordon Ross  */
32613a2f6bSGordon Ross 
33613a2f6bSGordon Ross /*
34613a2f6bSGordon Ross  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
35613a2f6bSGordon Ross  * Use is subject to license terms.
36*85e6b674SGordon Ross  * Copyright 2013 Nexenta Systems, Inc.  All rights reserved.
37613a2f6bSGordon Ross  */
38613a2f6bSGordon Ross 
39*85e6b674SGordon Ross #ifndef _SMB_CRYPT_H
40*85e6b674SGordon Ross #define	_SMB_CRYPT_H
41*85e6b674SGordon Ross 
42613a2f6bSGordon Ross /*
43613a2f6bSGordon Ross  * Various crypto stuff.
44613a2f6bSGordon Ross  * from the driver: smb_crypt.c
45613a2f6bSGordon Ross  */
46613a2f6bSGordon Ross 
47*85e6b674SGordon Ross #ifdef __cplusplus
48*85e6b674SGordon Ross extern "C" {
49*85e6b674SGordon Ross #endif
50*85e6b674SGordon Ross 
51613a2f6bSGordon Ross int
52613a2f6bSGordon Ross smb_encrypt_DES(uchar_t *Result, int ResultLen,
53613a2f6bSGordon Ross     const uchar_t *Key, int KeyLen,
54613a2f6bSGordon Ross     const uchar_t *Data, int DataLen);
55613a2f6bSGordon Ross 
56613a2f6bSGordon Ross int
57*85e6b674SGordon Ross smb_encrypt_RC4(uchar_t *Result, int ResultLen,
58*85e6b674SGordon Ross     const uchar_t *Key, int KeyLen,
59*85e6b674SGordon Ross     const uchar_t *Data, int DataLen);
60*85e6b674SGordon Ross 
61*85e6b674SGordon Ross int
62613a2f6bSGordon Ross smb_get_urandom(void *data, size_t dlen);
63*85e6b674SGordon Ross 
64*85e6b674SGordon Ross #ifdef __cplusplus
65*85e6b674SGordon Ross }
66*85e6b674SGordon Ross #endif
67*85e6b674SGordon Ross 
68*85e6b674SGordon Ross #endif /* _SMB_CRYPT_H */
69