diff --git a/PKHeX.Core/PKM/Util/PokeCrypto.cs b/PKHeX.Core/PKM/Util/PokeCrypto.cs index ebe4cefaa..fbd6e69f3 100644 --- a/PKHeX.Core/PKM/Util/PokeCrypto.cs +++ b/PKHeX.Core/PKM/Util/PokeCrypto.cs @@ -158,7 +158,7 @@ public static byte[] DecryptArray8A(Span ekm) /// Encrypts a Gen8 pkm byte array. /// /// Decrypted Pokémon data. - public static byte[] EncryptArray8(Span pkm) + public static byte[] EncryptArray8(ReadOnlySpan pkm) { uint pv = ReadUInt32LittleEndian(pkm); uint sv = pv >> 13 & 31; @@ -172,7 +172,7 @@ public static byte[] EncryptArray8(Span pkm) /// Encrypts a Gen8 pkm byte array. /// /// Decrypted Pokémon data. - public static byte[] EncryptArray8A(Span pkm) + public static byte[] EncryptArray8A(ReadOnlySpan pkm) { uint pv = ReadUInt32LittleEndian(pkm); uint sv = pv >> 13 & 31; @@ -201,7 +201,7 @@ public static byte[] DecryptArray6(Span ekm) /// Encrypts a 232 byte + party stat byte array. /// /// Decrypted Pokémon data. - public static byte[] EncryptArray6(Span pkm) + public static byte[] EncryptArray6(ReadOnlySpan pkm) { uint pv = ReadUInt32LittleEndian(pkm); uint sv = pv >> 13 & 31; @@ -231,7 +231,7 @@ public static byte[] DecryptArray45(Span ekm) /// /// Decrypted Pokémon data. /// Encrypted Pokémon data. - public static byte[] EncryptArray45(Span pkm) + public static byte[] EncryptArray45(ReadOnlySpan pkm) { uint pv = ReadUInt32LittleEndian(pkm); uint chk = ReadUInt16LittleEndian(pkm[6..]); @@ -330,7 +330,7 @@ public static byte[] DecryptArray3(Span ekm) /// Un-shuffled data. /// Block order shuffle value /// Un-shuffled data. - private static byte[] ShuffleArray3(Span data, uint sv) + private static byte[] ShuffleArray3(ReadOnlySpan data, uint sv) { byte[] sdata = data.ToArray(); uint index = sv * 4; @@ -350,7 +350,7 @@ private static byte[] ShuffleArray3(Span data, uint sv) /// /// Decrypted data. /// Encrypted data. - public static byte[] EncryptArray3(Span pkm) + public static byte[] EncryptArray3(ReadOnlySpan pkm) { Debug.Assert(pkm.Length is SIZE_3PARTY or SIZE_3STORED);