diff options
author | Jack Lloyd <[email protected]> | 2019-01-03 09:34:42 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-01-03 09:34:42 -0500 |
commit | 5d3c242b246ea1edf23ab02f578ac55f6dbbd112 (patch) | |
tree | be8b183a799fe8eb0df2572bb3fca4ae1c62fe87 | |
parent | 1d75723faca5df24b405fc3ded50fccea4faee71 (diff) |
Add cast for MSVC
-rw-r--r-- | src/lib/pubkey/newhope/newhope.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/pubkey/newhope/newhope.cpp b/src/lib/pubkey/newhope/newhope.cpp index 1c6a841d5..a6fbc7cdc 100644 --- a/src/lib/pubkey/newhope/newhope.cpp +++ b/src/lib/pubkey/newhope/newhope.cpp @@ -537,7 +537,10 @@ inline void encode_b(uint8_t* r, const poly* b, const poly* c) poly_tobytes(r, b); for(size_t i = 0; i < PARAM_N/4; i++) { - r[NEWHOPE_POLY_BYTES+i] = c->coeffs[4*i] | (c->coeffs[4*i+1] << 2) | (c->coeffs[4*i+2] << 4) | (c->coeffs[4*i+3] << 6); + r[NEWHOPE_POLY_BYTES+i] = static_cast<uint8_t>(c->coeffs[4*i] | + (c->coeffs[4*i+1] << 2) | + (c->coeffs[4*i+2] << 4) | + (c->coeffs[4*i+3] << 6)); } } |