Skip to content

Commit

Permalink
Merge pull request #47 from olafhering/const
Browse files Browse the repository at this point in the history
handle safe-string
  • Loading branch information
djs55 authored Mar 13, 2021
2 parents 3eb0091 + e5af4b2 commit ac1d5c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sha1_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ CAMLprim value stub_sha1_to_bin(value digest)
CAMLlocal1(result);

result = caml_alloc_string(20);
sha1_to_bin((sha1_digest *) digest, String_val(result));
sha1_to_bin((sha1_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
Expand All @@ -165,7 +165,7 @@ CAMLprim value stub_sha1_to_hex(value digest)
CAMLlocal1(result);

result = caml_alloc_string(40);
sha1_to_hex((sha1_digest *) digest, String_val(result));
sha1_to_hex((sha1_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
4 changes: 2 additions & 2 deletions sha256_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ CAMLprim value stub_sha256_to_bin(value digest)
CAMLlocal1(result);

result = caml_alloc_string(32);
sha256_to_bin((sha256_digest *) digest, String_val(result));
sha256_to_bin((sha256_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
Expand All @@ -163,7 +163,7 @@ CAMLprim value stub_sha256_to_hex(value digest)
CAMLlocal1(result);

result = caml_alloc_string(64);
sha256_to_hex((sha256_digest *) digest, String_val(result));
sha256_to_hex((sha256_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
4 changes: 2 additions & 2 deletions sha512_stubs.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ CAMLprim value stub_sha512_to_bin(value digest)
CAMLlocal1(result);

result = caml_alloc_string(64);
sha512_to_bin((sha512_digest *) digest, String_val(result));
sha512_to_bin((sha512_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}
Expand All @@ -163,7 +163,7 @@ CAMLprim value stub_sha512_to_hex(value digest)
CAMLlocal1(result);

result = caml_alloc_string(128);
sha512_to_hex((sha512_digest *) digest, String_val(result));
sha512_to_hex((sha512_digest *) digest, &Byte(result, 0));

CAMLreturn(result);
}

0 comments on commit ac1d5c0

Please sign in to comment.