@@ -29,7 +29,6 @@ the raw C functions in a memory-safe and easy-to-use Rust API.
2929use wolfssl_sys as ws;
3030
3131use std:: mem:: MaybeUninit ;
32- use std:: ptr:: null_mut;
3332
3433/// Context for SHA-1 computation.
3534pub struct SHA {
@@ -730,7 +729,7 @@ impl SHA3_224 {
730729 /// ```
731730 pub fn new ( ) -> Result < Self , i32 > {
732731 let mut wc_sha3: MaybeUninit < ws:: wc_Sha3 > = MaybeUninit :: uninit ( ) ;
733- let rc = unsafe { ws:: wc_InitSha3_224 ( wc_sha3. as_mut_ptr ( ) , null_mut ( ) , ws:: INVALID_DEVID ) } ;
732+ let rc = unsafe { ws:: wc_InitSha3_224 ( wc_sha3. as_mut_ptr ( ) , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
734733 if rc != 0 {
735734 return Err ( rc) ;
736735 }
@@ -757,7 +756,7 @@ impl SHA3_224 {
757756 /// sha.init().expect("Error with init()");
758757 /// ```
759758 pub fn init ( & mut self ) -> Result < ( ) , i32 > {
760- let rc = unsafe { ws:: wc_InitSha3_224 ( & mut self . wc_sha3 , null_mut ( ) , ws:: INVALID_DEVID ) } ;
759+ let rc = unsafe { ws:: wc_InitSha3_224 ( & mut self . wc_sha3 , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
761760 if rc != 0 {
762761 return Err ( rc) ;
763762 }
@@ -865,7 +864,7 @@ impl SHA3_256 {
865864 /// ```
866865 pub fn new ( ) -> Result < Self , i32 > {
867866 let mut wc_sha3: MaybeUninit < ws:: wc_Sha3 > = MaybeUninit :: uninit ( ) ;
868- let rc = unsafe { ws:: wc_InitSha3_256 ( wc_sha3. as_mut_ptr ( ) , null_mut ( ) , ws:: INVALID_DEVID ) } ;
867+ let rc = unsafe { ws:: wc_InitSha3_256 ( wc_sha3. as_mut_ptr ( ) , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
869868 if rc != 0 {
870869 return Err ( rc) ;
871870 }
@@ -892,7 +891,7 @@ impl SHA3_256 {
892891 /// sha.init().expect("Error with init()");
893892 /// ```
894893 pub fn init ( & mut self ) -> Result < ( ) , i32 > {
895- let rc = unsafe { ws:: wc_InitSha3_256 ( & mut self . wc_sha3 , null_mut ( ) , ws:: INVALID_DEVID ) } ;
894+ let rc = unsafe { ws:: wc_InitSha3_256 ( & mut self . wc_sha3 , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
896895 if rc != 0 {
897896 return Err ( rc) ;
898897 }
@@ -1000,7 +999,7 @@ impl SHA3_384 {
1000999 /// ```
10011000 pub fn new ( ) -> Result < Self , i32 > {
10021001 let mut wc_sha3: MaybeUninit < ws:: wc_Sha3 > = MaybeUninit :: uninit ( ) ;
1003- let rc = unsafe { ws:: wc_InitSha3_384 ( wc_sha3. as_mut_ptr ( ) , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1002+ let rc = unsafe { ws:: wc_InitSha3_384 ( wc_sha3. as_mut_ptr ( ) , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
10041003 if rc != 0 {
10051004 return Err ( rc) ;
10061005 }
@@ -1027,7 +1026,7 @@ impl SHA3_384 {
10271026 /// sha.init().expect("Error with init()");
10281027 /// ```
10291028 pub fn init ( & mut self ) -> Result < ( ) , i32 > {
1030- let rc = unsafe { ws:: wc_InitSha3_384 ( & mut self . wc_sha3 , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1029+ let rc = unsafe { ws:: wc_InitSha3_384 ( & mut self . wc_sha3 , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
10311030 if rc != 0 {
10321031 return Err ( rc) ;
10331032 }
@@ -1135,7 +1134,7 @@ impl SHA3_512 {
11351134 /// ```
11361135 pub fn new ( ) -> Result < Self , i32 > {
11371136 let mut wc_sha3: MaybeUninit < ws:: wc_Sha3 > = MaybeUninit :: uninit ( ) ;
1138- let rc = unsafe { ws:: wc_InitSha3_512 ( wc_sha3. as_mut_ptr ( ) , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1137+ let rc = unsafe { ws:: wc_InitSha3_512 ( wc_sha3. as_mut_ptr ( ) , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
11391138 if rc != 0 {
11401139 return Err ( rc) ;
11411140 }
@@ -1162,7 +1161,7 @@ impl SHA3_512 {
11621161 /// sha.init().expect("Error with init()");
11631162 /// ```
11641163 pub fn init ( & mut self ) -> Result < ( ) , i32 > {
1165- let rc = unsafe { ws:: wc_InitSha3_512 ( & mut self . wc_sha3 , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1164+ let rc = unsafe { ws:: wc_InitSha3_512 ( & mut self . wc_sha3 , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
11661165 if rc != 0 {
11671166 return Err ( rc) ;
11681167 }
@@ -1270,7 +1269,7 @@ impl SHAKE128 {
12701269 /// ```
12711270 pub fn new ( ) -> Result < Self , i32 > {
12721271 let mut wc_shake: MaybeUninit < ws:: wc_Shake > = MaybeUninit :: uninit ( ) ;
1273- let rc = unsafe { ws:: wc_InitShake128 ( wc_shake. as_mut_ptr ( ) , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1272+ let rc = unsafe { ws:: wc_InitShake128 ( wc_shake. as_mut_ptr ( ) , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
12741273 if rc != 0 {
12751274 return Err ( rc) ;
12761275 }
@@ -1297,7 +1296,7 @@ impl SHAKE128 {
12971296 /// sha.init().expect("Error with init()");
12981297 /// ```
12991298 pub fn init ( & mut self ) -> Result < ( ) , i32 > {
1300- let rc = unsafe { ws:: wc_InitShake128 ( & mut self . wc_shake , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1299+ let rc = unsafe { ws:: wc_InitShake128 ( & mut self . wc_shake , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
13011300 if rc != 0 {
13021301 return Err ( rc) ;
13031302 }
@@ -1468,7 +1467,7 @@ impl SHAKE256 {
14681467 /// ```
14691468 pub fn new ( ) -> Result < Self , i32 > {
14701469 let mut wc_shake: MaybeUninit < ws:: wc_Shake > = MaybeUninit :: uninit ( ) ;
1471- let rc = unsafe { ws:: wc_InitShake256 ( wc_shake. as_mut_ptr ( ) , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1470+ let rc = unsafe { ws:: wc_InitShake256 ( wc_shake. as_mut_ptr ( ) , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
14721471 if rc != 0 {
14731472 return Err ( rc) ;
14741473 }
@@ -1495,7 +1494,7 @@ impl SHAKE256 {
14951494 /// sha.init().expect("Error with init()");
14961495 /// ```
14971496 pub fn init ( & mut self ) -> Result < ( ) , i32 > {
1498- let rc = unsafe { ws:: wc_InitShake256 ( & mut self . wc_shake , null_mut ( ) , ws:: INVALID_DEVID ) } ;
1497+ let rc = unsafe { ws:: wc_InitShake256 ( & mut self . wc_shake , core :: ptr :: null_mut ( ) , ws:: INVALID_DEVID ) } ;
14991498 if rc != 0 {
15001499 return Err ( rc) ;
15011500 }
0 commit comments