bugfix FieldElem::SetHex
This commit is contained in:
parent
4e0ed53985
commit
cd31bf9ad2
2
field.h
2
field.h
|
@ -373,7 +373,7 @@ public:
|
|||
0, 0, 0, 0, 0, 0, 0,0,0,0,0,0,0,0,0,0};
|
||||
for (int i=0; i<32; i++) {
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ void test_point_times_order(const GroupElemJac &point) {
|
|||
|
||||
void test_run_point_times_order() {
|
||||
Context ctx;
|
||||
FieldElem x; x.SetHex("0000000000000000000000000000000000000000000000000000000000000002");
|
||||
FieldElem x; x.SetHex("02");
|
||||
for (int i=0; i<500; i++) {
|
||||
GroupElemJac j; j.SetCompressed(x, true);
|
||||
test_point_times_order(j);
|
||||
|
|
Loading…
Reference in New Issue