[PATCH v3 2/8] lib: wrap crypt API to hide errno usage