Initial commit for checked arithmetic library

Certain libraries, e.g. block storage, conduct arithmetic on
very large numbers and may generate overflows.
This is potentially very dangerous because, for storage in particular,
this can cause disk writes to non-sensical locations and lead to
unrecoverable data.

The safemath library wraps the so-called 'checked' arithmetic
operations and provides a primitive number with the following semantics:
* All arithmetic operations are checked. If an operation would result
in an overflow, the result is 'poisoned' and tracked.
* Converting from a safe number to a primitive integer requires the caller
to handle any potential poison.
* Converting from a safe number to a primitive integer generates an
error if the destination type is not sufficiently wide.

Tests: new unit tests all pass

Change-Id: I1cb12d72bc9bbca511f53c78207f9d9ff2b7f761
4 files changed
tree: 570a3ad2048e4b3ef70475fabb43c717cf850c44
  1. gbl/
  2. libxbc/
  3. vts/
  4. .gitignore
  5. BUILD
  6. OWNERS