only:m74.9 seed/key

This commit is contained in:
rusefillc 2023-11-28 20:52:08 -05:00
parent ac94cb42a8
commit 54c850c718
1 changed files with 6 additions and 1 deletions

View File

@ -5,6 +5,10 @@ import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class SeedKeyTest {
public static final int BOOTLOADER_SECRET = 0xB24F5249;
public static final int SECRET = 0x57649392;
public static int Uds_Security_CalcKey(int secret, int seed, int rnd) {
if (rnd < 220)
rnd += 35;
@ -22,6 +26,7 @@ public class SeedKeyTest {
@Test
public void testAssert() {
assertEquals(0xC42F15AE, Uds_Security_CalcKey(0xB24F5249, 0x5D8A2010, 0xF0));
assertEquals(0xC42F15AE, Uds_Security_CalcKey(BOOTLOADER_SECRET, 0x5D8A2010, 0xF0));
assertEquals(0x001B6F78, Uds_Security_CalcKey(SECRET, 0x5DA0B808, 0xA4));
}
}