Skip to content

Commit

Permalink
Small fix for close socket.
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdanadnan committed Aug 17, 2018
1 parent 02f5e35 commit 4fc7a5f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
11 changes: 4 additions & 7 deletions hash/argon2/argon2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,18 @@ argon2::argon2(argon2_blocks_filler_ptr filler, void *seed_memory, void *user_da
__user_data = user_data;
}

vector<string> argon2::generate_hashes(const argon2profile &profile, const string &base, string &salt_) {
vector<string> argon2::generate_hashes(const argon2profile &profile, const string &base, string salt_) {
vector<string> result;
vector<string> salts;

uint8_t blockhash[ARGON2_PREHASH_SEED_LENGTH];
uint8_t raw_hash[ARGON2_RAW_LENGTH];

for(int i=0;i<__threads;i++) {
string salt;
string salt = salt_;

if(salt_.empty()) {
salt = salt_ = __make_salt();
}
else {
salt = salt_;
if(salt.empty()) {
salt = __make_salt();
}
salts.push_back(salt);

Expand Down
2 changes: 1 addition & 1 deletion hash/argon2/argon2.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class argon2 {
public:
argon2(argon2_blocks_filler_ptr filler, void *seed_memory, void *user_data);

vector<string> generate_hashes(const argon2profile &profile, const string &base, string &salt_);
vector<string> generate_hashes(const argon2profile &profile, const string &base, string salt_);

void set_seed_memory(uint8_t *memory);
void set_seed_memory_offset(size_t offset);
Expand Down

0 comments on commit 4fc7a5f

Please sign in to comment.