Commit 1e246e60 authored by Jack Doerner's avatar Jack Doerner

Added obig_import_opointed, which was missing

parent eb959053
......@@ -125,13 +125,27 @@ void obig_import_onative_signed(obig* x, obliv int64_t y) obliv {
}
}
void obig_import_pointed(obig* x, void* p, size_t s) obliv {
void obig_import_pointed(obig* x, uint8_t* p, size_t s) obliv {
for (size_t ii = 0; ii < x->digits; ii++) {
if (ii < s) {
if (IS_BIG_ENDIAN) {
x->data[x->digits - 1 - ii] = ((uint8_t*) p)[ii];
x->data[x->digits - 1 - ii] = p[ii];
} else {
x->data[ii] = ((uint8_t*) p)[ii];
x->data[ii] = p[ii];
}
} else {
x->data[ii] = 0;
}
}
}
void obig_import_opointed(obig* x, obliv uint8_t* p, size_t s) obliv {
for (size_t ii = 0; ii < x->digits; ii++) {
if (ii < s) {
if (IS_BIG_ENDIAN) {
x->data[x->digits - 1 - ii] = p[ii];
} else {
x->data[ii] = p[ii];
}
} else {
x->data[ii] = 0;
......
......@@ -32,7 +32,8 @@ void obig_one(obig* x) obliv;
void obig_negone(obig* x) obliv;
void obig_import_onative(obig* x, obliv uint64_t y) obliv;
void obig_import_onative_signed(obig* x, obliv int64_t y) obliv;
void obig_import_pointed(obig* x, void* p, size_t s) obliv;
void obig_import_pointed(obig* x, uint8_t* p, size_t s) obliv;
void obig_import_opointed(obig* x, obliv uint8_t* p, size_t s) obliv;
obliv uint64_t obig_export_onative(obig x) obliv;
obliv int64_t obig_export_onative_signed(obig x) obliv;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment