SRMP-Public/SRMP/Lidgren.Network/Encryption/NetAESEncryption.cs
2023-05-29 22:23:11 +02:00

38 lines
731 B
C#

using System;
using System.IO;
using System.Security.Cryptography;
namespace Lidgren.Network
{
public class NetAESEncryption : NetCryptoProviderBase
{
public NetAESEncryption(NetPeer peer)
#if UNITY
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider())
#endif
{
}
public NetAESEncryption(NetPeer peer, string key)
#if UNITY
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider())
#endif
{
SetKey(key);
}
public NetAESEncryption(NetPeer peer, byte[] data, int offset, int count)
#if UNITY
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider())
#endif
{
SetKey(data, offset, count);
}
}
}