Skip to content

Commit

Permalink
Better place for exception throwing.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed Jul 9, 2021
1 parent 6d28711 commit d834ca4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/rand/relic_rand_call.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ void rand_bytes(uint8_t *buf, int size) {
ctx_t *ctx = core_get();

ctx->rand_call(buf, size, ctx->rand_args);
rand_check(buf, size);
if (rand_check(buf, size) == RLC_ERR) {
RLC_THROW(ERR_NO_RAND);
}
}

void rand_seed(void (*callback)(uint8_t *, int, void *), void *args) {
Expand Down
1 change: 0 additions & 1 deletion src/rand/relic_rand_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ int rand_check(uint8_t *buf, int size) {
}

if (count > RAND_REP) {
RLC_THROW(ERR_NO_RAND);
return RLC_ERR;
}
return RLC_OK;
Expand Down

0 comments on commit d834ca4

Please sign in to comment.