bugfix FieldElem::SetHex

This commit is contained in:
Pieter Wuille committed 2013-03-11 01:35:46 +01:00
1 parent 4e0ed53985
commit cd31bf9ad2
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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);
}
+1 -1
View File
@@ -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);