@@ -111,16 +111,11 @@ pub fn aes_256_key_and_nonce_from_x25519_diffie_hellman_shared_secret_test() {
111
111
bob_shared_secret. shared_secret_length ,
112
112
) ;
113
113
114
-
115
-
116
- let alice_public_key_cstr = unsafe { CString :: from_raw ( alice_aes. aes_key_ptr ) } ;
117
- let alice_public_key_ptr = alice_public_key_cstr. as_bytes_with_nul ( ) . as_ptr ( ) as * const c_char ;
118
-
119
114
let password = "DontUseThisPassword" ;
120
115
let password_cstr = password. as_bytes ( ) ;
121
116
let password_ptr = password. as_ptr ( ) ;
122
- let cipher_text_result = aes_256_encrypt_bytes_with_key ( alice_aes. aes_nonce_ptr , alice_aes. aes_nonce_ptr_length , alice_public_key_ptr , password_ptr, password_cstr. len ( ) ) ;
123
- let plain_text_result = aes_256_decrypt_bytes_with_key ( bob_aes. aes_nonce_ptr , bob_aes. aes_nonce_ptr_length , bob_aes. aes_key_ptr , cipher_text_result. ciphertext , cipher_text_result. length ) ;
117
+ let cipher_text_result = aes_256_encrypt_bytes_with_key ( alice_aes. aes_nonce_ptr , alice_aes. aes_nonce_ptr_length , alice_aes . aes_key_ptr , alice_aes . aes_key_ptr_length , password_ptr, password_cstr. len ( ) ) ;
118
+ let plain_text_result = aes_256_decrypt_bytes_with_key ( bob_aes. aes_nonce_ptr , bob_aes. aes_nonce_ptr_length , bob_aes. aes_key_ptr , bob_aes . aes_key_ptr_length , cipher_text_result. ciphertext , cipher_text_result. length ) ;
124
119
let plain_text_result_slice: & [ u8 ] = unsafe {
125
120
std:: slice:: from_raw_parts (
126
121
plain_text_result. plaintext ,
@@ -203,15 +198,11 @@ pub fn aes_128_key_and_nonce_from_x25519_diffie_hellman_shared_secret_test() {
203
198
bob_shared_secret. shared_secret_length ,
204
199
) ;
205
200
206
-
207
- let alice_public_key_cstr = unsafe { CString :: from_raw ( alice_aes. aes_key_ptr ) } ;
208
- let alice_public_key_ptr = alice_public_key_cstr. as_bytes_with_nul ( ) . as_ptr ( ) as * const c_char ;
209
-
210
201
let password = "DontUseThisPassword" ;
211
202
let password_cstr = password. as_bytes ( ) ;
212
203
let password_ptr = password. as_ptr ( ) ;
213
- let cipher_text_result = aes_128_encrypt_bytes_with_key ( alice_aes. aes_nonce_ptr , alice_aes. aes_nonce_ptr_length , alice_public_key_ptr , password_ptr, password_cstr. len ( ) ) ;
214
- let plain_text_result = aes_128_decrypt_bytes_with_key ( bob_aes. aes_nonce_ptr , bob_aes. aes_nonce_ptr_length , bob_aes. aes_key_ptr , cipher_text_result. ciphertext , cipher_text_result. length ) ;
204
+ let cipher_text_result = aes_128_encrypt_bytes_with_key ( alice_aes. aes_nonce_ptr , alice_aes. aes_nonce_ptr_length , alice_aes . aes_key_ptr , alice_aes . aes_key_ptr_length , password_ptr, password_cstr. len ( ) ) ;
205
+ let plain_text_result = aes_128_decrypt_bytes_with_key ( bob_aes. aes_nonce_ptr , bob_aes. aes_nonce_ptr_length , bob_aes. aes_key_ptr , bob_aes . aes_key_ptr_length , cipher_text_result. ciphertext , cipher_text_result. length ) ;
215
206
let plain_text_result_slice: & [ u8 ] = unsafe {
216
207
std:: slice:: from_raw_parts (
217
208
plain_text_result. plaintext ,
0 commit comments