commit 36edd148babded2f801437d156262748c7cc86fc
parent c21eaf2ed183c526149cbe497dfd4f4f020e7067
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 29 Jan 2023 20:44:59 -0800
cleanup
Diffstat:
1 file changed, 0 insertions(+), 17 deletions(-)
diff --git a/cmd/torsign/main.go b/cmd/torsign/main.go
@@ -4,14 +4,11 @@ import (
"bytes"
"crypto/ed25519"
"crypto/sha512"
- "encoding/base32"
"encoding/base64"
"flag"
"fmt"
- "golang.org/x/crypto/sha3"
"math/big"
"os"
- "strings"
)
func main() {
@@ -44,20 +41,6 @@ func sign(identityPrivKey, msg []byte) []byte {
return signatureWithESK(msg, identityPrivKey, publickeyFromESK(identityPrivKey))
}
-func addressFromIdentityKey(pub ed25519.PublicKey) string {
- var checksumBytes bytes.Buffer
- checksumBytes.Write([]byte(".onion checksum"))
- checksumBytes.Write(pub)
- checksumBytes.Write([]byte{0x03})
- checksum := sha3.Sum256(checksumBytes.Bytes())
- var onionAddressBytes bytes.Buffer
- onionAddressBytes.Write(pub)
- onionAddressBytes.Write(checksum[:2])
- onionAddressBytes.Write([]byte{0x03})
- addr := strings.ToLower(base32.StdEncoding.EncodeToString(onionAddressBytes.Bytes()))
- return addr + ".onion"
-}
-
var (
b = 256
l = biAdd(biExp(bi(2), bi(252)), biFromStr("27742317777372353535851937790883648493"))