Skip to content

Commit

Permalink
Clear sign conversion warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
noloader committed Sep 29, 2019
1 parent 1190da1 commit 9807a32
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
12 changes: 6 additions & 6 deletions cryptlib.cpp
Expand Up @@ -770,9 +770,9 @@ size_t BufferedTransformation::PeekWord16(word16 &value, ByteOrder order) const
size_t len = Peek(buf, 2);

if (order == BIG_ENDIAN_ORDER)
value = ((word16)buf[0] << 8) | (word16)buf[1];
value = word16((buf[0] << 8) | buf[1]);
else
value = ((word16)buf[1] << 8) | (word16)buf[0];
value = word16((buf[1] << 8) | buf[0]);

return len;
}
Expand All @@ -783,11 +783,11 @@ size_t BufferedTransformation::PeekWord32(word32 &value, ByteOrder order) const
size_t len = Peek(buf, 4);

if (order == BIG_ENDIAN_ORDER)
value = ((word32)buf[0] << 24) | ((word32)buf[1] << 16) |
((word32)buf[2] << 8) | (word32)buf[3];
value = word32((buf[0] << 24) | (buf[1] << 16) |
(buf[2] << 8) | (buf[3] << 0));
else
value = ((word32)buf[3] << 24) | ((word32)buf[2] << 16) |
((word32)buf[1] << 8) | (word32)buf[0];
value = word32((buf[3] << 24) | (buf[2] << 16) |
(buf[1] << 8) | (buf[0] << 0));

return len;
}
Expand Down
6 changes: 4 additions & 2 deletions iterhash.h
Expand Up @@ -159,8 +159,9 @@ class CRYPTOPP_NO_VTABLE IteratedHash : public IteratedHashBase<T_HashWordType,
}

protected:
enum { Blocks = T_BlockSize/sizeof(T_HashWordType) };
T_HashWordType* DataBuf() {return this->m_data;}
FixedSizeSecBlock<T_HashWordType, T_BlockSize/sizeof(T_HashWordType)> m_data;
FixedSizeSecBlock<T_HashWordType, Blocks> m_data;
};

/// \brief Iterated hash with a static transformation function
Expand Down Expand Up @@ -191,8 +192,9 @@ class CRYPTOPP_NO_VTABLE IteratedHashWithStaticTransform
void HashEndianCorrectedBlock(const T_HashWordType *data) {T_Transform::Transform(this->m_state, data);}
void Init() {T_Transform::InitState(this->m_state);}

enum { Blocks = T_BlockSize/sizeof(T_HashWordType) };
T_HashWordType* StateBuf() {return this->m_state;}
FixedSizeAlignedSecBlock<T_HashWordType, T_BlockSize/sizeof(T_HashWordType), T_StateAligned> m_state;
FixedSizeAlignedSecBlock<T_HashWordType, Blocks, T_StateAligned> m_state;
};

#if !defined(__GNUC__) && !defined(__clang__)
Expand Down

0 comments on commit 9807a32

Please sign in to comment.