@@ -7,7 +7,7 @@ typedef struct TestData_ {
7
7
const unsigned char pk [crypto_vrf_PUBLICKEYBYTES ];
8
8
const unsigned char proof [crypto_vrf_PROOFBYTES ];
9
9
const unsigned char output [crypto_vrf_OUTPUTBYTES ];
10
- const unsigned char * msg ;
10
+ const char * msg ;
11
11
} TestData ;
12
12
13
13
static const TestData test_data [] = {
@@ -83,7 +83,7 @@ int main(void)
83
83
printf ("crypto_vrf_is_valid_key() error: [%u]\n" , i );
84
84
continue ;
85
85
}
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 ){
87
87
printf ("crypto_vrf_prove() error: [%u]\n" , i );
88
88
continue ;
89
89
}
@@ -93,7 +93,7 @@ int main(void)
93
93
printhex ("\tGot: " , proof , crypto_vrf_PROOFBYTES );
94
94
continue ;
95
95
}
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 ){
97
97
printf ("verify error: [%u]\n" , i );
98
98
continue ;
99
99
}
@@ -105,32 +105,32 @@ int main(void)
105
105
}
106
106
107
107
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 ){
109
109
printf ("verify succeeded with bad gamma: [%u]\n" , i );
110
110
continue ;
111
111
}
112
112
proof [0 ] ^= 0x01 ;
113
113
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 ){
115
115
printf ("verify succeeded with bad c value: [%u]\n" , i );
116
116
continue ;
117
117
}
118
118
proof [32 ] ^= 0x01 ;
119
119
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 ){
121
121
printf ("verify succeeded with bad s value: [%u]\n" , i );
122
122
continue ;
123
123
}
124
124
proof [48 ] ^= 0x01 ;
125
125
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 ){
127
127
printf ("verify succeeded with bad s value (high-order-bit flipped): [%u]\n" , i );
128
128
continue ;
129
129
}
130
130
proof [79 ] ^= 0x80 ;
131
131
132
132
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 ){
134
134
printf ("verify succeeded with truncated message: [%u]\n" , i );
135
135
continue ;
136
136
}
0 commit comments