Use typedef for chunk length type

The headers size must be computed from the the typedef type instead of
the actual one.