Skip to content

Commit 4ab2364

Browse files
committed
fix: update Rust wrapper call sites for new wc_curve25519_make_pub arg order
The parameter reorder (private-before-public) broke the four call sites in wrapper/rust/wolfssl-wolfcrypt/src/curve25519.rs.
1 parent b258ed8 commit 4ab2364

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

wrapper/rust/wolfssl-wolfcrypt/src/curve25519.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ impl Curve25519Key {
330330
let private_size = crate::buffer_len_to_i32(private.len())?;
331331
let public_size = crate::buffer_len_to_i32(public.len())?;
332332
let rc = unsafe {
333-
sys::wc_curve25519_make_pub(public_size, public.as_mut_ptr(),
334-
private_size, private.as_ptr())
333+
sys::wc_curve25519_make_pub(private_size, private.as_ptr(),
334+
public_size, public.as_mut_ptr())
335335
};
336336
if rc != 0 {
337337
return Err(rc);
@@ -357,8 +357,8 @@ impl Curve25519Key {
357357
let private_size = crate::buffer_len_to_i32(private.len())?;
358358
let public_size = crate::buffer_len_to_i32(public.len())?;
359359
let rc = unsafe {
360-
sys::wc_curve25519_make_pub_blind(public_size, public.as_mut_ptr(),
361-
private_size, private.as_ptr(), &mut rng.wc_rng)
360+
sys::wc_curve25519_make_pub_blind(private_size, private.as_ptr(),
361+
public_size, public.as_mut_ptr(), &mut rng.wc_rng)
362362
};
363363
if rc != 0 {
364364
return Err(rc);
@@ -384,8 +384,8 @@ impl Curve25519Key {
384384
let public_size = crate::buffer_len_to_i32(public.len())?;
385385
let basepoint_size = crate::buffer_len_to_i32(basepoint.len())?;
386386
let rc = unsafe {
387-
sys::wc_curve25519_generic(public_size, public.as_mut_ptr(),
388-
private_size, private.as_ptr(), basepoint_size, basepoint.as_ptr())
387+
sys::wc_curve25519_generic(private_size, private.as_ptr(),
388+
public_size, public.as_mut_ptr(), basepoint_size, basepoint.as_ptr())
389389
};
390390
if rc != 0 {
391391
return Err(rc);
@@ -413,8 +413,8 @@ impl Curve25519Key {
413413
let public_size = crate::buffer_len_to_i32(public.len())?;
414414
let basepoint_size = crate::buffer_len_to_i32(basepoint.len())?;
415415
let rc = unsafe {
416-
sys::wc_curve25519_generic_blind(public_size, public.as_mut_ptr(),
417-
private_size, private.as_ptr(), basepoint_size, basepoint.as_ptr(),
416+
sys::wc_curve25519_generic_blind(private_size, private.as_ptr(),
417+
public_size, public.as_mut_ptr(), basepoint_size, basepoint.as_ptr(),
418418
&mut rng.wc_rng)
419419
};
420420
if rc != 0 {

0 commit comments

Comments
 (0)