@@ -465,25 +465,25 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
465465 const struct hw_bignum_mpi * b ,
466466 const struct hw_bignum_mpi * c )
467467{
468- pstm_int pa , pb , pm , pres ;
468+ pstm_int pa , pb , pm , pres ;
469469 u32 * buff_a = NULL ;
470- u32 * buff_b = NULL ;
471- u32 * buff_m = NULL ;
472- int err = -1 ;
470+ u32 * buff_b = NULL ;
471+ u32 * buff_m = NULL ;
472+ int err = -1 ;
473473 void * buff ;
474474 int buff_len ;
475475
476476 pstm_init (NULL , & pres );
477477
478478 buff_a = tls_mem_alloc (a -> total );
479- if (buff_a == NULL )
480- goto out ;
481- buff_b = tls_mem_alloc (b -> total );
482- if (buff_b == NULL )
483- goto out ;
484- buff_m = tls_mem_alloc (c -> total );
485- if (buff_m == NULL )
486- goto out ;
479+ if (buff_a == NULL )
480+ goto out ;
481+ buff_b = tls_mem_alloc (b -> total );
482+ if (buff_b == NULL )
483+ goto out ;
484+ buff_m = tls_mem_alloc (c -> total );
485+ if (buff_m == NULL )
486+ goto out ;
487487
488488 memset (buff_a , 0 , a -> total );
489489 memset (buff_b , 0 , b -> total );
@@ -494,29 +494,29 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
494494 memcpy (buff_m , c -> p , c -> total );
495495
496496 pstm_reverse ((unsigned char * )buff_a , a -> total );
497- pstm_reverse ((unsigned char * )buff_b , b -> total );
498- pstm_reverse ((unsigned char * )buff_m , c -> total );
497+ pstm_reverse ((unsigned char * )buff_b , b -> total );
498+ pstm_reverse ((unsigned char * )buff_m , c -> total );
499499
500500// *((volatile unsigned int *)0x40000710) = *((volatile unsigned int *)0x40000710) | (0x1 << 28);
501501
502- if ((err = pstm_init_for_read_unsigned_bin (NULL , & pa , a -> total )) != PS_SUCCESS ){
503- goto out ;
504- }
505- if ((err = pstm_read_unsigned_bin (& pa , (unsigned char * )buff_a , a -> total )) != PS_SUCCESS ) {
506- goto out ;
507- }
508- if ((err = pstm_init_for_read_unsigned_bin (NULL , & pb , b -> total )) != PS_SUCCESS ){
509- goto out ;
510- }
511- if ((err = pstm_read_unsigned_bin (& pb , (unsigned char * )buff_b , b -> total )) != PS_SUCCESS ) {
512- goto out ;
513- }
514- if ((err = pstm_init_for_read_unsigned_bin (NULL , & pm , c -> total )) != PS_SUCCESS ){
515- goto out ;
516- }
517- if ((err = pstm_read_unsigned_bin (& pm , (unsigned char * )buff_m , c -> total )) != PS_SUCCESS ) {
518- goto out ;
519- }
502+ if ((err = pstm_init_for_read_unsigned_bin (NULL , & pa , a -> total )) != PS_SUCCESS ){
503+ goto out ;
504+ }
505+ if ((err = pstm_read_unsigned_bin (& pa , (unsigned char * )buff_a , a -> total )) != PS_SUCCESS ) {
506+ goto out ;
507+ }
508+ if ((err = pstm_init_for_read_unsigned_bin (NULL , & pb , b -> total )) != PS_SUCCESS ){
509+ goto out ;
510+ }
511+ if ((err = pstm_read_unsigned_bin (& pb , (unsigned char * )buff_b , b -> total )) != PS_SUCCESS ) {
512+ goto out ;
513+ }
514+ if ((err = pstm_init_for_read_unsigned_bin (NULL , & pm , c -> total )) != PS_SUCCESS ){
515+ goto out ;
516+ }
517+ if ((err = pstm_read_unsigned_bin (& pm , (unsigned char * )buff_m , c -> total )) != PS_SUCCESS ) {
518+ goto out ;
519+ }
520520
521521 tls_crypto_exptmod (& pa , & pb , & pm , & pres );
522522 buff_len = pstm_unsigned_bin_size (& pres );
@@ -528,16 +528,16 @@ static rt_err_t _bignum_exptmod(struct hwcrypto_bignum *bignum_ctx,
528528
529529out :
530530 if (buff_a )
531- tls_mem_free (buff_a );
532- if (buff_b )
533- tls_mem_free (buff_b );
534- if (buff_m )
535- tls_mem_free (buff_m );
531+ tls_mem_free (buff_a );
532+ if (buff_b )
533+ tls_mem_free (buff_b );
534+ if (buff_m )
535+ tls_mem_free (buff_m );
536536
537- pstm_clear (& pa );
538- pstm_clear (& pb );
539- pstm_clear (& pm );
540- pstm_clear (& pres );
537+ pstm_clear (& pa );
538+ pstm_clear (& pb );
539+ pstm_clear (& pm );
540+ pstm_clear (& pres );
541541
542542 if (a -> sign < 0 )
543543 {
@@ -583,7 +583,7 @@ static const struct hwcrypto_crc_ops crc_ops =
583583 .update = _crc_update ,
584584};
585585
586- static const struct hwcrypto_bignum_ops bignum_ops =
586+ static const struct hwcrypto_bignum_ops bignum_ops =
587587{
588588 .add = RT_NULL ,
589589 .sub = RT_NULL ,
@@ -722,7 +722,7 @@ int wm_hw_crypto_device_init(void)
722722
723723 _crypto_dev .dev .ops = & _ops ;
724724 _crypto_dev .dev .id = 0 ;
725- rt_memcpy (& _crypto_dev .dev .id , wpa_supplicant_get_mac (),
725+ rt_memcpy (& _crypto_dev .dev .id , wpa_supplicant_get_mac (),
726726 sizeof (_crypto_dev .dev .id ) > 6 ?
727727 6 : sizeof (_crypto_dev .dev .id ));
728728 _crypto_dev .dev .user_data = & _crypto_dev ;
0 commit comments