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 {
56
56
. into_result ( Function :: Decrypt ) ?;
57
57
}
58
58
59
- data. resize ( data_len. try_into ( ) ?, 0 ) ;
59
+ data. truncate ( data_len. try_into ( ) ?) ;
60
60
61
61
Ok ( data)
62
62
}
@@ -136,7 +136,7 @@ impl Session {
136
136
. into_result ( Function :: DecryptFinal ) ?;
137
137
}
138
138
139
- data. resize ( data_len. try_into ( ) ?, 0 ) ;
139
+ data. truncate ( data_len. try_into ( ) ?) ;
140
140
141
141
Ok ( data)
142
142
}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ impl Session {
49
49
. into_result ( Function :: Digest ) ?;
50
50
}
51
51
52
- digest. resize ( digest_len. try_into ( ) ?, 0 ) ;
52
+ digest. truncate ( digest_len. try_into ( ) ?) ;
53
53
54
54
Ok ( digest)
55
55
}
@@ -124,7 +124,7 @@ impl Session {
124
124
. into_result ( Function :: DigestFinal ) ?;
125
125
}
126
126
127
- digest. resize ( digest_len. try_into ( ) ?, 0 ) ;
127
+ digest. truncate ( digest_len. try_into ( ) ?) ;
128
128
129
129
Ok ( digest)
130
130
}
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ impl Session {
54
54
. into_result ( Function :: EncapsulateKey ) ?;
55
55
}
56
56
57
- encapsulated. resize ( encapsulated_len. try_into ( ) ?, 0 ) ;
57
+ encapsulated. truncate ( encapsulated_len. try_into ( ) ?) ;
58
58
59
59
Ok ( ( encapsulated, ObjectHandle :: new ( handle) ) )
60
60
}
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ impl Session {
55
55
. into_result ( Function :: Encrypt ) ?;
56
56
}
57
57
58
- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
58
+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
59
59
60
60
Ok ( encrypted_data)
61
61
}
@@ -135,7 +135,7 @@ impl Session {
135
135
. into_result ( Function :: EncryptFinal ) ?;
136
136
}
137
137
138
- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
138
+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
139
139
140
140
Ok ( encrypted_data)
141
141
}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl Session {
68
68
. into_result ( Function :: DecryptMessage ) ?;
69
69
}
70
70
71
- data. resize ( data_len. try_into ( ) ?, 0 ) ;
71
+ data. truncate ( data_len. try_into ( ) ?) ;
72
72
73
73
Ok ( data)
74
74
}
@@ -123,7 +123,7 @@ impl Session {
123
123
) )
124
124
. into_result ( Function :: DecryptMessageNext ) ?;
125
125
}
126
- data. resize ( data_len. try_into ( ) ?, 0 ) ;
126
+ data. truncate ( data_len. try_into ( ) ?) ;
127
127
128
128
Ok ( data)
129
129
}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ impl Session {
68
68
. into_result ( Function :: EncryptMessage ) ?;
69
69
}
70
70
71
- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
71
+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
72
72
73
73
Ok ( encrypted_data)
74
74
}
@@ -123,7 +123,7 @@ impl Session {
123
123
) )
124
124
. into_result ( Function :: EncryptMessageNext ) ?;
125
125
}
126
- encrypted_data. resize ( encrypted_data_len. try_into ( ) ?, 0 ) ;
126
+ encrypted_data. truncate ( encrypted_data_len. try_into ( ) ?) ;
127
127
128
128
Ok ( encrypted_data)
129
129
}
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ impl Session {
51
51
. into_result ( Function :: Sign ) ?;
52
52
}
53
53
54
- signature. resize ( signature_len. try_into ( ) ?, 0 ) ;
54
+ signature. truncate ( signature_len. try_into ( ) ?) ;
55
55
56
56
Ok ( signature)
57
57
}
@@ -113,7 +113,7 @@ impl Session {
113
113
. into_result ( Function :: SignFinal ) ?;
114
114
}
115
115
116
- signature. resize ( signature_len. try_into ( ) ?, 0 ) ;
116
+ signature. truncate ( signature_len. try_into ( ) ?) ;
117
117
118
118
Ok ( signature)
119
119
}
You can’t perform that action at this time.
0 commit comments