From 4853507bbfd5a091dd300d9c3cb8896404c164da Mon Sep 17 00:00:00 2001 From: Rigidity Date: Wed, 14 Aug 2024 13:17:00 -0400 Subject: [PATCH] Remove mut --- c-bindings/wrapper.cpp | 2 +- c-bindings/wrapper.h | 2 +- rust-bindings/src/lib.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/c-bindings/wrapper.cpp b/c-bindings/wrapper.cpp index 157dc2775..962e21ab5 100644 --- a/c-bindings/wrapper.cpp +++ b/c-bindings/wrapper.cpp @@ -2,7 +2,7 @@ #include "verifier.hpp" extern "C" { - bool validate_proof(uint8_t* seed, uint8_t k, uint8_t* challenge, uint8_t* proof, uint16_t proof_len, uint8_t* quality_buf) { + bool validate_proof(const uint8_t* seed, uint8_t k, const uint8_t* challenge, const uint8_t* proof, uint16_t proof_len, uint8_t* quality_buf) { Verifier v; auto quality = v.ValidateProof(seed, k, challenge, proof, proof_len); if (quality.GetSize() == 0) { diff --git a/c-bindings/wrapper.h b/c-bindings/wrapper.h index 4a6c01df3..45532b401 100644 --- a/c-bindings/wrapper.h +++ b/c-bindings/wrapper.h @@ -1,5 +1,5 @@ #include "picosha2.hpp" extern "C" { - bool validate_proof(uint8_t* seed, uint8_t k, uint8_t* challenge, uint8_t* proof, uint16_t proof_len, uint8_t* quality_buf); + bool validate_proof(const uint8_t* seed, uint8_t k, const uint8_t* challenge, const uint8_t* proof, uint16_t proof_len, uint8_t* quality_buf); } diff --git a/rust-bindings/src/lib.rs b/rust-bindings/src/lib.rs index 291f4d441..5e786ac28 100644 --- a/rust-bindings/src/lib.rs +++ b/rust-bindings/src/lib.rs @@ -22,10 +22,10 @@ pub fn validate_proof( unsafe { bindings::validate_proof( - seed.as_ptr() as *mut u8, + seed.as_ptr(), k, - challenge.as_ptr() as *mut u8, - proof.as_ptr() as *mut u8, + challenge.as_ptr(), + proof.as_ptr(), proof_len, quality.as_mut_ptr(), )