@@ -120,37 +120,37 @@ int blake2b_init_param( blake2b_state *S, const blake2b_param *P )
120120
121121int blake2b_init ( blake2b_state * S , const byte outlen )
122122{
123- blake2b_param P ;
123+ volatile blake2b_param P ;
124124
125125 if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return BAD_FUNC_ARG ;
126126
127- XMEMSET (& P , 0 , sizeof (P ));
127+ XMEMSET (( void * )( wc_ptr_t ) & P , 0 , sizeof (P ));
128128 WC_BARRIER ();
129129 P .digest_length = outlen ;
130130 P .fanout = 1 ;
131131 P .depth = 1 ;
132132
133- return blake2b_init_param (S , & P );
133+ return blake2b_init_param (S , ( const blake2b_param * )( wc_ptr_t ) & P );
134134}
135135
136136int blake2b_init_key ( blake2b_state * S , const byte outlen , const void * key ,
137137 const byte keylen )
138138{
139139 int ret = 0 ;
140- blake2b_param P ;
140+ volatile blake2b_param P ;
141141
142142 if ( ( !outlen ) || ( outlen > BLAKE2B_OUTBYTES ) ) return BAD_FUNC_ARG ;
143143
144144 if ( !key || !keylen || keylen > BLAKE2B_KEYBYTES ) return BAD_FUNC_ARG ;
145145
146- XMEMSET ( & P , 0 , sizeof ( P ) );
146+ XMEMSET ( ( void * )( wc_ptr_t ) & P , 0 , sizeof ( P ) );
147147 WC_BARRIER ();
148148 P .digest_length = outlen ;
149149 P .key_length = keylen ;
150150 P .fanout = 1 ;
151151 P .depth = 1 ;
152152
153- ret = blake2b_init_param (S , & P );
153+ ret = blake2b_init_param (S , ( const blake2b_param * )( wc_ptr_t ) & P );
154154 if ( ret < 0 ) return ret ;
155155
156156 {
0 commit comments