CSPspEmu.Core.Crypto.Kirk.kirk_init C# (CSharp) Method

kirk_init() public method

Initializes kirk
public kirk_init ( ) : void
return void
        public void kirk_init()
        {
            fixed (byte* kirk1_key_ptr = kirk1_key)
            fixed (Crypto.AES_ctx* aes_kirk1_ptr = &_aes_kirk1)
            {
                Crypto.AES_set_key(aes_kirk1_ptr, kirk1_key_ptr, 128);
            }
            IsKirkInitialized = true;
            Random = new Random();
        }

Usage Example

Beispiel #1
0
        public void TestSha1()
        {
            var Kirk = new Kirk();
            Kirk.kirk_init();

            var Input = new byte[] {
                // Size
                0x20, 0x00, 0x00, 0x00,
                // Data
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
            };

            var ExpectedOutput = new byte[]
            {
                0xDE, 0x8A, 0x84, 0x7B, 0xFF, 0x8C, 0x34, 0x3D, 0x69, 0xB8, 0x53, 0xA2,
                0x15, 0xE6, 0xEE, 0x77, 0x5E, 0xF2, 0xEF, 0x96
            };

            var Output = new byte[0x14];

            Assert.AreEqual(0x24, Input.Length);

            fixed (byte* OutputPtr = Output)
            fixed (byte* InputPtr = Input)
            {
                Kirk.KirkSha1(OutputPtr, InputPtr, Input.Length);
            }

            CollectionAssert.AreEqual(ExpectedOutput, Output);
            //Console.WriteLine(BitConverter.ToString(Hash));
        }
All Usage Examples Of CSPspEmu.Core.Crypto.Kirk::kirk_init