You've already forked lidgren-network-gen3
mirror of
https://github.com/lidgren/lidgren-network-gen3.git
synced 2026-05-13 21:56:29 +09:00
Fix workaround for the Unity Web Player.
It pass the unit tests. This fix can have the problem described here: - http://stackoverflow.com/questions/957388/why-are-rijndaelmanaged-and-aescryptoserviceprovider-returning-different-results/4863924#4863924
This commit is contained in:
@@ -7,18 +7,30 @@ namespace Lidgren.Network
|
||||
public class NetAESEncryption : NetCryptoProviderBase
|
||||
{
|
||||
public NetAESEncryption(NetPeer peer)
|
||||
#if UNITY_WEBPLAYER
|
||||
: base(peer, new RijndaelManaged())
|
||||
#else
|
||||
: base(peer, new AesCryptoServiceProvider())
|
||||
#endif
|
||||
{
|
||||
}
|
||||
|
||||
public NetAESEncryption(NetPeer peer, string key)
|
||||
#if UNITY_WEBPLAYER
|
||||
: base(peer, new RijndaelManaged())
|
||||
#else
|
||||
: base(peer, new AesCryptoServiceProvider())
|
||||
#endif
|
||||
{
|
||||
SetKey(key);
|
||||
}
|
||||
|
||||
public NetAESEncryption(NetPeer peer, byte[] data, int offset, int count)
|
||||
#if UNITY_WEBPLAYER
|
||||
: base(peer, new RijndaelManaged())
|
||||
#else
|
||||
: base(peer, new AesCryptoServiceProvider())
|
||||
#endif
|
||||
{
|
||||
SetKey(data, offset, count);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user