Skip to content

Commit 77aebcd

Browse files
authored
perf(dp_table): inline StoredDP dist as fixed-size array (#88)
1 parent 313eee8 commit 77aebcd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/cpu/dp_table.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ pub(crate) fn scalar_half() -> Scalar {
2222
}
2323

2424
/// Stored DP with full affine X for proper verification
25-
#[derive(Clone)]
25+
#[derive(Clone, Copy)]
2626
struct StoredDP {
2727
affine_x: [u8; 32],
28-
dist: Vec<u8>,
28+
dist: [u8; 32],
2929
ktype: u32,
3030
}
3131

@@ -163,7 +163,7 @@ impl DPTable {
163163
}
164164
existing_list.push(StoredDP {
165165
affine_x,
166-
dist: dist_bytes.to_vec(),
166+
dist: dist_bytes,
167167
ktype: dp.ktype,
168168
});
169169
self.total_dps += 1;
@@ -177,7 +177,7 @@ impl DPTable {
177177
hash_key,
178178
vec![StoredDP {
179179
affine_x,
180-
dist: dist_bytes.to_vec(),
180+
dist: dist_bytes,
181181
ktype: dp.ktype,
182182
}],
183183
);

0 commit comments

Comments
 (0)