Skip to content

Commit

Permalink
coverity_scan: fixing detected defects
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Dec 4, 2015
1 parent ea84b6d commit 79649b4
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion BGEAttack.cpp
Expand Up @@ -314,7 +314,7 @@ int BGEAttack::deriveBset(Bset & bset, GenericAES & aes, bool permissive){
return 0;
}

NTL::GF2X BGEAttack::characteristicPolynomial(mat_GF2X_t m){
NTL::GF2X BGEAttack::characteristicPolynomial(mat_GF2X_t & m){
// This is recursive function, so if size is 2, return result directly
if (m.n==1){
return m.x[0][0]; // should never reach this point, but lets be defensive
Expand Down
2 changes: 1 addition & 1 deletion BGEAttack.h
Expand Up @@ -293,7 +293,7 @@ class BGEAttack {

protected:
// used internally for comptuting characteristic polynomial
GF2X characteristicPolynomial(mat_GF2X_t m);
GF2X characteristicPolynomial(mat_GF2X_t & m);
};

} /* namespace attack */
Expand Down
2 changes: 2 additions & 0 deletions NTLUtils.cpp
Expand Up @@ -28,13 +28,15 @@ using namespace NTL;

void dumpArray(ostream& out, const char * input, size_t len){
size_t i;
boost::io::ios_flags_saver ifs(out);
for (i=0; i<len; i++) {
out << setw(2) << setfill('0') << hex << ((unsigned int)input[i]&0xff) << " ";
}
}

void dumpVector(NTL::vec_GF2E& a){
unsigned int i, len = a.length();
boost::io::ios_flags_saver ifs(cout);
for (i=0; i<len; i++){
cout << " " << GF2EHEX(a[i]) << " ";
if (((i+1) % 16) == 0) cout << endl;
Expand Down
2 changes: 2 additions & 0 deletions NTLUtils.h
Expand Up @@ -27,6 +27,7 @@
#include <iostream>
#include <sstream>
#include <string>
#include <boost/io/ios_state.hpp>
#include "md5.h"
NTL_CLIENT

Expand Down Expand Up @@ -199,6 +200,7 @@ std::string dumpVector2str(NTL::vec_GF2E& a);

template<typename T> void dumpVectorT(T * a, size_t len){
unsigned int i;
boost::io::ios_flags_saver ifs(cout);
for (i=0; i<len; i++){
cout << " " << CHEX(a[i]) << " ";
if (((i+1) % 16) == 0) cout << endl;
Expand Down

0 comments on commit 79649b4

Please sign in to comment.