xref: /freebsd/sys/crypto/ccp/ccp_lsb.h (revision 95ee2897e98f5d444f26ed2334cc7c439f9c16c6)
1844d9543SConrad Meyer /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3844d9543SConrad Meyer  *
4844d9543SConrad Meyer  * Copyright (c) 2017 Conrad Meyer <cem@FreeBSD.org>
5844d9543SConrad Meyer  * All rights reserved.
6844d9543SConrad Meyer  *
7844d9543SConrad Meyer  * Redistribution and use in source and binary forms, with or without
8844d9543SConrad Meyer  * modification, are permitted provided that the following conditions
9844d9543SConrad Meyer  * are met:
10844d9543SConrad Meyer  * 1. Redistributions of source code must retain the above copyright
11844d9543SConrad Meyer  *    notice, this list of conditions and the following disclaimer.
12844d9543SConrad Meyer  * 2. Redistributions in binary form must reproduce the above copyright
13844d9543SConrad Meyer  *    notice, this list of conditions and the following disclaimer in the
14844d9543SConrad Meyer  *    documentation and/or other materials provided with the distribution.
15844d9543SConrad Meyer  *
16844d9543SConrad Meyer  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17844d9543SConrad Meyer  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18844d9543SConrad Meyer  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19844d9543SConrad Meyer  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20844d9543SConrad Meyer  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21844d9543SConrad Meyer  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22844d9543SConrad Meyer  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23844d9543SConrad Meyer  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24844d9543SConrad Meyer  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25844d9543SConrad Meyer  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26844d9543SConrad Meyer  * SUCH DAMAGE.
27844d9543SConrad Meyer  */
28844d9543SConrad Meyer 
29844d9543SConrad Meyer #pragma once
30844d9543SConrad Meyer 
31844d9543SConrad Meyer #define LSB_ENTRY_SIZE		32	/* bytes, or 256 bits */
32844d9543SConrad Meyer #define LSB_REGION_LENGTH	16	/* entries */
33844d9543SConrad Meyer 
34844d9543SConrad Meyer /* For now, just statically allocate some LSB entries for specific purposes. */
35844d9543SConrad Meyer #define LSB_ENTRY_KEY		0
36844d9543SConrad Meyer #define LSB_ENTRY_IV		2
37844d9543SConrad Meyer #define LSB_ENTRY_SHA		4
38844d9543SConrad Meyer #define LSB_ENTRY_GHASH		6
39844d9543SConrad Meyer #define LSB_ENTRY_GHASH_IN	7
40844d9543SConrad Meyer 
41844d9543SConrad Meyer void ccp_queue_decode_lsb_regions(struct ccp_softc *sc, uint64_t lsbmask,
42844d9543SConrad Meyer     unsigned queue);
43844d9543SConrad Meyer void ccp_assign_lsb_regions(struct ccp_softc *sc, uint64_t lsbmask);
44