Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing warnings #30

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/echo/echo-client/echo-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -464,4 +464,3 @@ int main(int argc, char *argv[])
return ok ? 0 : 1;
}

#include "echo-common.c"
20 changes: 17 additions & 3 deletions src/crypto/donna/poly1305-donna.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,23 @@
#else

/* auto detect between 32bit / 64bit */
#define HAS_SIZEOF_INT128_64BIT (defined(__SIZEOF_INT128__) && defined(__LP64__))
#define HAS_MSVC_64BIT (defined(_MSC_VER) && defined(_M_X64))
#define HAS_GCC_4_4_64BIT (defined(__GNUC__) && defined(__LP64__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))))
#if (defined(__SIZEOF_INT128__) && defined(__LP64__))
#define HAS_SIZEOF_INT128_64BIT 1
#else
#define HAS_SIZEOF_INT128_64BIT 0
#endif

#if (defined(_MSC_VER) && defined(_M_X64))
#define HAS_MSVC_64BIT 1
#else
#define HAS_MSVC_64BIT 0
#endif

#if (defined(__GNUC__) && defined(__LP64__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4))))
#define HAS_GCC_4_4_64BIT 1
#else
#define HAS_GCC_4_4_64BIT 0
#endif

#if (HAS_SIZEOF_INT128_64BIT || HAS_MSVC_64BIT || HAS_GCC_4_4_64BIT)
#include "poly1305-donna-64.h"
Expand Down
6 changes: 3 additions & 3 deletions src/crypto/goldilocks/src/include/intrinsics.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ INTRINSIC ssereg xop_rotate(int amount, ssereg x) {
* @brief Detect platform features and return them as a flagfield int.
*/
extern_c
unsigned int crandom_detect_features();
unsigned int crandom_detect_features(void);
/** @endcond */

#ifndef likely
Expand All @@ -219,7 +219,7 @@ unsigned int crandom_detect_features();
* Equivalent to:
* ret = *target; if (*target == old) *target = new; return ret;
*
* @param [inout] target The volatile memory area to be CAS'd
* @param [in,out] target The volatile memory area to be CAS'd
* @param [in] old The expected old value of the target.
* @param [in] new A value to replace the target on success.
*/
Expand All @@ -238,7 +238,7 @@ compare_and_swap (
* Equivalent to:
* if (*target == old) { *target = new; return nonzero; } else { return 0; }
*
* @param [inout] target The volatile memory area to be CAS'd
* @param [in,out] target The volatile memory area to be CAS'd
* @param [in] old The expected old value of the target.
* @param [in] new A value to replace the target on success.
*/
Expand Down
16 changes: 8 additions & 8 deletions src/crypto/goldilocks/src/include/scalarmul.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ montgomery_ladder (
*
* Currently the scalar is always exactly 448 bits long.
*
* @param [inout] working The point to multply.
* @param [in,out] working The point to multply.
* @param [in] scalar The scalar, in little-endian form.
*/
void
Expand All @@ -125,7 +125,7 @@ scalarmul (
* for microbenchmarking, to see how much constant-time arithmetic
* costs us.
*
* @param [inout] working The point to multply.
* @param [in,out] working The point to multply.
* @param [in] scalar The scalar, in little-endian form.
*/
void
Expand Down Expand Up @@ -209,7 +209,7 @@ scalarmul_fixed_base (
* @warning This function takes variable time. It is intended for
* microbenchmarking.
*
* @param [inout] working The input and output point.
* @param [in,out] working The input and output point.
* @param [in] scalar The scalar.
* @param [in] nbits The number of bits in the scalar
*/
Expand All @@ -226,7 +226,7 @@ scalarmul_vt (
* multiplication (and, more importantly, linear combos)
* using the "windowed non-adjacent form" approach.
*
* @param [out] out The output table. Must have room for 1<<i entries.
* @param [out] out The output table. Must have room for 1\<\<i entries.
* @param [in] base The base point.
* @param [in] tbits The number of bits to put in the table.
*
Expand Down Expand Up @@ -271,7 +271,7 @@ scalarmul_fixed_base_wnaf_vt (
* @warning This function takes variable time. It is intended for
* signature verification.
*
* @param [inout] working The output point, and also the variable input.
* @param [in,out] working The output point, and also the variable input.
* @param [in] scalar_var The scalar for the variable input.
* @param [in] nbits_var The number of bits in scalar_var.
* @param [in] scalar_pre The scalar for the fixed input.
Expand All @@ -296,13 +296,13 @@ linear_combo_var_fixed_vt (
* @warning This function takes variable time. It is intended for
* signature verification.
*
* @param [out] working The output point.
* @param [out] out The output point.
* @param [in] scalar1 The first scalar.
* @param [in] nbits1 The number of bits in the first scalar.
* @param [in] table1 The first precomputed table.
* @param [in] scalar2 The second scalar.
* @param [in] nbits1 The number of bits in the second scalar.
* @param [in] table1 The second precomputed table.
* @param [in] nbits2 The number of bits in the second scalar.
* @param [in] table2 The second precomputed table.
*
* @retval MASK_SUCCESS Success.
* @retval MASK_FAILURE Failure, because eg the tables are too small.
Expand Down
2 changes: 1 addition & 1 deletion src/crypto/sha2/sha256.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void sha256_reset(sha256_context_t *context)
context->h[0] = 0x6a09e667;
context->h[1] = 0xbb67ae85;
context->h[2] = 0x3c6ef372;
context->h[3] = 0xa54ff53a,
context->h[3] = 0xa54ff53a;
context->h[4] = 0x510e527f;
context->h[5] = 0x9b05688c;
context->h[6] = 0x1f83d9ab;
Expand Down
4 changes: 0 additions & 4 deletions src/protocol/handshakestate.c
Original file line number Diff line number Diff line change
Expand Up @@ -1407,12 +1407,8 @@ int noise_handshakestate_write_message
*
* \param state The HandshakeState object.
* \param message Points to the incoming handshake message to be unpacked.
* \param message_size The length of the incoming handshake message in bytes.
* \param payload Points to the buffer to fill with the message payload.
* This can be NULL if the application does not need the message payload.
* \param payload_size On exit, set to the number of bytes that were actually
* written to \a payload.
* \param max_size Maximum payload size that can be written to \a payload.
*
* \sa noise_handshakestate_read_message()
*/
Expand Down
4 changes: 2 additions & 2 deletions src/protocol/hashstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,8 @@ static void noise_hashstate_xor_key(uint8_t *key, size_t key_len, uint8_t value)
* \param key_len The length of the key in bytes.
* \param data1 Points to the first data block.
* \param data1_len The length of the first data block in bytes.
* \param data1 Points to the second data block (may be NULL).
* \param data1_len The length of the second data block in bytes.
* \param data2 Points to the second data block (may be NULL).
* \param data2_len The length of the second data block in bytes.
* \param hash The final output HMAC hash value.
*
* The \a data and \a hash buffers are allowed to overlap, but neither
Expand Down
1 change: 1 addition & 0 deletions src/protocol/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "internal.h"

#if USE_SODIUM
int crypto_aead_aes256gcm_is_available(void);
NoiseCipherState *noise_aesgcm_new_sodium(void);
#endif
#if USE_OPENSSL
Expand Down