Browse Source

gcc compat changes

master
Mike Hamburg 9 years ago
parent
commit
f825fd9b75
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      include/secure_buffer.hxx
  2. +2
    -2
      src/decaf_fast.c
  3. +1
    -1
      src/p25519/f_arithmetic.c

+ 2
- 2
include/secure_buffer.hxx View File

@@ -66,7 +66,7 @@ protected:
public:
/** @brief Read into a Buffer */
virtual inline void read(Buffer &buffer) NOEXCEPT = 0;
virtual void read(Buffer &buffer) NOEXCEPT = 0;
/** @brief Read into a value-passed (eg temporary) TmpBuffer. */
inline void read(TmpBuffer buffer) NOEXCEPT;
@@ -141,7 +141,7 @@ public:
/* Content-wise comparison; constant-time if they are the same length. */
inline decaf_bool_t operator==(const Block &b) const NOEXCEPT {
return ~(*this == b);
return ~(*this != b);
}

/** Virtual destructor for SecureBlock. TODO: probably means vtable? Make bool? */


+ 2
- 2
src/decaf_fast.c View File

@@ -67,7 +67,7 @@ extern const point_t API_NS(point_base);

/* Projective Niels coordinates */
typedef struct { gf a, b, c; } niels_s, niels_t[1];
typedef struct { niels_t n; gf z; } pniels_s, pniels_t[1];
typedef struct { niels_t n; gf z; } __attribute__((aligned(32))) pniels_s, pniels_t[1]; /* MAGIC alignment */

/* Precomputed base */
struct precomputed_s { niels_t table [DECAF_COMBS_N<<(DECAF_COMBS_T-1)]; };
@@ -1387,7 +1387,7 @@ void API_NS(precomputed_scalarmul) (
constant_time_lookup_xx_niels(ni, &table->table[j<<(t-1)], 1<<(t-1), tab);

cond_neg_niels(ni, invert);
if ((i!=s-1)||j) {
if ((i!=(int)s-1)||j) {
add_niels_to_pt(out, ni, j==n-1 && i);
} else {
niels_to_pt(out, ni);


+ 1
- 1
src/p25519/f_arithmetic.c View File

@@ -54,7 +54,7 @@ field_isr (
st[0][0] = st[1][0] = st[2][0] = x[0];
unsigned int i;
for (i=0; i<sizeof(ops)/sizeof(ops[0]); i++) {
field_sqrn(tmp1, st[1^i&1], ops[i].sh);
field_sqrn(tmp1, st[1^(i&1)], ops[i].sh);
field_mul(tmp2, tmp1, st[ops[i].idx]);
st[i&1][0] = tmp2[0];
}


Loading…
Cancel
Save