cd5
===

Quick and dirty program to compute checksum of individual track

It reports for each track:
 - size (read)
 - MD5 digest

Version:
--------

- 0.1 (first written and released version)

Supports:
---------

  - multi track CD-ROM
  - mode 1
  - Linux ioctl()
  - libmhash

Doesn't support:
----------------
  - DVD
  - Audio CD
  - Multi session
  - Other operating system

TODO:
-----
  - support options
  - support other track format
  - support multi session
  - support other interfaces (ioctl, packet, ...)
  - support other OS

Known problem:
--------------
  - Track are often bigger than the data written inside
    The program will report an error at the end of the data
    I don't know the way to detect the end of data.
    The checksum is good, and the size too.

Be aware:
---------
  - Track shorter than 4s -> 300 frames -> 614400 bytes are padded
    To check the checksum, pad the img/iso file to 614400 and run md5sum

Requires:
---------
 
  To build and run cd5, you need libmhash, or port it to OpenSSL,
  Gcrypt or other.

Build:
------

Run "make" or

gcc -W -Wall cd5.c -o cd5 -lmhash

Example:
--------

$ ./cd5

Track 1 to 3 (3 tracks)
ioctl(/dev/cdrom, CDROMREADMODE1(1277)) failed: Input/output error
Track 1, data, 0 + 1429 | 2615296 22597f64d164d509ef988b4ae97d3ad2
ioctl(/dev/cdrom, CDROMREADMODE1(1729)) failed: Input/output error
Track 2, data, 1429 + 452 | 614400 c8605c7db3dd78fba70c2030d339f22b
ioctl(/dev/cdrom, CDROMREADMODE1(4001)) failed: Input/output error
Track 3, data, 1881 + 2272 | 4341760 8084e5945813a02415d08fb027d9ea97

For the ioctl() errors, see above.
Just check that track size match ISO file size (except for file under
614400 bytes). 
One rule: if digest mismatch there's an error.

Author:
-------

Yann Droneaud <ydroneaud@meuh.org>

