Skip to content

Commit

Permalink
Example corrections
Browse files Browse the repository at this point in the history
  • Loading branch information
teqdruid committed Jul 17, 2012
1 parent 46e0be8 commit f85568e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Expand Up @@ -27,11 +27,12 @@ struct ScalarDist {
double operator()(T a, T b) {
assert(!isnan(a));
assert(!isnan(b));
return sqrt(pow((double)a, 2) + pow((double)b, 2));
return fabs(a - b);
}
};

// ...
// The first two specify the oracle data type and distance function.
// The last two are the same but for the side-channel trace.
SVF::SVF<int, ScalarDist, int, ScalarDist> svf;

for (size_t i=0; i<1000; i++) {
Expand All @@ -55,7 +56,7 @@ struct ScalarDist {
double operator()(T a, T b) {
assert(!isnan(a));
assert(!isnan(b));
return sqrt(pow((double)a, 2) + pow((double)b, 2));
return fbs(a - b);
}
};
Expand Down

0 comments on commit f85568e

Please sign in to comment.