migrating to realy.mleku.dev
can't extend realy.lol beyond september 2026, wtf
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package encryption
|
||||
|
||||
import (
|
||||
"realy.lol/lol"
|
||||
"realy.mleku.dev/lol"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user