Remove 'using namespace std;'
authorIra W. Snyder <devel@irasnyder.com>
Sat, 27 Oct 2007 21:10:53 +0000 (14:10 -0700)
committerIra W. Snyder <devel@irasnyder.com>
Sat, 27 Oct 2007 21:10:53 +0000 (14:10 -0700)
This is a couple of little fixes so that I can remove the
'using namespace std;' from aes.hpp.

Also, remove some old debugging code from aes.cpp.

Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
aes.cpp
aes.hpp
problem3.cpp

diff --git a/aes.cpp b/aes.cpp
index 883d3b3..dff959e 100644 (file)
--- a/aes.cpp
+++ b/aes.cpp
@@ -421,10 +421,7 @@ void AES::AddRoundKey (byteArray& state, const wordArray& w) const
                byteArray wBytes = word2bytes (w[i]);
 
                for (j=0; j<Nb; ++j)
-               {
-                       //std::printf ("state.at(%d) ^= wBytes.at(%d) -- %.2x ^ %.2x = %.2x\n", i*Nb+j, j, state.at (i*Nb+j), wBytes.at(j), state.at(i*Nb+j) ^ wBytes.at(j));
                        state.at(j*Nb+i) ^= wBytes.at(j);
-               }
        }
 }
 
diff --git a/aes.hpp b/aes.hpp
index 5d2acd8..cbbb730 100644 (file)
--- a/aes.hpp
+++ b/aes.hpp
@@ -5,7 +5,6 @@
 #include <cstdio>
 #include <string>
 #include <iostream>
-using namespace std;
 
 // Byte and Byte Array types
 typedef unsigned char byte;
index df343bd..10651d8 100644 (file)
@@ -4,7 +4,7 @@
 
 int main (int argc, char *argv[])
 {
-       std::ifstream fin ("Problem3.out", ios::binary);
+       std::ifstream fin ("Problem3.out", std::ios::binary);
        int i;
 
        byteArray key;