File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
tuta-sdk/rust/sdk/src/crypto Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -126,18 +126,18 @@ fn bind_shared_secret_to_ciphertext(
126
126
ciphertext : PQCryptoMlKem1024Ciphertext ,
127
127
) -> KyberSharedSecret {
128
128
let hashed_ciphertext = sha:: sha3_256 ( ciphertext. as_bytes ( ) ) ;
129
- let kdf_input = vec ! [
129
+ let kdf_input = [
130
130
unbound_shared_secret. as_bytes ( ) ,
131
131
hashed_ciphertext. as_slice ( ) ,
132
132
] ;
133
- let shared_secret = shake256 ( kdf_input) ;
133
+ let shared_secret = shake256 ( kdf_input. as_slice ( ) ) ;
134
134
KyberSharedSecret ( shared_secret)
135
135
}
136
136
137
- fn shake256 ( input : Vec < & [ u8 ] > ) -> [ u8 ; SHAKE_BYTE_LENGTH ] {
137
+ fn shake256 ( input : & [ & [ u8 ] ] ) -> [ u8 ; SHAKE_BYTE_LENGTH ] {
138
138
let mut hasher = Shake256 :: default ( ) ;
139
- for data in & input {
140
- hasher. update ( data) ;
139
+ for data in input {
140
+ hasher. update ( * data) ;
141
141
}
142
142
let mut reader = hasher. finalize_xof ( ) ;
143
143
let mut output = [ 0 ; SHAKE_BYTE_LENGTH ] ;
You can’t perform that action at this time.
0 commit comments