add finite field implementation, c wrapper, and update tests