fix(jni): propagate Sapling scalar entropy failures to Java
Sapling scalar generation currently calls a void Rust entry point, so an OS entropy failure can abort the JVM. Call the checked Rust entry point introduced by librustzcash #13 and throw IllegalStateException when it returns false.
The JNI method validates a non-null, exactly 32-byte output buffer, generates into a local buffer, and copies to Java only on success. The Java method descriptor is unchanged. Pin the Rust submodule to f8b569ba532eacea9f62d7e11fbbf675ea4ee4c9, which also handles entropy failures in Sapling proof/signature generation.
Add a native regression suite and a test-only macOS getentropy interposer. It injects failure after 0, 16, and 32 seed bytes and checks the Java exception, unchanged output, exactly one intercepted entropy read, and successful retry. The interposer is never linked into the production JNI library. The suite requires an explicit rebuilt library path; otherwise the entire class is skipped so malformed-input cases cannot run against an old bundled JNI.
Validation on this branch with the pinned Rust source:
- Rebuilt the release Rust static library and JNI for macOS x86_64; JDK 8 ran 37 Java tests successfully (four new regression tests plus 33 existing tests).
- Ran all new cases with the OS entropy interposer enabled.
- Confirmed the new test class skips before loading native code when no rebuilt library path is supplied.
- Rust: 10 ordinary tests and one separately run SDK-parameter proof test passed.
- Reproduction instructions are in
cpp/tests/README.md.
Draft / release gate: the four checked-in native libraries have not been replaced by this PR. Default Maven tests still load those old binaries and do not validate this fix. Before marking ready, rebuild Linux and macOS x86_64/arm64 libraries, exercise the new JNI input checks against each build, package the resulting artifacts, and verify that the JAR contains those exact libraries. macOS fault injection has been tested on x86_64; Linux entropy fault injection is not covered here.
This PR is independently based on SDK master and depends on Rust #13. It does not incorporate the separate nullifier/ZIP32 changes or Rust #12. When combining those changes, update the Rust pin and rebuild all native artifacts from the combined source. The legacy void Rust scalar entry point still aborts on entropy failure; this JNI migration to the checked entry point is required.