Compare commits
5
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
37f1f8433b | ||
|
|
b703c757e4 | ||
|
|
98d891fc67 | ||
|
|
d6e043d79f | ||
|
|
ba286758c7 |
@@ -10,7 +10,9 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: alkane-ci
|
||||
runs-on: alkane-fast
|
||||
container:
|
||||
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:9d2a992bbcb91014af3c85d2e1ec8c5990701cecf83fd06c8d46f9ef13dbd948
|
||||
env:
|
||||
CARGO_TARGET_DIR: target
|
||||
steps:
|
||||
@@ -18,7 +20,7 @@ jobs:
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Build release candidate
|
||||
run: cargo build --release --locked
|
||||
run: cargo build --release --offline --locked
|
||||
- name: Select candidate version
|
||||
id: version
|
||||
run: python3 ci/version.py next >> "$GITHUB_OUTPUT"
|
||||
|
||||
@@ -11,7 +11,9 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
source:
|
||||
runs-on: alkane-ci
|
||||
runs-on: alkane-fast
|
||||
container:
|
||||
image: gitea.bluefla.re/blueflare/alkane-ci@sha256:9d2a992bbcb91014af3c85d2e1ec8c5990701cecf83fd06c8d46f9ef13dbd948
|
||||
env:
|
||||
CARGO_TARGET_DIR: target
|
||||
steps:
|
||||
@@ -21,7 +23,7 @@ jobs:
|
||||
- name: Check source formatting
|
||||
run: cargo fmt --check
|
||||
- name: Build source
|
||||
run: cargo build --release --locked
|
||||
run: cargo build --release --offline --locked
|
||||
- name: Clean generated build
|
||||
if: always()
|
||||
run: python3 ci/cleanup-generated.py
|
||||
|
||||
+20
-3
@@ -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<NonceReport, ReportError> {
|
||||
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::<REPORT_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::<REPORT_BYTES>("aa555804a92a041e133e86");
|
||||
|
||||
Reference in New Issue
Block a user