Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/scalar_low_impl.h
/********************************************************************** | /********************************************************************** | ||||
* Copyright (c) 2015 Andrew Poelstra * | * Copyright (c) 2015 Andrew Poelstra * | ||||
* 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_REPR_IMPL_H_ | #ifndef SECP256K1_SCALAR_REPR_IMPL_H | ||||
#define _SECP256K1_SCALAR_REPR_IMPL_H_ | #define SECP256K1_SCALAR_REPR_IMPL_H | ||||
#include "scalar.h" | #include "scalar.h" | ||||
#include <string.h> | #include <string.h> | ||||
SECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a) { | SECP256K1_INLINE static int secp256k1_scalar_is_even(const secp256k1_scalar *a) { | ||||
return !(*a & 1); | return !(*a & 1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | static void secp256k1_scalar_split_128(secp256k1_scalar *r1, secp256k1_scalar *r2, const secp256k1_scalar *a) { | ||||
*r1 = *a; | *r1 = *a; | ||||
*r2 = 0; | *r2 = 0; | ||||
} | } | ||||
SECP256K1_INLINE static int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b) { | SECP256K1_INLINE static int secp256k1_scalar_eq(const secp256k1_scalar *a, const secp256k1_scalar *b) { | ||||
return *a == *b; | return *a == *b; | ||||
} | } | ||||
#endif | #endif /* SECP256K1_SCALAR_REPR_IMPL_H */ |