xref: /freebsd/sys/crypto/openssl/ossl.h (revision 92aecd1e6fac47ffc893f628c1fe289568bb19cb)
1ba610be9SJohn Baldwin /*
2ba610be9SJohn Baldwin  * Copyright (c) 2020 Netflix, Inc
3ba610be9SJohn Baldwin  *
4ba610be9SJohn Baldwin  * Redistribution and use in source and binary forms, with or without
5ba610be9SJohn Baldwin  * modification, are permitted provided that the following conditions
6ba610be9SJohn Baldwin  * are met:
7ba610be9SJohn Baldwin  * 1. Redistributions of source code must retain the above copyright
8ba610be9SJohn Baldwin  *    notice, this list of conditions and the following disclaimer,
9ba610be9SJohn Baldwin  *    without modification.
10ba610be9SJohn Baldwin  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
11ba610be9SJohn Baldwin  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
12ba610be9SJohn Baldwin  *    redistribution must be conditioned upon including a substantially
13ba610be9SJohn Baldwin  *    similar Disclaimer requirement for further binary redistribution.
14ba610be9SJohn Baldwin  *
15ba610be9SJohn Baldwin  * NO WARRANTY
16ba610be9SJohn Baldwin  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17ba610be9SJohn Baldwin  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18ba610be9SJohn Baldwin  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY
19ba610be9SJohn Baldwin  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
20ba610be9SJohn Baldwin  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
21ba610be9SJohn Baldwin  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22ba610be9SJohn Baldwin  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23ba610be9SJohn Baldwin  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
24ba610be9SJohn Baldwin  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ba610be9SJohn Baldwin  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26ba610be9SJohn Baldwin  * THE POSSIBILITY OF SUCH DAMAGES.
27ba610be9SJohn Baldwin  *
28ba610be9SJohn Baldwin  * $FreeBSD$
29ba610be9SJohn Baldwin  */
30ba610be9SJohn Baldwin 
31ba610be9SJohn Baldwin #ifndef __OSSL_H__
32ba610be9SJohn Baldwin #define	__OSSL_H__
33ba610be9SJohn Baldwin 
34ba610be9SJohn Baldwin /* Compatibility shims. */
35ba610be9SJohn Baldwin #define	OPENSSL_cleanse		explicit_bzero
36ba610be9SJohn Baldwin 
37*92aecd1eSJohn Baldwin struct cryptop;
38*92aecd1eSJohn Baldwin struct crypto_session_params;
39*92aecd1eSJohn Baldwin 
40*92aecd1eSJohn Baldwin int	ossl_chacha20(struct cryptop *crp,
41*92aecd1eSJohn Baldwin 	    const struct crypto_session_params *csp);
42fd86ae68SMitchell Horne void ossl_cpuid(void);
43ba610be9SJohn Baldwin 
44ba610be9SJohn Baldwin /* Needs to be big enough to hold any hash context. */
45ba610be9SJohn Baldwin struct ossl_hash_context {
46a079e38bSJohn Baldwin 	uint32_t	dummy[61];
47ba610be9SJohn Baldwin } __aligned(32);
48ba610be9SJohn Baldwin 
49a079e38bSJohn Baldwin extern struct auth_hash ossl_hash_poly1305;
50ba610be9SJohn Baldwin extern struct auth_hash ossl_hash_sha1;
51ba610be9SJohn Baldwin extern struct auth_hash ossl_hash_sha224;
52ba610be9SJohn Baldwin extern struct auth_hash ossl_hash_sha256;
53ba610be9SJohn Baldwin extern struct auth_hash ossl_hash_sha384;
54ba610be9SJohn Baldwin extern struct auth_hash ossl_hash_sha512;
55ba610be9SJohn Baldwin 
56ba610be9SJohn Baldwin #endif /* !__OSSL_H__ */
57