From 28ebb1a939ae297f5b95ee50644c3718e9fd7fab Mon Sep 17 00:00:00 2001 From: firealarmss Date: Fri, 21 Mar 2025 00:13:51 -0500 Subject: [PATCH] no need to overcomplicate setting the ARC4 offset --- P25/P25Crypto.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/P25/P25Crypto.cs b/P25/P25Crypto.cs index ad20e8b..a4e82e0 100644 --- a/P25/P25Crypto.cs +++ b/P25/P25Crypto.cs @@ -309,11 +309,8 @@ namespace fnecore.P25 /// private bool ARC4Process(byte[] imbe, P25DUID duid) { - int offset = 256; - - if (duid == P25DUID.LDU1) - offset = 0; - else if (duid == P25DUID.LDU2) + int offset = 0; + if (duid == P25DUID.LDU2) offset = 101; offset += (ksPosition * IMBE_BUF_LEN) + 267 + (ksPosition < 8 ? 0 : 2);