public void Setup()
        {
            cryptoChannelStore = new CryptoDtoChannelStore();
            cryptoChannelStore.CreateChannel("Benchmark");
            var dto = new BenchmarkDto()
            {
                Callsign        = "Benchmark",
                SequenceCounter = 0,
                Audio           = new byte[200],
                LastPacket      = false
            };
            Random rnd = new Random();

            rnd.NextBytes(dto.Audio);
            MemoryStream ms = new MemoryStream();

            MessagePackSerializer.Serialize(ms, dto);

            cryptoChannelStore.TryGetChannel("Benchmark", out var channel);
            var config = channel.GetRemoteEndpointChannelConfig();

            remoteChannel = new CryptoDtoChannel(config);

            cryptoDtoPacket = serializer.Serialize(cryptoChannelStore, "Benchmark", CryptoDtoMode.ChaCha20Poly1305, dto);
        }
        public void Setup()
        {
            cryptoChannelStore = new CryptoDtoChannelStore();
            cryptoChannelStore.CreateChannel("Benchmark");
            dto = new BenchmarkDto()
            {
                Callsign        = "Benchmark",
                SequenceCounter = 0,
                Audio           = new byte[200],
                LastPacket      = false
            };
            Random rnd = new Random();

            rnd.NextBytes(dto.Audio);
        }
Ejemplo n.º 3
0
        public void Setup()
        {
            cryptoChannelStore = new CryptoDtoChannelStore();
            cryptoChannelStore.CreateChannel("Benchmark");
            var dto = new BenchmarkDto()
            {
                Callsign        = "Benchmark",
                SequenceCounter = 0,
                Audio           = new byte[200],
                LastPacket      = false
            };
            Random rnd = new Random();

            rnd.NextBytes(dto.Audio);
            MemoryStream ms = new MemoryStream();

            MessagePackSerializer.Serialize(ms, dto);
            dtoBytes      = ms.ToArray();
            typeNameBytes = Encoding.UTF8.GetBytes(nameof(BenchmarkDto));
        }