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