Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/scalar_impl.h
/********************************************************************** | /********************************************************************** | ||||
* Copyright (c) 2014 Pieter Wuille * | * Copyright (c) 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_SCALAR_IMPL_H_ | #ifndef SECP256K1_SCALAR_IMPL_H | ||||
#define _SECP256K1_SCALAR_IMPL_H_ | #define SECP256K1_SCALAR_IMPL_H | ||||
#include "group.h" | #include "group.h" | ||||
#include "scalar.h" | #include "scalar.h" | ||||
#if defined HAVE_CONFIG_H | #if defined HAVE_CONFIG_H | ||||
#include "libsecp256k1-config.h" | #include "libsecp256k1-config.h" | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 308 Lines • ▼ Show 20 Lines | static void secp256k1_scalar_split_lambda(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) { | ||||
secp256k1_scalar_mul(&c2, &c2, &minus_b2); | secp256k1_scalar_mul(&c2, &c2, &minus_b2); | ||||
secp256k1_scalar_add(r2, &c1, &c2); | secp256k1_scalar_add(r2, &c1, &c2); | ||||
secp256k1_scalar_mul(r1, r2, &minus_lambda); | secp256k1_scalar_mul(r1, r2, &minus_lambda); | ||||
secp256k1_scalar_add(r1, r1, a); | secp256k1_scalar_add(r1, r1, a); | ||||
} | } | ||||
#endif | #endif | ||||
#endif | #endif | ||||
#endif | #endif /* SECP256K1_SCALAR_IMPL_H */ |