diff --git a/channels/interface.go b/channels/interface.go index 01e4066032f88a52fa9a1e3d118caf799e0beba8..622ee68029ef74a87fd666c3d3a14d6815b72672 100644 --- a/channels/interface.go +++ b/channels/interface.go @@ -12,7 +12,7 @@ import ( "gitlab.com/elixxir/client/cmix/rounds" cryptoBroadcast "gitlab.com/elixxir/crypto/broadcast" cryptoChannel "gitlab.com/elixxir/crypto/channel" - "gitlab.com/xx_network/crypto/signature/rsa" + "gitlab.com/elixxir/crypto/rsa" "gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id/ephemeral" "math" @@ -51,7 +51,7 @@ type Manager interface { // should be wrapped in a function which defines the wire protocol // If the final message, before being sent over the wire, is too long, this will // return an error. The message must be at most 510 bytes long. - SendAdminGeneric(privKey *rsa.PrivateKey, channelID *id.ID, + SendAdminGeneric(privKey rsa.PrivateKey, channelID *id.ID, messageType MessageType, msg []byte, validUntil time.Duration, params cmix.CMIXParams) (cryptoChannel.MessageID, rounds.Round, ephemeral.Id, error) diff --git a/channels/joinedChannel_test.go b/channels/joinedChannel_test.go index d7b9533bde5da00f79b8ad1cd2c8d16340564b70..0e1c812b4a306f425a0e61039ad78abe9b28e923 100644 --- a/channels/joinedChannel_test.go +++ b/channels/joinedChannel_test.go @@ -17,7 +17,6 @@ import ( "gitlab.com/elixxir/client/storage/versioned" cryptoBroadcast "gitlab.com/elixxir/crypto/broadcast" cryptoChannel "gitlab.com/elixxir/crypto/channel" - "gitlab.com/elixxir/crypto/cmix" "gitlab.com/elixxir/crypto/fastRNG" "gitlab.com/elixxir/crypto/rsa" "gitlab.com/elixxir/ekv" @@ -446,29 +445,9 @@ func Test_makeJoinedChannelKey_Consistency(t *testing.T) { // cryptoBroadcast.NewChannel does but with a smaller RSA key and salt to make // tests run quicker. func newTestChannel(name, description string, rng csprng.Source) ( - *cryptoBroadcast.Channel, *rsa.PrivateKey, error) { - // Uses 128 bits instead of 4096 bits - pk, err := rsa.GenerateKey(rng, 128) - if err != nil { - return nil, nil, err - } - - // Uses 16 bits instead of 512 bits - salt := cmix.NewSalt(rng, 16) - - channelID, err := cryptoBroadcast.NewChannelID( - name, description, salt, rsa.CreatePublicKeyPem(pk.GetPublic())) - if err != nil { - return nil, nil, err - } - - return &cryptoBroadcast.Channel{ - ReceptionID: channelID, - Name: name, - Description: description, - Salt: salt, - RsaPubKey: pk.GetPublic(), - }, pk, nil + *cryptoBroadcast.Channel, rsa.PrivateKey, error) { + c, pk, err := cryptoBroadcast.NewChannel(name, description, 1000, rng) + return c, pk, err } ////////////////////////////////////////////////////////////////////////////////