]> Cypherpunks.ru repositories - balloon.git/blobdiff - balloon.go
Forbid any later GNU GPL versions autousage
[balloon.git] / balloon.go
index f0d8390f75790687e55dc2a24d36a8768668c876..179d570f22a04b2be8e68541909138956a6aa580 100644 (file)
@@ -4,8 +4,7 @@ Copyright (C) 2016-2019 Sergey Matveev <stargrave@stargrave.org>
 
 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
@@ -141,9 +140,10 @@ func H(hasher func() hash.Hash, passwd, salt []byte, sCost, tCost int, jobs int)
        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()