migrating to realy.mleku.dev

can't extend realy.lol beyond september 2026, wtf
This commit is contained in:
2025-04-10 12:32:52 -01:06
parent 9a56f78808
commit ff4df430d9
344 changed files with 1081 additions and 967 deletions

View File

@@ -9,8 +9,8 @@ import (
"lukechampine.com/frand"
"realy.lol/hex"
"realy.lol/p256k"
"realy.mleku.dev/hex"
"realy.mleku.dev/p256k"
)
// ComputeSharedSecret returns a shared secret key used to encrypt messages. The private and public keys should be hex

View File

@@ -12,7 +12,7 @@ import (
"golang.org/x/crypto/chacha20"
"golang.org/x/crypto/hkdf"
"realy.lol/sha256"
"realy.mleku.dev/sha256"
)
const (
@@ -93,7 +93,8 @@ func Encrypt(plaintext string, conversationKey []byte,
// Decrypt data that has been encoded using a provided symmetric conversation
// key using NIP-44 encryption (chacha20 cipher stream and sha256 HMAC).
func Decrypt(b64ciphertextWrapped string, conversationKey []byte) (plaintext string, err error) {
func Decrypt(b64ciphertextWrapped string, conversationKey []byte) (plaintext string,
err error) {
cLen := len(b64ciphertextWrapped)
if cLen < 132 || cLen > 87472 {
err = errorf.E("invalid payload length: %d", cLen)

View File

@@ -9,12 +9,13 @@ import (
"github.com/stretchr/testify/assert"
"realy.lol/hex"
"realy.lol/keys"
"realy.lol/sha256"
"realy.mleku.dev/hex"
"realy.mleku.dev/keys"
"realy.mleku.dev/sha256"
)
func assertCryptPriv(t *testing.T, sk1, sk2, conversationKey, salt, plaintext, expected string) {
func assertCryptPriv(t *testing.T,
sk1, sk2, conversationKey, salt, plaintext, expected string) {
var (
k1, s []byte
actual, decrypted string
@@ -1162,7 +1163,8 @@ func TestMaxLength(t *testing.T) {
)
}
func assertCryptPub(t *testing.T, sk1, pub2, conversationKey, salt, plaintext, expected string) {
func assertCryptPub(t *testing.T,
sk1, pub2, conversationKey, salt, plaintext, expected string) {
var (
k1, s []byte
actual, decrypted string

View File

@@ -1,7 +1,7 @@
package encryption
import (
"realy.lol/lol"
"realy.mleku.dev/lol"
)
var (