Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/field_impl.h
/********************************************************************** | /********************************************************************** | ||||
* Copyright (c) 2013, 2014 Pieter Wuille * | * Copyright (c) 2013, 2014 Pieter Wuille * | ||||
* Distributed under the MIT software license, see the accompanying * | * Distributed under the MIT software license, see the accompanying * | ||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.* | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* | ||||
**********************************************************************/ | **********************************************************************/ | ||||
#ifndef _SECP256K1_FIELD_IMPL_H_ | #ifndef SECP256K1_FIELD_IMPL_H | ||||
#define _SECP256K1_FIELD_IMPL_H_ | #define SECP256K1_FIELD_IMPL_H | ||||
#if defined HAVE_CONFIG_H | #if defined HAVE_CONFIG_H | ||||
#include "libsecp256k1-config.h" | #include "libsecp256k1-config.h" | ||||
#endif | #endif | ||||
#include "util.h" | #include "util.h" | ||||
#if defined(USE_FIELD_10X26) | #if defined(USE_FIELD_10X26) | ||||
▲ Show 20 Lines • Show All 290 Lines • ▼ Show 20 Lines | #ifndef USE_NUM_NONE | ||||
secp256k1_num_set_bin(&m, prime, 32); | secp256k1_num_set_bin(&m, prime, 32); | ||||
return secp256k1_num_jacobi(&n, &m) >= 0; | return secp256k1_num_jacobi(&n, &m) >= 0; | ||||
#else | #else | ||||
secp256k1_fe r; | secp256k1_fe r; | ||||
return secp256k1_fe_sqrt(&r, a); | return secp256k1_fe_sqrt(&r, a); | ||||
#endif | #endif | ||||
} | } | ||||
#endif | #endif /* SECP256K1_FIELD_IMPL_H */ |