MIKAI
Library to modify content of a Mykey
Functions
mykey.c File Reference
#include <stdint.h>
#include <string.h>
#include <mikai/mikai.h>
#include <mikai-internal.h>
#include <mikai-error.h>
#include <srix.h>

Go to the source code of this file.

Functions

void calculateEncryptionKey (MyKey key[static 1])
 Calculate the encryption key and save the result in mikai struct. More...
 
uint32_t MyKeyGetEncryptionKey (MyKey key[static 1])
 
bool MyKeyIsReset (MyKey *key)
 Check if a MyKey is reset (if it hasn't an associated vendor code). More...
 
bool MyKeyCheckLockID (MyKey key[static 1])
 
uint32_t MyKeyGetBlock (MyKey key[static 1], uint8_t blockNum)
 
void MyKeyModifyBlock (MyKey key[static 1], uint32_t block, uint8_t blockNum)
 
void MyKeyImportVendor (MyKey key[static 1], const uint32_t vendor)
 
int MyKeyExportVendor (MyKey key[static 1], uint32_t vendor[static 1])
 
void MyKeyExportMemory (MyKey key[static 1], uint32_t dump[const SRIX4K_BLOCKS], uint64_t *uid)
 
void MyKeyReset (MyKey key[static 1])
 
uint16_t MyKeyGetCurrentCredit (MyKey key[static 1])
 
int MyKeyAddCents (MyKey key[static 1], uint16_t cents, uint8_t day, uint8_t month, uint8_t year)
 
int MyKeySetCents (MyKey key[static 1], uint16_t cents, uint8_t day, uint8_t month, uint8_t year)
 

Function Documentation

◆ calculateEncryptionKey()

void calculateEncryptionKey ( MyKey  key[static 1])

Calculate the encryption key and save the result in mikai struct.

Parameters
keypointer to mikai data struct

Definition at line 104 of file mykey.c.

◆ MyKeyAddCents()

int MyKeyAddCents ( MyKey  key[static 1],
uint16_t  cents,
uint8_t  day,
uint8_t  month,
uint8_t  year 
)

Definition at line 373 of file mykey.c.

◆ MyKeyCheckLockID()

bool MyKeyCheckLockID ( MyKey  key[static 1])

Definition at line 138 of file mykey.c.

◆ MyKeyExportMemory()

void MyKeyExportMemory ( MyKey  key[static 1],
uint32_t  dump[const SRIX4K_BLOCKS],
uint64_t *  uid 
)

Definition at line 218 of file mykey.c.

◆ MyKeyExportVendor()

int MyKeyExportVendor ( MyKey  key[static 1],
uint32_t  vendor[static 1] 
)

Definition at line 200 of file mykey.c.

◆ MyKeyGetBlock()

uint32_t MyKeyGetBlock ( MyKey  key[static 1],
uint8_t  blockNum 
)

Definition at line 156 of file mykey.c.

◆ MyKeyGetCurrentCredit()

uint16_t MyKeyGetCurrentCredit ( MyKey  key[static 1])

Definition at line 367 of file mykey.c.

◆ MyKeyGetEncryptionKey()

uint32_t MyKeyGetEncryptionKey ( MyKey  key[static 1])

Definition at line 127 of file mykey.c.

◆ MyKeyImportVendor()

void MyKeyImportVendor ( MyKey  key[static 1],
const uint32_t  vendor 
)

Definition at line 165 of file mykey.c.

◆ MyKeyIsReset()

bool MyKeyIsReset ( MyKey key)

Check if a MyKey is reset (if it hasn't an associated vendor code).

Parameters
keypointer to MyKey struct
Returns
boolean value, true = there isn't a vendor bound

Definition at line 131 of file mykey.c.

◆ MyKeyModifyBlock()

void MyKeyModifyBlock ( MyKey  key[static 1],
uint32_t  block,
uint8_t  blockNum 
)

Definition at line 161 of file mykey.c.

◆ MyKeyReset()

void MyKeyReset ( MyKey  key[static 1])

Definition at line 226 of file mykey.c.

◆ MyKeySetCents()

int MyKeySetCents ( MyKey  key[static 1],
uint16_t  cents,
uint8_t  day,
uint8_t  month,
uint8_t  year 
)

Definition at line 475 of file mykey.c.