initial addition of essential crypto, encoders, workflows and LLM instructions

This commit is contained in:
2025-08-20 05:47:06 +01:00
parent f449a9d415
commit b8db587d7b
159 changed files with 36993 additions and 10 deletions

View File

@@ -0,0 +1,35 @@
// Copyright (c) 2015-2016 The btcsuite developers
// Copyright (c) 2015-2017 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package secp256k1
import (
"testing"
"next.orly.dev/pkg/utils"
)
func TestGenerateSharedSecret(t *testing.T) {
secKey1, err := GenerateSecretKey()
if err != nil {
t.Errorf("secret key generation error: %s", err)
return
}
secKey2, err := GenerateSecretKey()
if err != nil {
t.Errorf("secret key generation error: %s", err)
return
}
pubKey1 := secKey1.PubKey()
pubKey2 := secKey2.PubKey()
secret1 := GenerateSharedSecret(secKey1, pubKey2)
secret2 := GenerateSharedSecret(secKey2, pubKey1)
if !utils.FastEqual(secret1, secret2) {
t.Errorf(
"ECDH failed, secrets mismatch - first: %x, second: %x",
secret1, secret2,
)
}
}