Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/field.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_ | #ifndef SECP256K1_FIELD_H | ||||
#define _SECP256K1_FIELD_ | #define SECP256K1_FIELD_H | ||||
/** Field element module. | /** Field element module. | ||||
* | * | ||||
* Field elements can be represented in several ways, but code accessing | * Field elements can be represented in several ways, but code accessing | ||||
* it (and implementations) need to take certain properties into account: | * it (and implementations) need to take certain properties into account: | ||||
* - Each field element can be normalized or not. | * - Each field element can be normalized or not. | ||||
* - Each field element has a magnitude, which represents how far away | * - Each field element has a magnitude, which represents how far away | ||||
* its representation is away from normalization. Normalized elements | * its representation is away from normalization. Normalized elements | ||||
▲ Show 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | |||||
static void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a); | static void secp256k1_fe_from_storage(secp256k1_fe *r, const secp256k1_fe_storage *a); | ||||
/** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. */ | /** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. */ | ||||
static void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag); | static void secp256k1_fe_storage_cmov(secp256k1_fe_storage *r, const secp256k1_fe_storage *a, int flag); | ||||
/** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. */ | /** If flag is true, set *r equal to *a; otherwise leave it. Constant-time. */ | ||||
static void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag); | static void secp256k1_fe_cmov(secp256k1_fe *r, const secp256k1_fe *a, int flag); | ||||
#endif | #endif /* SECP256K1_FIELD_H */ |