]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/cmd/streebog256/main.go
gogost-streebog is split to streebog{256,512} by analogy with sha*
[gogost.git] / src / cypherpunks.ru / gogost / cmd / streebog256 / main.go
similarity index 75%
rename from src/cypherpunks.ru/gogost/cmd/gogost-streebog/main.go
rename to src/cypherpunks.ru/gogost/cmd/streebog256/main.go
index 2817a2ac64d00e4cbd49ecb0ce3ff96e945c818c..7edade2e1249c1a947fcf11f58afd8eca6cda40c 100644 (file)
 // You should have received a copy of the GNU General Public License
 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-// Command-line 34.11-2012 hash function.
+// Command-line 34.11-2012 256-bit hash function.
 package main
 
 import (
        "encoding/hex"
        "flag"
        "fmt"
-       "hash"
        "io"
        "os"
 
        "cypherpunks.ru/gogost"
        "cypherpunks.ru/gogost/gost34112012256"
-       "cypherpunks.ru/gogost/gost34112012512"
 )
 
 var (
-       digestSize = flag.Int("size", 256, "Digest size in bits (either 256 or 512)")
-       version    = flag.Bool("version", false, "Print version information")
+       version = flag.Bool("version", false, "Print version information")
 )
 
 func main() {
@@ -41,12 +38,7 @@ func main() {
                fmt.Println(gogost.Version)
                return
        }
-       var h hash.Hash
-       if *digestSize == 256 {
-               h = gost34112012256.New()
-       } else {
-               h = gost34112012512.New()
-       }
+       h := gost34112012256.New()
        io.Copy(h, os.Stdin)
        fmt.Println(hex.EncodeToString(h.Sum(nil)))
 }