def _check(return_val):
    """Checks the return code of the C calls"""
    if isinstance(return_val, int) and return_val == 1:
        return
    if isinstance(return_val, bool) and return_val == True:
        return
    raise Exception('HMAC exception')
