Skip to content

Commit

Permalink
Tests - Remove entropy in tests (#507)
Browse files Browse the repository at this point in the history
* Solve entropy in simple case in which a fixed key can be used

* Solve entropy in test type by changing the test spec: removing CypherText and using fixed keys
  • Loading branch information
MatheusFranco99 authored and GalRogozinski committed Dec 19, 2024
1 parent cf804b6 commit 09a1037
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 66 deletions.
Binary file modified ssv/spectest/generate/tests.json.gz
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"Name": "bls secret key encryption",
"SKPem": "LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFcEFJQkFBS0NBUUVBMHlqa1ZKOTBPU1RRcjBXWmZyZjZzd2xRbG5LMEVjUGcvYVdldlBYMmo0eUtHOThYClk5YkxuOFRucS9yZW5vSUdHeVA0bS83RThtVDhTanEzM1BtVzZtT3dDUTM1c2VZU2U4K2hlVjJTWTdMZTZKMEYKeU1wTURBUlpJNllvdzY5Ulg5WXdXVTNxdXZUK0ljZXhtQnloTTNaelhQL3dlbW0rQmJOdUNzb1JZdk5RU3dZLwpqOVUwMGhPZVdiTFcvcTNGM0NDSkIrRUVVbCt1L1lEZUY2Nm8wcEljSEdiNXhMOFBuSFl4R24zUFJGOThORlpkCitQMTdtdFU4Q21vNEc0d0FhNlJCTTF0NUtQbUI5Y1phOHU5NEhKVkNmT3RKZGdTSnVPR2NsSyt5anZLZEFadDEKcWFkMkF5d296OXdyZHJIY2FBWURUUEh0ZnJhUnI4VXdra2gwTVFJREFRQUJBb0lCQUVlUGVpSDdqK1cxeGtzLwo2UTc2eHFsYUpNZDN3L0twVVZ4a2ZuRkhZZkd3RFRYNDJ2Sm8zc1VjYys3aXJBTkh5VTMxV05GMCs4V3gxNVpJClkvc3RVcW5JY3VYK3FIcFRvRHY1VjUzTHlrcWpXY3UzT3ppYTVqN0VVbmswWEdoRXgrMFVwM244WCtwUUVMZmQKOXgrM3hDR3VxTllCbnJ1OWp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KXDw6PLCqPYFdvf+WzMUUtruLr1iM0y+2TPMZL3myun7eAQAAAAAAAAABAAAAAAAAAAAAAwEAAAAAjoAGZVGoGzGCWHCe2vfdH2PNaGoOTbiym7t6z+ZWCGd69aUn2USO5Hg1SF4CtQvARAAAAAIAAAAAAAAADAAAAAAAAAAUAAAApHmwI9nyjrnM3TW7lg+1wmVTDf8Xiufkqbd/AX91nKWiEl5ya94M2SozMAlUlMjAB4Kif6iQfowarePazbjgYUaGxn4fYoMEYF14YeDtmAPGriFrSq5VqP+0nu0ZPL6nRiYR0sWSvfUhTxJP56Ummrc9RO/J5s4avjL4GWrlJt4BAAAAAAAAAAEAAAAAAAAA"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"Messages": [
{
"Signatures": [
"J2w5nI1bm849G/KAFxd8KnkbfpiElj7rnocTttlbYmfJ07xFGIEucVphQ0vm8Z1GltbtgNwtT4x0Dd8dmkHhmWXzWOIqyfwYM9wR256YhgeMtuJt2ZRXTzrWsjyEKl2W/P22RSNinuaZDT90I0bj7DTfFmJsoSpEh7FW96ApufDLxOHt7DvTBeQt/IYs2mP2a7KLM/KEX7LVAOVqdUDITs/xTt3eXfTmgJK1BHo/HC/kqNILgP4RtdTEw5kamPZoKqiZbHFhoCsO9AR1jCVC55TIlgx0F4EGOl7h6nU4H76BwLEp3SMUAtX+MZxbqMTd2ZijBtUXgNtOMBAmUIvdtw=="
"RhZ9EOKkj9RdFYqwF72zDdfechNjIDtIMIf7jfvUa4b3d6/4ODk3J1kBeOrM73RVP6V7OOElU4RJOnxu8g4qEQPU52JPs7V8zvH6HcQd+z7hs2CtnYBWFh1SfxsuzOj0JKgLF3jjO4DxS5mpSfUvU9vVfRhKOfz9oWfFcU4jkrQGnOZsTgXhOlDVZBnclO7UkY5xKUV1iZEZI+cLClZQGSFFl+CDHJaaVEsadsgY9KL0nqIvN3AunE+bAFPQxzw6M2I37lclUYdzHTv4O0jWtfuxneEyBUGUy16F5JrSSlw8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RmM1BtcHV3aGFvM1luL3dMOFJSNk9BakNFUjRLN1JjLzV2bksKanZCaDU3bFNRZjdZRk9kV2ZnbEhjTWNYZndVNStldmFFbVJhaW9vYXpTQnkwMUtvMlJEQnBGL3VFNzdzZGYxQwo2NVRRSnZvS3kyRjBKUWJ2ME9RVFNqVzBDUHcwaFMydk96Qk5VK3ZBRUVYNHdxQmp6M1grUER1OUxid0E1NFdtClVRSURBUUFCCi0tLS0tRU5EIFJTQSBQVUJMSUMgS0VZLS0tLS0K"
]
}
2 changes: 1 addition & 1 deletion types/spectest/generate/tests.json

Large diffs are not rendered by default.

29 changes: 15 additions & 14 deletions types/spectest/tests/encryption/encrypt_bls_sk.go
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
package encryption

import (
"fmt"
"github.com/herumi/bls-eth-go-binary/bls"
"github.com/ssvlabs/ssv-spec/types"
"github.com/ssvlabs/ssv-spec/types/testingutils"
)

// EncryptBLSSK tests encrypting a BLS private key
func EncryptBLSSK() *EncryptionSpecTest {
types.InitBLS()
blsSK := &bls.SecretKey{}
blsSK.SetByCSPRNG()

sk, pk, _ := types.GenerateKey()
pkObj, _ := types.PemToPublicKey(pk)
cipher, _ := types.Encrypt(pkObj, blsSK.Serialize())
ks := testingutils.Testing4SharesSet()

sk := ks.OperatorKeys[1]
skPem := types.PrivateKeyToPem(sk)
pkPem, err := types.GetPublicKeyPem(sk)
if err != nil {
panic(err)
}

blsSK := ks.Shares[1]

fmt.Printf("cipher L: %d\n", len(cipher))
return &EncryptionSpecTest{
Name: "bls secret key encryption",
SKPem: sk,
PKPem: pk,
PlainText: blsSK.Serialize(),
CipherText: cipher,
Name: "bls secret key encryption",
SKPem: skPem,
PKPem: pkPem,
PlainText: blsSK.Serialize(),
}
}
23 changes: 15 additions & 8 deletions types/spectest/tests/encryption/encryption.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ package encryption

import (
"github.com/ssvlabs/ssv-spec/types"
"github.com/ssvlabs/ssv-spec/types/testingutils"
)

// SimpleEncrypt tests simple rsa encrypt
func SimpleEncrypt() *EncryptionSpecTest {
sk, pk, _ := types.GenerateKey()
pkObj, _ := types.PemToPublicKey(pk)
cipher, _ := types.Encrypt(pkObj, []byte("hello world"))

ks := testingutils.Testing4SharesSet()

sk := ks.OperatorKeys[1]
skPem := types.PrivateKeyToPem(sk)
pkPem, err := types.GetPublicKeyPem(sk)
if err != nil {
panic(err)
}

return &EncryptionSpecTest{
Name: "simple encryption",
SKPem: sk,
PKPem: pk,
PlainText: []byte("hello world"),
CipherText: cipher,
Name: "simple encryption",
SKPem: skPem,
PKPem: pkPem,
PlainText: []byte("hello world"),
}
}
17 changes: 6 additions & 11 deletions types/spectest/tests/encryption/test.go
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package encryption

import (
"testing"

"github.com/ssvlabs/ssv-spec/types"
"github.com/stretchr/testify/require"
"testing"
)

type EncryptionSpecTest struct {
Name string
SKPem []byte
PKPem []byte
PlainText []byte
CipherText []byte
Name string
SKPem []byte
PKPem []byte
PlainText []byte
}

func (test *EncryptionSpecTest) TestName() string {
Expand Down Expand Up @@ -39,9 +39,4 @@ func (test *EncryptionSpecTest) Run(t *testing.T) {
plain, err := types.Decrypt(sk, cipher)
require.NoError(t, err)
require.EqualValues(t, test.PlainText, plain)

// decrypt test's cipher and compare to plain text
plain2, err := types.Decrypt(sk, test.CipherText)
require.NoError(t, err)
require.EqualValues(t, test.PlainText, plain2)
}
13 changes: 1 addition & 12 deletions types/spectest/tests/signedssvmsg/encoding.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package signedssvmsg

import (
"github.com/ssvlabs/ssv-spec/types"
"github.com/ssvlabs/ssv-spec/types/testingutils"
)

Expand All @@ -10,17 +9,7 @@ func Encoding() *EncodingTest {

ks := testingutils.Testing4SharesSet()

// RSA key to sign message
skByts, _, err := types.GenerateKey()
if err != nil {
panic(err.Error())
}
sk, err := types.PemToPrivateKey(skByts)
if err != nil {
panic(err.Error())
}

msg := testingutils.TestingSignedSSVMessage(ks.Shares[1], 1, sk)
msg := testingutils.TestingSignedSSVMessage(ks.Shares[1], 1, ks.OperatorKeys[1])

byts, err := msg.Encode()
if err != nil {
Expand Down
13 changes: 4 additions & 9 deletions types/spectest/tests/signedssvmsg/valid.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,18 @@ func Valid() *SignedSSVMessageTest {

ks := testingutils.Testing4SharesSet()

// RSA key to sign message
skByts, pkByts, err := types.GenerateKey()
pkBytes, err := types.GetPublicKeyPem(ks.OperatorKeys[1])
if err != nil {
panic(err.Error())
}
sk, err := types.PemToPrivateKey(skByts)
if err != nil {
panic(err.Error())
panic(err)
}

msg := testingutils.TestingSignedSSVMessage(ks.Shares[1], 1, sk)
msg := testingutils.TestingSignedSSVMessage(ks.Shares[1], 1, ks.OperatorKeys[1])

return &SignedSSVMessageTest{
Name: "valid",
Messages: []*types.SignedSSVMessage{
msg,
},
RSAPublicKey: [][]byte{pkByts},
RSAPublicKey: [][]byte{pkBytes},
}
}

0 comments on commit 09a1037

Please sign in to comment.