Skip to content

Commit

Permalink
Remove mut
Browse files Browse the repository at this point in the history
  • Loading branch information
Rigidity committed Aug 14, 2024
1 parent 5355256 commit 4853507
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion c-bindings/wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion c-bindings/wrapper.h
Original file line number Diff line number Diff line change
@@ -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);
}
6 changes: 3 additions & 3 deletions rust-bindings/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)
Expand Down

0 comments on commit 4853507

Please sign in to comment.