diff --git a/source/crypto/chacha b/source/crypto/chacha index 4a09e13..4201f08 100644 --- a/source/crypto/chacha +++ b/source/crypto/chacha @@ -231,7 +231,7 @@ namespace gtl { const block_type block = chacha::transform_block(key, initialisation_vector); result = chacha::xor_data(block, data);; ++counter; - for (int i = 0; i < 4; ++i) { + for (unsigned int i = 0; i < 4; ++i) { initialisation_vector.data[i] = unpack_byte(counter, i); } } @@ -240,7 +240,7 @@ namespace gtl { const block_type block = chacha::transform_block(key, initialisation_vector); result = chacha::xor_data(block, data);; ++counter; - for (int i = 0; i < 8; ++i) { + for (unsigned int i = 0; i < 8; ++i) { initialisation_vector.data[i] = unpack_byte(counter, i); } } diff --git a/source/game/mastermind b/source/game/mastermind index 6d843ee..8b83497 100644 --- a/source/game/mastermind +++ b/source/game/mastermind @@ -138,7 +138,7 @@ namespace gtl { } // Select the minimum of the maximums to get the best guess. std::vector::iterator min_element = std::min_element(scores.begin(), scores.end()); - guess = unguessed_codes[std::distance(scores.begin(), min_element)]; + guess = unguessed_codes[static_cast(std::distance(scores.begin(), min_element))]; // Check to see if there is a possible code with the same score, if so, prefer that. const unsigned int min_score = *min_element; for (unsigned int i = 0; i < unguessed_codes.size(); ++i) {