Skip to content

Commit 66f017f

Browse files
algoradamtdammers
authored andcommitted
Fix issue when building VRF tests with g++
1 parent 576f4de commit 66f017f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

test/default/vrf.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ typedef struct TestData_ {
77
const unsigned char pk[crypto_vrf_PUBLICKEYBYTES];
88
const unsigned char proof[crypto_vrf_PROOFBYTES];
99
const unsigned char output[crypto_vrf_OUTPUTBYTES];
10-
const unsigned char *msg;
10+
const char *msg;
1111
} TestData;
1212

1313
static const TestData test_data[] = {
@@ -83,7 +83,7 @@ int main(void)
8383
printf("crypto_vrf_is_valid_key() error: [%u]\n", i);
8484
continue;
8585
}
86-
if (crypto_vrf_prove(proof, sk, test_data[i].msg, i) != 0){
86+
if (crypto_vrf_prove(proof, sk, (const unsigned char*) test_data[i].msg, i) != 0){
8787
printf("crypto_vrf_prove() error: [%u]\n", i);
8888
continue;
8989
}
@@ -93,7 +93,7 @@ int main(void)
9393
printhex("\tGot: ", proof, crypto_vrf_PROOFBYTES);
9494
continue;
9595
}
96-
if (crypto_vrf_verify(output, test_data[i].pk, proof, test_data[i].msg, i) != 0){
96+
if (crypto_vrf_verify(output, test_data[i].pk, proof, (const unsigned char*) test_data[i].msg, i) != 0){
9797
printf("verify error: [%u]\n", i);
9898
continue;
9999
}
@@ -105,32 +105,32 @@ int main(void)
105105
}
106106

107107
proof[0] ^= 0x01;
108-
if (crypto_vrf_verify(output, test_data[i].pk, proof, test_data[i].msg, i) == 0){
108+
if (crypto_vrf_verify(output, test_data[i].pk, proof, (const unsigned char*) test_data[i].msg, i) == 0){
109109
printf("verify succeeded with bad gamma: [%u]\n", i);
110110
continue;
111111
}
112112
proof[0] ^= 0x01;
113113
proof[32] ^= 0x01;
114-
if (crypto_vrf_verify(output, test_data[i].pk, proof, test_data[i].msg, i) == 0){
114+
if (crypto_vrf_verify(output, test_data[i].pk, proof, (const unsigned char*) test_data[i].msg, i) == 0){
115115
printf("verify succeeded with bad c value: [%u]\n", i);
116116
continue;
117117
}
118118
proof[32] ^= 0x01;
119119
proof[48] ^= 0x01;
120-
if (crypto_vrf_verify(output, test_data[i].pk, proof, test_data[i].msg, i) == 0){
120+
if (crypto_vrf_verify(output, test_data[i].pk, proof, (const unsigned char*) test_data[i].msg, i) == 0){
121121
printf("verify succeeded with bad s value: [%u]\n", i);
122122
continue;
123123
}
124124
proof[48] ^= 0x01;
125125
proof[79] ^= 0x80;
126-
if (crypto_vrf_verify(output, test_data[i].pk, proof, test_data[i].msg, i) == 0){
126+
if (crypto_vrf_verify(output, test_data[i].pk, proof, (const unsigned char*) test_data[i].msg, i) == 0){
127127
printf("verify succeeded with bad s value (high-order-bit flipped): [%u]\n", i);
128128
continue;
129129
}
130130
proof[79] ^= 0x80;
131131

132132
if (i > 0) {
133-
if (crypto_vrf_verify(output, test_data[i].pk, proof, test_data[i].msg, i-1) == 0){
133+
if (crypto_vrf_verify(output, test_data[i].pk, proof, (const unsigned char*) test_data[i].msg, i-1) == 0){
134134
printf("verify succeeded with truncated message: [%u]\n", i);
135135
continue;
136136
}

0 commit comments

Comments
 (0)