#include <config.h>
#include <sio/sio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <crypt.h>
#include <sw.h>
#include <types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
Defines | |
#define | PORT "/dev/ttyS0" |
Functions | |
void | hal_init (void) |
Initializes the HAL. More... | |
void | hal_destroy (void) |
bool | hal_eeprom_read (iu8 *dst, iu16 src, iu8 len) |
Read data from EEPROM. More... | |
bool | hal_eeprom_write (iu16 dst, iu8 *src, iu8 len) |
Write data to EEPROM. More... | |
void | hal_io_sendByteT0 (iu8 b) |
Send a byte with T=0 error detection and recovery. More... | |
iu8 | hal_io_recByteT0 (void) |
Receive a byte with T=0 error detection and recovery. More... | |
bool | hal_rnd_getBlock (iu8 *dst) |
Returns 8 random bytes. More... | |
Variables | |
iu8 | eeprom [1 *1024] |
int | halsend |
|
|
|
|
|
Read data from EEPROM. The internal EEPROM begins at address 0, the external EEPROM is located subsequently.
|
|
Write data to EEPROM. The internal EEPROM begins at address 0, the external EEPROM is located subsequently.
|
|
Initializes the HAL. Must be called after each reset. |
|
Receive a byte with T=0 error detection and recovery. Currently only 9600 bps at 3.58MHz with direct convention is supported.
|
|
Send a byte with T=0 error detection and recovery. Currently only 9600 bps at 3.58MHz with direct convention is supported.
|
|
Returns 8 random bytes. The current AVR implementation does not produce real random numbers, but pseudo random numbers. These are produced by a X9.17 generator modified to use a counter instead of a timer. The state of this PRNG is held at RAND_STATE_ADDR. The start value (at least the key) at this address should be unique for every card.
|
|
|
|
|