FFI: Rename to librustzcash_sapling_compute_cmu

Part of zcash/zcash#3446.
This commit is contained in:
Jack Grigg 2020-08-25 17:25:00 +01:00
parent 0ac2261b7a
commit fbe54c4b6c
4 changed files with 7 additions and 7 deletions

View File

@ -217,7 +217,7 @@ extern "C" {
/// The `pk_d` and `r` parameters must be of length 32.
/// The result is also of length 32 and placed in `result`.
/// Returns false if the diversifier or pk_d is not valid
bool librustzcash_sapling_compute_cm(
bool librustzcash_sapling_compute_cmu(
const unsigned char *diversifier,
const unsigned char *pk_d,
const uint64_t value,

View File

@ -408,7 +408,7 @@ pub extern "C" fn librustzcash_sapling_compute_nf(
/// The result is also of length 32 and placed in `result`.
/// Returns false if `diversifier` or `pk_d` is not valid.
#[no_mangle]
pub extern "C" fn librustzcash_sapling_compute_cm(
pub extern "C" fn librustzcash_sapling_compute_cmu(
diversifier: *const [c_uchar; 11],
pk_d: *const [c_uchar; 32],
value: u64,

View File

@ -1,4 +1,4 @@
use crate::librustzcash_sapling_compute_cm;
use crate::librustzcash_sapling_compute_cmu;
use crate::librustzcash_sapling_compute_nf;
#[test]
@ -648,7 +648,7 @@ fn notes() {
for tv in test_vectors {
// Compute commitment and compare with test vector
let mut result = [0u8; 32];
assert!(librustzcash_sapling_compute_cm(
assert!(librustzcash_sapling_compute_cmu(
&tv.default_d,
&tv.default_pk_d,
tv.note_v,

View File

@ -62,7 +62,7 @@ SaplingNote::SaplingNote(
boost::optional<uint256> SaplingNote::cmu() const {
uint256 result;
uint256 rcm_tmp = rcm();
if (!librustzcash_sapling_compute_cm(
if (!librustzcash_sapling_compute_cmu(
d.data(),
pk_d.begin(),
value(),
@ -277,7 +277,7 @@ boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::plaintext_checks_wit
uint256 cmu_expected;
uint256 rcm = plaintext.rcm();
if (!librustzcash_sapling_compute_cm(
if (!librustzcash_sapling_compute_cmu(
plaintext.d.data(),
pk_d.begin(),
plaintext.value(),
@ -392,7 +392,7 @@ boost::optional<SaplingNotePlaintext> SaplingNotePlaintext::plaintext_checks_wit
uint256 cmu_expected;
uint256 rcm = plaintext.rcm();
if (!librustzcash_sapling_compute_cm(
if (!librustzcash_sapling_compute_cmu(
plaintext.d.data(),
pk_d.begin(),
plaintext.value(),