Skip to content

Commit

Permalink
Fixed cube computing bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
ph4r05 committed Jun 25, 2014
1 parent 563c131 commit d22ed69
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions KeccakOptAsm7r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ int KeccakOptAsm7r::evaluate(const unsigned char* input, unsigned char* output)
int KeccakOptAsm7r::evaluate(const unsigned char* input, const unsigned char* key, unsigned char* output) const {
unsigned char in[32] = {0};
unsigned char ou[128] = {0};
memcpy(in, input, 16);
memcpy(in, key, 16);
memcpy(in, input, 16);
memcpy(in+16, key, 16);

spongeState state;
InitSponge(&state, 1024, 576);
Expand Down
5 changes: 3 additions & 2 deletions KeccakOptAsm7r.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
class KeccakOptAsm7r : public ICipher {
private:
unsigned rounds;
unsigned char key[16];

public:
KeccakOptAsm7r();
Expand All @@ -32,10 +33,10 @@ class KeccakOptAsm7r : public ICipher {
virtual int evaluate(const unsigned char *input, const unsigned char *key, unsigned char *output ) const;

inline virtual int prepareKey(const unsigned char * key)
{ return 1; }
{ memcpy(this->key, key, 16); return 1; }

inline virtual int evaluateWithPreparedKey(const unsigned char * input, unsigned char * output) const
{ return evaluate(input, NULL, output); return 1;}
{ return evaluate(input, this->key, output); return 1;}
};

#endif /* KECCAKOPTASM7R_H */
Expand Down

0 comments on commit d22ed69

Please sign in to comment.