From d6e043d79f621dfcea234e30041702651cd0647e Mon Sep 17 00:00:00 2001 From: noah Date: Mon, 19 Oct 2026 13:48:13 -0600 Subject: [PATCH] Expose observed BM1370 work ID correlation --- src/bm1370.rs | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/bm1370.rs b/src/bm1370.rs index 4816ea6..3772796 100644 --- a/src/bm1370.rs +++ b/src/bm1370.rs @@ -20,6 +20,14 @@ pub struct NonceReport { pub trailer: u8, } +impl NonceReport { + /// Work ID observed in the Braiins S21 Pro capture. Chip and version + /// attribution remain unknown, and this has no accepted-share proof. + pub fn observed_work_id(&self) -> u8 { + (self.byte7 & 0xf0) >> 1 + } +} + #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum ReportError { Length, @@ -41,9 +49,9 @@ pub fn encode_job(job: &Job) -> Option<[u8; JOB_BYTES]> { Some(frame) } -/// Keep the five trailing bytes raw until work-ID and version-roll mapping is -/// validated against silicon. The marker bit distinguishes nonce reports from -/// register replies in the observed capture. +/// Keep the five trailing bytes raw. The work-ID expression is correlated with +/// same-UART jobs in one capture; chip and version mapping remain unverified. +/// The marker bit distinguishes nonce reports from register replies. pub fn decode_nonce_report(frame: &[u8]) -> Result { if frame.len() != REPORT_BYTES { return Err(ReportError::Length); @@ -152,6 +160,15 @@ mod tests { } } + #[test] + fn observed_work_id_matches_same_uart_job() { + // c2-steady.strace lines 1287 and 1352: job byte 4 is 0x10. + let frame = captured_bytes::("aa554a3488c70022013291"); + let report = decode_nonce_report(&frame).unwrap(); + assert_eq!(report.observed_work_id(), 0x10); + assert_eq!(report.byte7, 0x22); + } + #[test] fn invalid_report_fails_closed() { let mut frame = captured_bytes::("aa555804a92a041e133e86"); -- 2.54.0