File tree Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Expand file tree Collapse file tree 7 files changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ impl Session {
5656 . into_result ( Function :: Decrypt ) ?;
5757 }
5858
59- data. resize ( data_len. try_into ( ) ?, 0 ) ;
59+ data. truncate ( data_len. try_into ( ) ?) ;
6060
6161 Ok ( data)
6262 }
@@ -136,7 +136,7 @@ impl Session {
136136 . into_result ( Function :: DecryptFinal ) ?;
137137 }
138138
139- data. resize ( data_len. try_into ( ) ?, 0 ) ;
139+ data. truncate ( data_len. try_into ( ) ?) ;
140140
141141 Ok ( data)
142142 }
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ impl Session {
4949 . into_result ( Function :: Digest ) ?;
5050 }
5151
52- digest. resize ( digest_len. try_into ( ) ?, 0 ) ;
52+ digest. truncate ( digest_len. try_into ( ) ?) ;
5353
5454 Ok ( digest)
5555 }
@@ -124,7 +124,7 @@ impl Session {
124124 . into_result ( Function :: DigestFinal ) ?;
125125 }
126126
127- digest. resize ( digest_len. try_into ( ) ?, 0 ) ;
127+ digest. truncate ( digest_len. try_into ( ) ?) ;
128128
129129 Ok ( digest)
130130 }
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ impl Session {
5454 . into_result ( Function :: EncapsulateKey ) ?;
5555 }
5656
57- encapsulated. resize ( encapsulated_len. try_into ( ) ?, 0 ) ;
57+ encapsulated. truncate ( encapsulated_len. try_into ( ) ?) ;
5858
5959 Ok ( ( encapsulated, ObjectHandle :: new ( handle) ) )
6060 }
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ impl Session {
5555 . into_result ( Function :: Encrypt ) ?;
5656 }
5757
58- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
58+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
5959
6060 Ok ( encrypted_data)
6161 }
@@ -135,7 +135,7 @@ impl Session {
135135 . into_result ( Function :: EncryptFinal ) ?;
136136 }
137137
138- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
138+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
139139
140140 Ok ( encrypted_data)
141141 }
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl Session {
6868 . into_result ( Function :: DecryptMessage ) ?;
6969 }
7070
71- data. resize ( data_len. try_into ( ) ?, 0 ) ;
71+ data. truncate ( data_len. try_into ( ) ?) ;
7272
7373 Ok ( data)
7474 }
@@ -123,7 +123,7 @@ impl Session {
123123 ) )
124124 . into_result ( Function :: DecryptMessageNext ) ?;
125125 }
126- data. resize ( data_len. try_into ( ) ?, 0 ) ;
126+ data. truncate ( data_len. try_into ( ) ?) ;
127127
128128 Ok ( data)
129129 }
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl Session {
6868 . into_result ( Function :: EncryptMessage ) ?;
6969 }
7070
71- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
71+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
7272
7373 Ok ( encrypted_data)
7474 }
@@ -123,7 +123,7 @@ impl Session {
123123 ) )
124124 . into_result ( Function :: EncryptMessageNext ) ?;
125125 }
126- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
126+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
127127
128128 Ok ( encrypted_data)
129129 }
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ impl Session {
5151 . into_result ( Function :: Sign ) ?;
5252 }
5353
54- signature. resize ( signature_len. try_into ( ) ?, 0 ) ;
54+ signature. truncate ( signature_len. try_into ( ) ?) ;
5555
5656 Ok ( signature)
5757 }
@@ -113,7 +113,7 @@ impl Session {
113113 . into_result ( Function :: SignFinal ) ?;
114114 }
115115
116- signature. resize ( signature_len. try_into ( ) ?, 0 ) ;
116+ signature. truncate ( signature_len. try_into ( ) ?) ;
117117
118118 Ok ( signature)
119119 }
You can’t perform that action at this time.
0 commit comments