X-Git-Url: http://www.git.cypherpunks.ru/?a=blobdiff_plain;f=src%2Fcypherpunks.ru%2Fgogost%2Fcmd%2Fstreebog256%2Fmain.go;fp=src%2Fcypherpunks.ru%2Fgogost%2Fcmd%2Fgogost-streebog%2Fmain.go;h=7edade2e1249c1a947fcf11f58afd8eca6cda40c;hb=5994afa76e1965002dd953de231059f3d5caf25e;hp=2817a2ac64d00e4cbd49ecb0ce3ff96e945c818c;hpb=f7a4232c6505c16994541bc9c402ab4db4de0bd0;p=gogost.git diff --git a/src/cypherpunks.ru/gogost/cmd/gogost-streebog/main.go b/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 2817a2a..7edade2 100644 --- a/src/cypherpunks.ru/gogost/cmd/gogost-streebog/main.go +++ b/src/cypherpunks.ru/gogost/cmd/streebog256/main.go @@ -14,25 +14,22 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -// 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))) }