Electronic structure and elastic properties of TiB2 and ZrB2