Skip to content

Commit

Permalink
scan-build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bhess committed Jan 24, 2024
1 parent 2c657b7 commit 2957c3b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions tests/vectors_kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ typedef struct {
fixed_prng_state prng_state = { .pos = 0 };

/* Displays hexadecimal strings */
void OQS_print_hex_string(const char *label, const uint8_t *str, size_t len) {
static void OQS_print_hex_string(const char *label, const uint8_t *str, size_t len) {
printf("%-20s (%4zu bytes): ", label, len);
for (size_t i = 0; i < (len); i++) {
printf("%02X", str[i]);
}
printf("\n");
}

void fprintBstr(FILE *fp, const char *S, const uint8_t *A, size_t L) {
static void fprintBstr(FILE *fp, const char *S, const uint8_t *A, size_t L) {
size_t i;
fprintf(fp, "%s", S);
for (i = 0; i < L; i++) {
Expand Down Expand Up @@ -182,7 +182,6 @@ OQS_STATUS kem_vector(const char *method_name,
if (rv != 0) {
fprintf(stderr, "[vectors_kem] %s ERROR: shared secrets are not equal\n", method_name);
OQS_print_hex_string("ss_decaps", ss_decaps, kem->length_shared_secret);
OQS_print_hex_string("decaps_kprime", decaps_kprime, kem->length_shared_secret);
goto err;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/vectors_sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ typedef struct {
fixed_prng_state prng_state = { .pos = 0 };

/* Displays hexadecimal strings */
void OQS_print_hex_string(const char *label, const uint8_t *str, size_t len) {
static void OQS_print_hex_string(const char *label, const uint8_t *str, size_t len) {
printf("%-20s (%4zu bytes): ", label, len);
for (size_t i = 0; i < (len); i++) {
printf("%02X", str[i]);
}
printf("\n");
}

void fprintBstr(FILE *fp, const char *S, const uint8_t *A, size_t L) {
static void fprintBstr(FILE *fp, const char *S, const uint8_t *A, size_t L) {
size_t i;
fprintf(fp, "%s", S);
for (i = 0; i < L; i++) {
Expand Down

0 comments on commit 2957c3b

Please sign in to comment.