]> Cypherpunks.ru repositories - gogost.git/blobdiff - cmd/streebog256/main.go
Panic on all possible hash write errors
[gogost.git] / cmd / streebog256 / main.go
index 972216802a90f0543407fa644e94e278c1c2a3c7..9db7c477afbf138a497cd25cb48efe14801374bd 100644 (file)
@@ -1,5 +1,5 @@
 // GoGOST -- Pure Go GOST cryptographic functions library
-// Copyright (C) 2015-2019 Sergey Matveev <stargrave@stargrave.org>
+// Copyright (C) 2015-2020 Sergey Matveev <stargrave@stargrave.org>
 //
 // This program is free software: you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -38,6 +38,8 @@ func main() {
                return
        }
        h := gost34112012256.New()
-       io.Copy(h, os.Stdin)
+       if _, err := io.Copy(h, os.Stdin); err != nil {
+               panic(err)
+       }
        fmt.Println(hex.EncodeToString(h.Sum(nil)))
 }