mirror of
https://github.com/signalapp/SparsePostQuantumRatchet.git
synced 2025-12-08 06:09:47 +00:00
Make raw protobuf types non-pub, update to prost 0.14
Co-authored-by: Rolfe Schmidt <141083381+rolfe-signal@users.noreply.github.com>
This commit is contained in:
parent
ff78d035d9
commit
d48aa6f158
9 changed files with 91 additions and 77 deletions
|
|
@ -12,7 +12,7 @@ mod tests {
|
|||
|
||||
#[bench]
|
||||
fn add_epoch(b: &mut Bencher) {
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
|
||||
.expect("should be valid");
|
||||
let mut e: u64 = 0;
|
||||
b.iter(|| {
|
||||
|
|
@ -28,7 +28,7 @@ mod tests {
|
|||
|
||||
#[bench]
|
||||
fn send_key(b: &mut Bencher) {
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
|
||||
.expect("should be valid");
|
||||
b.iter(|| {
|
||||
// Inner closure, the actual test
|
||||
|
|
@ -38,7 +38,7 @@ mod tests {
|
|||
|
||||
#[bench]
|
||||
fn recv_key(b: &mut Bencher) {
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
|
||||
.expect("should be valid");
|
||||
let mut k: u32 = 0;
|
||||
b.iter(|| {
|
||||
|
|
@ -50,7 +50,7 @@ mod tests {
|
|||
|
||||
#[bench]
|
||||
fn recv_skip_key(b: &mut Bencher) {
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
|
||||
.expect("should be valid");
|
||||
let mut k: u32 = 0;
|
||||
b.iter(|| {
|
||||
|
|
@ -63,7 +63,7 @@ mod tests {
|
|||
|
||||
#[bench]
|
||||
fn recv_with_truncate(b: &mut Bencher) {
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb())
|
||||
let mut c = chain::Chain::new(b"1", Direction::A2B, ChainParams::default().into_pb_test())
|
||||
.expect("should be valid");
|
||||
let mut k: u32 = 0;
|
||||
b.iter(|| {
|
||||
|
|
|
|||
|
|
@ -66,9 +66,9 @@ mod tests {
|
|||
#[bench]
|
||||
fn encoder_from_pb(b: &mut Bencher) {
|
||||
let encoder = PolyEncoder::encode_bytes(&[3u8; 1088]).expect("encode_bytes");
|
||||
let bytes = encoder.into_pb().encode_to_vec();
|
||||
let bytes = encoder.into_pb_test().encode_to_vec();
|
||||
b.iter(|| {
|
||||
black_box(PolyEncoder::from_pb(
|
||||
black_box(PolyEncoder::from_pb_test(
|
||||
pqrpb::PolynomialEncoder::decode(bytes.as_slice()).unwrap(),
|
||||
))
|
||||
});
|
||||
|
|
@ -82,9 +82,9 @@ mod tests {
|
|||
for i in 1..chunks_needed {
|
||||
decoder.add_chunk(&encoder.chunk_at(i));
|
||||
}
|
||||
let bytes = decoder.into_pb().encode_to_vec();
|
||||
let bytes = decoder.into_pb_test().encode_to_vec();
|
||||
b.iter(|| {
|
||||
black_box(PolyDecoder::from_pb(
|
||||
black_box(PolyDecoder::from_pb_test(
|
||||
pqrpb::PolynomialDecoder::decode(bytes.as_slice()).unwrap(),
|
||||
))
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue