secp256k1-zkp/field.cpp

26 lines
739 B
C++
Raw Normal View History

2013-03-30 21:49:09 +01:00
// just one implementation for now
#include "field_5x52.cpp"
2013-03-26 01:39:53 +01:00
2013-03-15 14:47:07 +01:00
namespace secp256k1 {
static const unsigned char field_p_[] = {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFE,0xFF,0xFF,0xFC,0x2F};
2013-03-24 10:38:35 +01:00
FieldConstants::FieldConstants() {
secp256k1_num_init(&field_p);
secp256k1_num_set_bin(&field_p, field_p_, sizeof(field_p_));
}
FieldConstants::~FieldConstants() {
secp256k1_num_free(&field_p);
}
2013-03-15 14:47:07 +01:00
const FieldConstants &GetFieldConst() {
static const FieldConstants field_const;
return field_const;
}
}