Skip to content

Commit

Permalink
main: Print the secret key to stdout if I/O fail
Browse files Browse the repository at this point in the history
This commit lets curvy output the secret key in Base16 to stdout if it
cannot be written to the specified output file.

The reason behind this is, that after an I/O failure, all of the
computing was rendered useless, therefore outputting the secret key on
stdout will not waste the energy.
  • Loading branch information
emilengler committed Feb 13, 2024
1 parent 9834896 commit 4a6f95a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"crypto/ed25519"
"crypto/sha512"
"encoding/base32"
"encoding/hex"
"flag"
"fmt"
"golang.org/x/crypto/sha3"
Expand Down Expand Up @@ -98,6 +99,7 @@ func main() {

err := exportSK(sk, *output)
if err != nil {
fmt.Printf("secret key: %s\n", hex.EncodeToString(sk))
panic(err)
}
}

0 comments on commit 4a6f95a

Please sign in to comment.