test(paymentcryptography): the TR-34 codec answers the standard's own vectors (#9079)

This commit is contained in:
Murtuza Chhil authored and GitHub committed 2026-11-20 07:09:32 -04:00
1 parent dc97ce5cb1
commit 42707716cd
5 files changed
+169 -2

No files matched your search

@@ -680,8 +680,13 @@ public final class Tr34 {
return new Recovered(HEX_UPPER.formatHex(key), header);
}
/** The SHA-256 digest of the given bytes. */
private static byte[] digest(byte[] data) {
/**
* The SHA-256 digest of the given bytes.
*
* <p>The digest is not private, so the vector test can check the samples it reads
* against the digests the standard published with them.
*/
static byte[] digest(byte[] data) {
try {
return MessageDigest.getInstance("SHA-256").digest(data);
} catch (GeneralSecurityException e) {