blob: 51e10286460d4c90b84481bd23778b49c6ae760d [file] [log] [blame]
Adam Langley4c921e12014-07-14 15:28:14 -07001/* Copyright (c) 2014, Google Inc.
2 *
3 * Permission to use, copy, modify, and/or distribute this software for any
4 * purpose with or without fee is hereby granted, provided that the above
5 * copyright notice and this permission notice appear in all copies.
6 *
7 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14
David Benjamina70c75c2014-09-11 19:11:15 -040015#ifndef OPENSSL_HEADER_CRYPTO_H
16#define OPENSSL_HEADER_CRYPTO_H
17
18#include <openssl/base.h>
19
David Benjamin2c6080f2015-04-24 10:15:31 -040020/* Upstream OpenSSL defines |OPENSSL_malloc|, etc., in crypto.h rather than
21 * mem.h. */
22#include <openssl/mem.h>
23
Matt Braithwaited0e1f1c2015-08-05 11:40:35 -070024/* Upstream OpenSSL defines |CRYPTO_LOCK|, etc., in crypto.h rather than
25 * thread.h. */
26#include <openssl/thread.h>
27
David Benjamina70c75c2014-09-11 19:11:15 -040028
29#if defined(__cplusplus)
30extern "C" {
31#endif
32
33
34/* crypto.h contains functions for initializing the crypto library. */
35
36
37/* CRYPTO_library_init initializes the crypto library. It must be called if the
38 * library is built with BORINGSSL_NO_STATIC_INITIALIZER. Otherwise, it does
David Benjamin054e1512016-03-01 17:35:47 -050039 * nothing and a static initializer is used instead.
40 *
41 * On some ARM configurations, this function may require filesystem access and
42 * should be called before entering a sandbox. */
David Benjamina70c75c2014-09-11 19:11:15 -040043OPENSSL_EXPORT void CRYPTO_library_init(void);
44
45
Adam Langleyc3ef76f2015-04-13 14:34:17 -070046/* Deprecated functions. */
47
Adam Langleyce9d85e2016-01-24 15:58:39 -080048/* OPENSSL_VERSION_TEXT contains a string the identifies the version of
49 * “OpenSSL”. node.js requires a version number in this text. */
50#define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2 (compatible; BoringSSL)"
Adam Langleyc3ef76f2015-04-13 14:34:17 -070051
52#define SSLEAY_VERSION 0
53
54/* SSLeay_version is a compatibility function that returns the string
55 * "BoringSSL". */
56OPENSSL_EXPORT const char *SSLeay_version(int unused);
57
Adam Langleyb3a262c2015-05-19 16:30:20 -070058/* SSLeay is a compatibility function that returns OPENSSL_VERSION_NUMBER from
59 * base.h. */
60OPENSSL_EXPORT unsigned long SSLeay(void);
Adam Langleyc3ef76f2015-04-13 14:34:17 -070061
Adam Langley05ee4fd2015-08-02 09:35:44 -070062/* CRYPTO_malloc_init returns one. */
63OPENSSL_EXPORT int CRYPTO_malloc_init(void);
64
65/* ENGINE_load_builtin_engines does nothing. */
66OPENSSL_EXPORT void ENGINE_load_builtin_engines(void);
67
David Benjamine5aa7912016-01-26 01:09:19 -050068/* OPENSSL_load_builtin_modules does nothing. */
69OPENSSL_EXPORT void OPENSSL_load_builtin_modules(void);
70
Adam Langley7a17ba22016-03-01 16:00:36 -080071/* FIPS_mode returns zero. */
72OPENSSL_EXPORT int FIPS_mode(void);
73
Adam Langleyc3ef76f2015-04-13 14:34:17 -070074
David Benjamina70c75c2014-09-11 19:11:15 -040075#if defined(__cplusplus)
76} /* extern C */
77#endif
Adam Langley4c921e12014-07-14 15:28:14 -070078
David Benjamina70c75c2014-09-11 19:11:15 -040079#endif /* OPENSSL_HEADER_CRYPTO_H */