precomputed_ecmult.h
1 /***************************************************************************************************** 2 * Copyright (c) 2013, 2014, 2017, 2021 Pieter Wuille, Andrew Poelstra, Jonas Nick, Russell O'Connor * 3 * Distributed under the MIT software license, see the accompanying * 4 * file COPYING or https://www.opensource.org/licenses/mit-license.php. * 5 *****************************************************************************************************/ 6 7 #ifndef SECP256K1_PRECOMPUTED_ECMULT_H 8 #define SECP256K1_PRECOMPUTED_ECMULT_H 9 10 #ifdef __cplusplus 11 extern "C" { 12 #endif 13 14 #include "ecmult.h" 15 #include "group.h" 16 #include "util_local_visibility.h" 17 18 #if defined(EXHAUSTIVE_TEST_ORDER) 19 # if EXHAUSTIVE_TEST_ORDER == 7 20 # define WINDOW_G 3 21 # elif EXHAUSTIVE_TEST_ORDER == 13 22 # define WINDOW_G 4 23 # elif EXHAUSTIVE_TEST_ORDER == 199 24 # define WINDOW_G 8 25 # else 26 # error No known generator for the specified exhaustive test group order. 27 # endif 28 static secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)]; 29 static secp256k1_ge_storage secp256k1_pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)]; 30 #else /* !defined(EXHAUSTIVE_TEST_ORDER) */ 31 # define WINDOW_G ECMULT_WINDOW_SIZE 32 SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_pre_g[ECMULT_TABLE_SIZE(WINDOW_G)]; 33 SECP256K1_LOCAL_VAR const secp256k1_ge_storage secp256k1_pre_g_128[ECMULT_TABLE_SIZE(WINDOW_G)]; 34 #endif /* defined(EXHAUSTIVE_TEST_ORDER) */ 35 36 #ifdef __cplusplus 37 } 38 #endif 39 40 #endif /* SECP256K1_PRECOMPUTED_ECMULT_H */