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