bugfix FieldElem::SetHex

pull/11871/head
Pieter Wuille 12 years ago
parent 4e0ed53985
commit cd31bf9ad2

@ -373,7 +373,7 @@ public:
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0}; 0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0};
for (int i=0; i<32; i++) { for (int i=0; i<32; i++) {
if (str.length() > i*2) if (str.length() > i*2)
tmp[i] = (cvt[(unsigned char)str[2*i]] << 4) + cvt[(unsigned char)str[2*i+1]]; tmp[32 - str.length()/2 + i] = (cvt[(unsigned char)str[2*i]] << 4) + cvt[(unsigned char)str[2*i+1]];
} }
SetBytes(tmp); SetBytes(tmp);
} }

@ -62,7 +62,7 @@ void test_point_times_order(const GroupElemJac &point) {
void test_run_point_times_order() { void test_run_point_times_order() {
Context ctx; Context ctx;
FieldElem x; x.SetHex("0000000000000000000000000000000000000000000000000000000000000002"); FieldElem x; x.SetHex("02");
for (int i=0; i<500; i++) { for (int i=0; i<500; i++) {
GroupElemJac j; j.SetCompressed(x, true); GroupElemJac j; j.SetCompressed(x, true);
test_point_times_order(j); test_point_times_order(j);

Loading…
Cancel
Save