11.1Sriastrad/*	$NetBSD: aes_sse2_4x32_subr.h,v 1.1 2025/11/23 22:48:27 riastradh Exp $	*/
21.1Sriastrad
31.1Sriastrad/*-
41.1Sriastrad * Copyright (c) 2025 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_ARCH_X86_AES_SSE2_4X32_SUBR_H
301.1Sriastrad#define	_CRYPTO_AES_ARCH_X86_AES_SSE2_4X32_SUBR_H
311.1Sriastrad
321.1Sriastrad#include <crypto/aes/aes.h>
331.1Sriastrad
341.1Sriastrad/*
351.1Sriastrad * These functions MUST NOT use any vector registers for parameters or
361.1Sriastrad * results -- the caller is compiled with -mno-sse &c. in the kernel,
371.1Sriastrad * and dynamically turns on the vector unit just before calling them.
381.1Sriastrad * Internal subroutines that use the vector unit for parameters are
391.1Sriastrad * declared in aes_sse2_4x32_internal.h instead.
401.1Sriastrad */
411.1Sriastrad
421.1Sriastradvoid aes_sse2_4x32_setkey(uint32_t[static 60], const void *, uint32_t);
431.1Sriastrad
441.1Sriastradvoid aes_sse2_4x32_enc(const struct aesenc *, const uint8_t in[static 16],
451.1Sriastrad    uint8_t[static 16], uint32_t);
461.1Sriastradvoid aes_sse2_4x32_dec(const struct aesdec *, const uint8_t in[static 16],
471.1Sriastrad    uint8_t[static 16], uint32_t);
481.1Sriastradvoid aes_sse2_4x32_cbc_enc(const struct aesenc *, const uint8_t[static 16],
491.1Sriastrad    uint8_t[static 16], size_t nbytes, uint8_t[static 16], uint32_t);
501.1Sriastradvoid aes_sse2_4x32_cbc_dec(const struct aesdec *, const uint8_t[static 16],
511.1Sriastrad    uint8_t[static 16], size_t nbytes, uint8_t[static 16], uint32_t);
521.1Sriastradvoid aes_sse2_4x32_xts_enc(const struct aesenc *, const uint8_t[static 16],
531.1Sriastrad    uint8_t[static 16], size_t nbytes, uint8_t[static 16], uint32_t);
541.1Sriastradvoid aes_sse2_4x32_xts_dec(const struct aesdec *, const uint8_t[static 16],
551.1Sriastrad    uint8_t[static 16], size_t nbytes, uint8_t[static 16], uint32_t);
561.1Sriastradvoid aes_sse2_4x32_cbcmac_update1(const struct aesenc *,
571.1Sriastrad    const uint8_t[static 16], size_t, uint8_t[static 16], uint32_t);
581.1Sriastradvoid aes_sse2_4x32_ccm_enc1(const struct aesenc *,
591.1Sriastrad    const uint8_t[static 16], uint8_t[static 16], size_t, uint8_t[static 32],
601.1Sriastrad    uint32_t);
611.1Sriastradvoid aes_sse2_4x32_ccm_dec1(const struct aesenc *,
621.1Sriastrad    const uint8_t[static 16], uint8_t[static 16], size_t, uint8_t[static 32],
631.1Sriastrad    uint32_t);
641.1Sriastrad
651.1Sriastradint aes_sse2_4x32_selftest(void);
661.1Sriastrad
671.1Sriastrad#endif	/* _CRYPTO_AES_ARCH_X86_AES_SSE2_4X32_SUBR_H */
68