source: trunk/libtransmission/crypto-test-ref.h

Last change on this file was 14726, checked in by jordan, 5 years ago

crypto.h and crypto-utils.h can't use #pragma once, it breaks our name munging in crypto-test-ref.h

File size: 5.4 KB
Line 
1/*
2 * This file Copyright (C) 2015 Mnemosyne LLC
3 *
4 * It may be used under the GNU GPL versions 2 or 3
5 * or any future license endorsed by Mnemosyne LLC.
6 *
7 * $Id$
8 */
9
10#ifndef TR_CRYPTO_TEST_REF_H
11#define TR_CRYPTO_TEST_REF_H
12
13/* #define CRYPTO_REFERENCE_CHECK */
14
15#ifdef CRYPTO_REFERENCE_CHECK
16
17#define KEY_LEN KEY_LEN_
18
19#define tr_sha1_ctx_t tr_sha1_ctx_t_
20#define tr_rc4_ctx_t tr_rc4_ctx_t_
21#define tr_dh_ctx_t tr_dh_ctx_t_
22#define tr_dh_secret_t tr_dh_secret_t_
23#define tr_crypto tr_crypto_
24#define tr_cryptoConstruct tr_cryptoConstruct_
25#define tr_cryptoDestruct tr_cryptoDestruct_
26#define tr_cryptoSetTorrentHash tr_cryptoSetTorrentHash_
27#define tr_cryptoGetTorrentHash tr_cryptoGetTorrentHash_
28#define tr_cryptoHasTorrentHash tr_cryptoHasTorrentHash_
29#define tr_cryptoComputeSecret tr_cryptoComputeSecret_
30#define tr_cryptoGetMyPublicKey tr_cryptoGetMyPublicKey_
31#define tr_cryptoDecryptInit tr_cryptoDecryptInit_
32#define tr_cryptoDecrypt tr_cryptoDecrypt_
33#define tr_cryptoEncryptInit tr_cryptoEncryptInit_
34#define tr_cryptoEncrypt tr_cryptoEncrypt_
35#define tr_cryptoSecretKeySha1 tr_cryptoSecretKeySha1_
36#define tr_sha1 tr_sha1_
37#define tr_sha1_init tr_sha1_init_
38#define tr_sha1_update tr_sha1_update_
39#define tr_sha1_final tr_sha1_final_
40#define tr_rc4_new tr_rc4_new_
41#define tr_rc4_free tr_rc4_free_
42#define tr_rc4_set_key tr_rc4_set_key_
43#define tr_rc4_process tr_rc4_process_
44#define tr_dh_new tr_dh_new_
45#define tr_dh_free tr_dh_free_
46#define tr_dh_make_key tr_dh_make_key_
47#define tr_dh_agree tr_dh_agree_
48#define tr_dh_secret_derive tr_dh_secret_derive_
49#define tr_dh_secret_free tr_dh_secret_free_
50#define tr_dh_align_key tr_dh_align_key_
51#define tr_rand_int tr_rand_int_
52#define tr_rand_int_weak tr_rand_int_weak_
53#define tr_rand_buffer tr_rand_buffer_
54#define tr_ssha1 tr_ssha1_
55#define tr_ssha1_matches tr_ssha1_matches_
56#define tr_base64_encode tr_base64_encode_
57#define tr_base64_encode_str tr_base64_encode_str_
58#define tr_base64_encode_impl tr_base64_encode_impl_
59#define tr_base64_decode tr_base64_decode_
60#define tr_base64_decode_str tr_base64_decode_str_
61#define tr_base64_decode_impl tr_base64_decode_impl_
62#define tr_sha1_to_hex tr_sha1_to_hex_
63#define tr_hex_to_sha1 tr_hex_to_sha1_
64
65#undef TR_ENCRYPTION_H
66#undef TR_CRYPTO_UTILS_H
67
68#include "crypto.h"
69#include "crypto-utils.h"
70#include "crypto.c"
71#include "crypto-utils.c"
72#include "crypto-utils-openssl.c"
73
74#undef KEY_LEN_
75
76#undef tr_sha1_ctx_t
77#undef tr_rc4_ctx_t
78#undef tr_dh_ctx_t
79#undef tr_dh_secret_t
80#undef tr_crypto
81#undef tr_cryptoConstruct
82#undef tr_cryptoDestruct
83#undef tr_cryptoSetTorrentHash
84#undef tr_cryptoGetTorrentHash
85#undef tr_cryptoHasTorrentHash
86#undef tr_cryptoComputeSecret
87#undef tr_cryptoGetMyPublicKey
88#undef tr_cryptoDecryptInit
89#undef tr_cryptoDecrypt
90#undef tr_cryptoEncryptInit
91#undef tr_cryptoEncrypt
92#undef tr_cryptoSecretKeySha1
93#undef tr_sha1
94#undef tr_sha1_init
95#undef tr_sha1_update
96#undef tr_sha1_final
97#undef tr_rc4_new
98#undef tr_rc4_free
99#undef tr_rc4_set_key
100#undef tr_rc4_process
101#undef tr_dh_new
102#undef tr_dh_free
103#undef tr_dh_make_key
104#undef tr_dh_agree
105#undef tr_dh_secret_derive
106#undef tr_dh_secret_free
107#undef tr_dh_align_key
108#undef tr_rand_int
109#undef tr_rand_int_weak
110#undef tr_rand_buffer
111#undef tr_ssha1
112#undef tr_ssha1_matches
113#undef tr_base64_encode
114#undef tr_base64_encode_str
115#undef tr_base64_encode_impl
116#undef tr_base64_decode
117#undef tr_base64_decode_str
118#undef tr_base64_decode_impl
119#undef tr_sha1_to_hex
120#undef tr_hex_to_sha1
121
122#else /* CRYPTO_REFERENCE_CHECK */
123
124#define KEY_LEN_ KEY_LEN
125
126#define tr_sha1_ctx_t_ tr_sha1_ctx_t
127#define tr_rc4_ctx_t_ tr_rc4_ctx_t
128#define tr_dh_ctx_t_ tr_dh_ctx_t
129#define tr_dh_secret_t_ tr_dh_secret_t
130#define tr_crypto_ tr_crypto
131#define tr_cryptoConstruct_ tr_cryptoConstruct
132#define tr_cryptoDestruct_ tr_cryptoDestruct
133#define tr_cryptoSetTorrentHash_ tr_cryptoSetTorrentHash
134#define tr_cryptoGetTorrentHash_ tr_cryptoGetTorrentHash
135#define tr_cryptoHasTorrentHash_ tr_cryptoHasTorrentHash
136#define tr_cryptoComputeSecret_ tr_cryptoComputeSecret
137#define tr_cryptoGetMyPublicKey_ tr_cryptoGetMyPublicKey
138#define tr_cryptoDecryptInit_ tr_cryptoDecryptInit
139#define tr_cryptoDecrypt_ tr_cryptoDecrypt
140#define tr_cryptoEncryptInit_ tr_cryptoEncryptInit
141#define tr_cryptoEncrypt_ tr_cryptoEncrypt
142#define tr_cryptoSecretKeySha1_ tr_cryptoSecretKeySha1
143#define tr_sha1_ tr_sha1
144#define tr_sha1_init_ tr_sha1_init
145#define tr_sha1_update_ tr_sha1_update
146#define tr_sha1_final_ tr_sha1_final
147#define tr_rc4_new_ tr_rc4_new
148#define tr_rc4_free_ tr_rc4_free
149#define tr_rc4_set_key_ tr_rc4_set_key
150#define tr_rc4_process_ tr_rc4_process
151#define tr_dh_new_ tr_dh_new
152#define tr_dh_free_ tr_dh_free
153#define tr_dh_make_key_ tr_dh_make_key
154#define tr_dh_agree_ tr_dh_agree
155#define tr_dh_secret_derive_ tr_dh_secret_derive
156#define tr_dh_secret_free_ tr_dh_secret_free
157#define tr_dh_align_key_ tr_dh_align_key
158#define tr_rand_int_ tr_rand_int
159#define tr_rand_int_weak_ tr_rand_int_weak
160#define tr_rand_buffer_ tr_rand_buffer
161#define tr_ssha1_ tr_ssha1
162#define tr_ssha1_matches_ tr_ssha1_matches
163#define tr_base64_encode_ tr_base64_encode
164#define tr_base64_encode_str_ tr_base64_encode_str
165#define tr_base64_encode_impl_ tr_base64_encode_impl
166#define tr_base64_decode_ tr_base64_decode
167#define tr_base64_decode_str_ tr_base64_decode_str
168#define tr_base64_decode_impl_ tr_base64_decode_impl
169#define tr_sha1_to_hex_ tr_sha1_to_hex
170#define tr_hex_to_sha1_ tr_hex_to_sha1
171
172#endif /* CRYPTO_REFERENCE_CHECK */
173
174#endif /* TR_CRYPTO_TEST_REF_H */
Note: See TracBrowser for help on using the repository browser.