1181467Sphilip/*-
2181467Sphilip * Copyright (c) 2005-2006 Pawel Jakub Dawidek <pjd@FreeBSD.org>
3181467Sphilip * All rights reserved.
4181467Sphilip *
5181467Sphilip * Redistribution and use in source and binary forms, with or without
6181467Sphilip * modification, are permitted provided that the following conditions
7181467Sphilip * are met:
8181467Sphilip * 1. Redistributions of source code must retain the above copyright
9181467Sphilip *    notice, this list of conditions and the following disclaimer.
10181467Sphilip * 2. Redistributions in binary form must reproduce the above copyright
11181467Sphilip *    notice, this list of conditions and the following disclaimer in the
12181467Sphilip *    documentation and/or other materials provided with the distribution.
13181467Sphilip *
14181467Sphilip * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
15181467Sphilip * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16181467Sphilip * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17181467Sphilip * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE
18181467Sphilip * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19181467Sphilip * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20181467Sphilip * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21181467Sphilip * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22181467Sphilip * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23181467Sphilip * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24181467Sphilip * SUCH DAMAGE.
25181467Sphilip *
26181467Sphilip * $FreeBSD$
27181467Sphilip */
28181467Sphilip
29181467Sphilip#ifndef _GLXSB_H_
30181467Sphilip#define _GLXSB_H_
31181467Sphilip
32181467Sphilip#include <opencrypto/cryptodev.h>
33181467Sphilip
34181467Sphilip#define SB_AES_BLOCK_SIZE       0x0010
35181467Sphilip
36181467Sphilipstruct glxsb_session {
37181467Sphilip	uint32_t	ses_key[4];		/* key */
38181467Sphilip	uint8_t		ses_iv[SB_AES_BLOCK_SIZE]; /* initialization vector */
39181467Sphilip	int		ses_klen;		/* key len */
40181467Sphilip	int		ses_used;		/* session is used */
41181467Sphilip	uint32_t	ses_id;			/* session id*/
42181467Sphilip	struct auth_hash *ses_axf;
43181467Sphilip	uint8_t		*ses_ictx;
44181467Sphilip	uint8_t		*ses_octx;
45181467Sphilip	int		ses_mlen;
46181467Sphilip	TAILQ_ENTRY(glxsb_session) ses_next;
47181467Sphilip};
48181467Sphilip
49181467Sphilipint glxsb_hash_setup(struct glxsb_session *ses,
50181467Sphilip	    struct cryptoini *macini);
51181467Sphilip
52181467Sphilipint glxsb_hash_process(struct glxsb_session *ses,
53181467Sphilip	    struct cryptodesc *maccrd, struct cryptop *crp);
54181467Sphilip
55181467Sphilipvoid glxsb_hash_free(struct glxsb_session *ses);
56181467Sphilip
57181467Sphilip#endif	/* !_GLXSB_H_ */
58