Add C implementation. (NOT VERIFIED)