xref: /freebsd/sys/dev/glxsb/glxsb.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1a51aa5d1SPhilip Paeps /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3718cf2ccSPedro F. Giffuni  *
4a51aa5d1SPhilip Paeps  * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
5a51aa5d1SPhilip Paeps  * All rights reserved.
6a51aa5d1SPhilip Paeps  *
7a51aa5d1SPhilip Paeps  * Redistribution and use in source and binary forms, with or without
8a51aa5d1SPhilip Paeps  * modification, are permitted provided that the following conditions
9a51aa5d1SPhilip Paeps  * are met:
10a51aa5d1SPhilip Paeps  * 1. Redistributions of source code must retain the above copyright
11a51aa5d1SPhilip Paeps  *    notice, this list of conditions and the following disclaimer.
12a51aa5d1SPhilip Paeps  * 2. Redistributions in binary form must reproduce the above copyright
13a51aa5d1SPhilip Paeps  *    notice, this list of conditions and the following disclaimer in the
14a51aa5d1SPhilip Paeps  *    documentation and/or other materials provided with the distribution.
15a51aa5d1SPhilip Paeps  *
16a51aa5d1SPhilip Paeps  * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
17a51aa5d1SPhilip Paeps  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18a51aa5d1SPhilip Paeps  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19a51aa5d1SPhilip Paeps  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
20a51aa5d1SPhilip Paeps  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21a51aa5d1SPhilip Paeps  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22a51aa5d1SPhilip Paeps  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23a51aa5d1SPhilip Paeps  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24a51aa5d1SPhilip Paeps  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25a51aa5d1SPhilip Paeps  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26a51aa5d1SPhilip Paeps  * SUCH DAMAGE.
27a51aa5d1SPhilip Paeps  */
28a51aa5d1SPhilip Paeps 
29a51aa5d1SPhilip Paeps #ifndef _GLXSB_H_
30a51aa5d1SPhilip Paeps #define _GLXSB_H_
31a51aa5d1SPhilip Paeps 
32a51aa5d1SPhilip Paeps #include <opencrypto/cryptodev.h>
33a51aa5d1SPhilip Paeps 
34a51aa5d1SPhilip Paeps #define SB_AES_BLOCK_SIZE       0x0010
35a51aa5d1SPhilip Paeps 
36a51aa5d1SPhilip Paeps struct glxsb_session {
37a51aa5d1SPhilip Paeps 	uint32_t	ses_key[4];		/* key */
38d8787d4fSMark Johnston 	const struct auth_hash *ses_axf;
39a51aa5d1SPhilip Paeps 	uint8_t		*ses_ictx;
40a51aa5d1SPhilip Paeps 	uint8_t		*ses_octx;
41a51aa5d1SPhilip Paeps 	int		ses_mlen;
42a51aa5d1SPhilip Paeps };
43a51aa5d1SPhilip Paeps 
44a51aa5d1SPhilip Paeps int glxsb_hash_setup(struct glxsb_session *ses,
45c0341432SJohn Baldwin     const struct crypto_session_params *csp);
46a51aa5d1SPhilip Paeps 
47a51aa5d1SPhilip Paeps int glxsb_hash_process(struct glxsb_session *ses,
48c0341432SJohn Baldwin     const struct crypto_session_params *csp, struct cryptop *crp);
49a51aa5d1SPhilip Paeps 
50a51aa5d1SPhilip Paeps void glxsb_hash_free(struct glxsb_session *ses);
51a51aa5d1SPhilip Paeps 
52a51aa5d1SPhilip Paeps #endif	/* !_GLXSB_H_ */
53