This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
-published by the Free Software Foundation, either version 3 of the
-License, or (at your option) any later version.
+the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
results := make(chan []byte)
for ; i < jobs; i++ {
go func(i int) {
- saltBuf := make([]byte, 8)
- binary.BigEndian.PutUint64(saltBuf, uint64(i))
- results <- B(hasher(), passwd, append(salt, saltBuf...), sCost, tCost)
+ saltBuf := make([]byte, len(salt)+8)
+ copy(saltBuf, salt)
+ binary.BigEndian.PutUint64(saltBuf[len(salt):], uint64(i))
+ results <- B(hasher(), passwd, saltBuf, uint64(sCost), uint64(tCost))
}(i)
}
h := hasher()