Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/field_5x52_int128_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_INNER5X52_IMPL_H_ | #ifndef SECP256K1_FIELD_INNER5X52_IMPL_H | ||||
#define _SECP256K1_FIELD_INNER5X52_IMPL_H_ | #define SECP256K1_FIELD_INNER5X52_IMPL_H | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#ifdef VERIFY | #ifdef VERIFY | ||||
#define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0) | #define VERIFY_BITS(x, n) VERIFY_CHECK(((x) >> (n)) == 0) | ||||
#else | #else | ||||
#define VERIFY_BITS(x, n) do { } while(0) | #define VERIFY_BITS(x, n) do { } while(0) | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 252 Lines • ▼ Show 20 Lines | SECP256K1_INLINE static void secp256k1_fe_sqr_inner(uint64_t *r, const uint64_t *a) { | ||||
c += t4; | c += t4; | ||||
VERIFY_BITS(c, 49); | VERIFY_BITS(c, 49); | ||||
/* [c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ | /* [c r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ | ||||
r[4] = c; | r[4] = c; | ||||
VERIFY_BITS(r[4], 49); | VERIFY_BITS(r[4], 49); | ||||
/* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ | /* [r4 r3 r2 r1 r0] = [p8 p7 p6 p5 p4 p3 p2 p1 p0] */ | ||||
} | } | ||||
#endif | #endif /* SECP256K1_FIELD_INNER5X52_IMPL_H */ |