11.1Sriastrad/*	$NetBSD: aes_bear64.h,v 1.1 2025/11/23 22:44:13 riastradh Exp $	*/
21.1Sriastrad
31.1Sriastrad/*-
41.1Sriastrad * Copyright (c) 2020 The NetBSD Foundation, Inc.
51.1Sriastrad * All rights reserved.
61.1Sriastrad *
71.1Sriastrad * Redistribution and use in source and binary forms, with or without
81.1Sriastrad * modification, are permitted provided that the following conditions
91.1Sriastrad * are met:
101.1Sriastrad * 1. Redistributions of source code must retain the above copyright
111.1Sriastrad *    notice, this list of conditions and the following disclaimer.
121.1Sriastrad * 2. Redistributions in binary form must reproduce the above copyright
131.1Sriastrad *    notice, this list of conditions and the following disclaimer in the
141.1Sriastrad *    documentation and/or other materials provided with the distribution.
151.1Sriastrad *
161.1Sriastrad * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
171.1Sriastrad * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
181.1Sriastrad * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
191.1Sriastrad * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
201.1Sriastrad * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
211.1Sriastrad * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
221.1Sriastrad * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
231.1Sriastrad * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
241.1Sriastrad * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
251.1Sriastrad * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
261.1Sriastrad * POSSIBILITY OF SUCH DAMAGE.
271.1Sriastrad */
281.1Sriastrad
291.1Sriastrad#ifndef	_CRYPTO_AES_AES_BEAR64_H
301.1Sriastrad#define	_CRYPTO_AES_AES_BEAR64_H
311.1Sriastrad
321.1Sriastrad#include <sys/types.h>
331.1Sriastrad#include <sys/endian.h>
341.1Sriastrad
351.1Sriastrad#include <crypto/aes/aes.h>
361.1Sriastrad
371.1Sriastrad#define	br_dec32le	le32dec
381.1Sriastrad#define	br_enc32le	le32enc
391.1Sriastrad
401.1Sriastradvoid	br_aes_ct64_bitslice_Sbox(uint64_t[static 8]);
411.1Sriastradvoid	br_aes_ct64_bitslice_invSbox(uint64_t[static 8]);
421.1Sriastradvoid	br_aes_ct64_ortho(uint64_t[static 8]);
431.1Sriastradvoid	br_aes_ct64_interleave_in(uint64_t[static 1], uint64_t[static 1],
441.1Sriastrad	    const uint32_t[static 4]);
451.1Sriastradvoid	br_aes_ct64_interleave_out(uint32_t[static 4], uint64_t, uint64_t);
461.1Sriastradu_int	br_aes_ct64_keysched(uint64_t[static 30], const void *, size_t);
471.1Sriastradvoid	br_aes_ct64_skey_expand(uint64_t[static 120], unsigned,
481.1Sriastrad	    const uint64_t[static 30]);
491.1Sriastradvoid	br_aes_ct64_bitslice_encrypt(unsigned, const uint64_t[static 120],
501.1Sriastrad	    uint64_t[static 8]);
511.1Sriastradvoid	br_aes_ct64_bitslice_decrypt(unsigned, const uint64_t[static 120],
521.1Sriastrad	    uint64_t[static 8]);
531.1Sriastrad
541.1Sriastrad/* NetBSD additions */
551.1Sriastrad
561.1Sriastradvoid	br_aes_ct64_inv_mix_columns(uint64_t[static 8]);
571.1Sriastradu_int	br_aes_ct64_keysched_stdenc(uint32_t *, const void *, size_t);
581.1Sriastradu_int	br_aes_ct64_keysched_stddec(uint32_t *, const void *, size_t);
591.1Sriastrad
601.1Sriastradextern struct aes_impl	aes_bear64_impl;
611.1Sriastrad
621.1Sriastrad#endif	/* _CRYPTO_AES_AES_BEAR64_H */
63