Skip to content

Commit

Permalink
mastic: Change byte order of algorithm ID (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
cjpatton authored Jan 17, 2025
1 parent c31b0a0 commit 9eac4c1
Show file tree
Hide file tree
Showing 11 changed files with 121 additions and 121 deletions.
2 changes: 1 addition & 1 deletion src/vdaf/mastic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl<T: Type> Mastic<T> {
let vidpf = Vidpf::new(bits, typ.input_len() + 1)?;
let szk = Szk::new(typ, algorithm_id);
Ok(Self {
id: algorithm_id.to_le_bytes(),
id: algorithm_id.to_be_bytes(),
szk,
vidpf,
})
Expand Down
2 changes: 1 addition & 1 deletion src/vdaf/mastic/szk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ impl<T: Type> Szk<T> {
pub fn new(typ: T, algorithm_id: u32) -> Self {
Self {
typ,
id: algorithm_id.to_le_bytes(),
id: algorithm_id.to_be_bytes(),
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/vdaf/test_vec/mastic/04/MasticCount_0.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"prep": [
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -42,8 +42,8 @@
],
"prep_shares": [
[
"e5633260ecd70036482bbf2c93887bf4347c130f587247d63fe537250bb3c49382518600b8bd84150c9df3154968eb00fd6949610bbaa838f528e845e9b134bf",
"e5633260ecd70036482bbf2c93887bf4347c130f587247d63fe537250bb3c4937fae79ff46427bea6814d366e7d3bd95781ac4b7ab90e6a99f6399ebb8914e6d"
"27df2bc95381e15c7b1f9041a920108566f8bc1a575118bd330419d541111a3a32adc6a5e6752ca71b50e7ea2c9c5f9147562204971d4f5ab3899b1602792077",
"27df2bc95381e15c7b1f9041a920108566f8bc1a575118bd330419d541111a3acf52395a188ad3584d059aa738469d12c21ccf0f85cb234f945d3ad6d3e59604"
]
],
"public_share": "0e30118b55bf77ff34817d80025c5c736b1ee2188425350e71cc1dc5a779de3e6ff0676312c362381937b2713cf2d65c6bfd5e3a8400fe1b3f71da0726d672f55f893f521233758b42d37212b7a0c5d64e450af652ace0e50986026a123de440e13432801b02eeda044017d8cc739b4f93ea6360a4887c1b1f4e688c4a6b02a111",
Expand Down
6 changes: 3 additions & 3 deletions src/vdaf/test_vec/mastic/04/MasticCount_1.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"prep": [
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -42,8 +42,8 @@
],
"prep_shares": [
[
"da7b578f9408c348b22ae735a3693ba6911b45de47b0a3502055735eddf5c85382518600b8bd8415522695511228b9228a6b0a9d88a7f97af0b1b62107f08c47",
"da7b578f9408c348b22ae735a3693ba6911b45de47b0a3502055735eddf5c8537fae79ff46427beaf79ffb3f48d217d30f4b40b400becf0407f72fed209095f2"
"8b04ead46911fadcdf7726b95529cb27c87ae608e39c305c4fbc8ce13f1eb95232adc6a5e6752ca7c83a5b8702e6f22a323cdfd147ff9f44a16e9dcaf4970130",
"8b04ead46911fadcdf7726b95529cb27c87ae608e39c305c4fbc8ce13f1eb952cf52395a188ad358b81698d005cf7fe62c87813ba7dd380b054b6254b151f09f"
]
],
"public_share": "0e30118b55bf77ff34817d80025c5c736b1ee2188425350e71cc1dc5a779de3e6ff0676312c362381937b2713cf2d65c6bfd5e3a8400fe1b3f71da0726d672f55f893f521233758b42d37212b7a0c5d64e450af652ace0e50986026a123de440e13432801b02eeda044017d8cc739b4f93ea6360a4887c1b1f4e688c4a6b02a111",
Expand Down
48 changes: 24 additions & 24 deletions src/vdaf/test_vec/mastic/04/MasticCount_2.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions src/vdaf/test_vec/mastic/04/MasticCount_3.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"prep": [
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -70,16 +70,16 @@
],
"prep_shares": [
[
"b3cd0aed8a950172f79946eb28e09d9620dbe29c46e043069eab50900f1b8a4f",
"b3cd0aed8a950172f79946eb28e09d9620dbe29c46e043069eab50900f1b8a4f"
"0a97b4006882b8e43fcc8ac3abf84a7565577c6c7a09975bf262a5722f148b20",
"0a97b4006882b8e43fcc8ac3abf84a7565577c6c7a09975bf262a5722f148b20"
]
],
"public_share": "8d038031b3e41fc4b2fe2a3f77de06db7fe0806225f5601afc6f1578ceb8a6d174c50c4eecaffdf4f2310f168d03c5a4cbfc4c3ed6bc04479d05151e4f21be576a880c8ec3143a6b9fb9509d7d0658fc05dc149b0a3cb2046aef8e96793a0ac548f123fcc6eebe7973c8a4500651955a500673e19649c10909b051ef18c08828de79e178096261b4c3169c50015389bba0478bf97610f7213fc164c370974ff59af7ee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d95195d8a6ed1b06313abfd68aed8386c912daf717fa863f9be15f7deed160398a19baaaf1d852effaecf38087b1f17ad19b1e80e4d3db60256766001b0a4c38a898a85aa6f8e3232ffd494468e9fb68a47adaf0c8208509e03347be29702fece293d8af82c3d087c30ea20ac9bb6d0f2d87c22beaa9561bff4925c071d452e2d774d",
"rand": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
},
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -132,16 +132,16 @@
],
"prep_shares": [
[
"b3cd0aed8a950172f79946eb28e09d9620dbe29c46e043069eab50900f1b8a4f",
"b3cd0aed8a950172f79946eb28e09d9620dbe29c46e043069eab50900f1b8a4f"
"0a97b4006882b8e43fcc8ac3abf84a7565577c6c7a09975bf262a5722f148b20",
"0a97b4006882b8e43fcc8ac3abf84a7565577c6c7a09975bf262a5722f148b20"
]
],
"public_share": "8d038031b3e41fc4b2fe2a3f77de06db7fe0806225f5601afc6f1578ceb8a6d174c50c4eecaffdf4f2310f168d03c5a4cbfc4c3ed6bc04479d05151e4f21be576a880c8ec3143a6b9fb9509d7d0658fc05dc149b0a3cb2046aef8e96793a0ac548f123fcc6eebe7973c8a4500651955a500673e19649c10909b051ef18c08828de79e178096261b4c3169c50015389bba0478bf97610f7213fc164c370974ff59af7ee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d95195d8a6ed1b06313abfd68aed8386c912daf717fa863f9be15f7deed160398a19baaaf1d852effaecf38087b1f17ad19b1e80e4d3db60256766001b0a4c38a898a85aa6f8e3232ffd494468e9fb68a47adaf0c8208509e03347be29702fece293d8af82c3d087c30ea20ac9bb6d0f2d87c22beaa9561bff4925c071d452e2d774d",
"rand": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
},
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -194,16 +194,16 @@
],
"prep_shares": [
[
"c9d0da8cfc02347b2b1d9045be754e283d2141b33d77a38a2666ad6329566c48",
"c9d0da8cfc02347b2b1d9045be754e283d2141b33d77a38a2666ad6329566c48"
"3eab601c6a0f9dbb9bacc21e004ac6983a6ab1e0baa7cc44115361f3ff5af459",
"3eab601c6a0f9dbb9bacc21e004ac6983a6ab1e0baa7cc44115361f3ff5af459"
]
],
"public_share": "7d038031b3e41fc4b2fe2a3f77de06db7fe0806225f5601afc6f1578ceb8a6d174c5848d58535ab915bafb428087a2f62dbc76138f52a253028dda7eae3b502b33a9e821410b02d88a837bc1be5f59b920e4149b0a3cb2046aef8e96793a0ac548f123fcc6eebe7973c8a4500651955a5006024a26201bd34c0c4a4cdc45998b19adf4c9f946b4430a94eee7e5347e4fd8ca08c7752a400682f85f764f00e454aa8eee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d95195d8a6ed1b06313abfd68aed8386c912daf717fa863f9be15f7deed160398a19bf9f059a1bd2f7dc042c265cc3a3996d66a9c40e98baee3afa152bf3409e125d8d198350d02b43d48d2d0107db1d8852adf97fcd85574b13921482e2aac8dc9f4445b323b3f134362290326a68932ff3074c171f37827428c61790656b82b9815",
"rand": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
},
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -256,16 +256,16 @@
],
"prep_shares": [
[
"7216b1776a3e04a2ac0b7e6d28cc25ebec003be7fe6a43141c10e352df529923",
"7216b1776a3e04a2ac0b7e6d28cc25ebec003be7fe6a43141c10e352df529923"
"f976022816c15ffdaef3ae6816940037bfcff5df9924447dc533ce886ab91a86",
"f976022816c15ffdaef3ae6816940037bfcff5df9924447dc533ce886ab91a86"
]
],
"public_share": "7d008031b3e41fc4b2fe2a3f77de06db7fe0806225f5601afc6f1578ceb8a6d174c5848d58535ab915bafb428087a2f62dbc76138f52a253028dda7eae3b502b33a916e5a7207c22876c3e8651e6ec087889149b0a3cb2046aef8e96793a0ac548f123fcc6eebe7973c8a4500651955a5006024a26201bd34c0c4a4cdc45998b19adf4c9f946b4430a94eee7e5347e4fd8ca85fb7348903670f480514fbeb9082d79ee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d95195d8a6ed1b06313abfd68aed8386c912daf717fa863f9be15f7deed160398a19bf9f059a1bd2f7dc042c265cc3a3996d66a9c40e98baee3afa152bf3409e125d8d198350d02b43d48d2d0107db1d8852adf97fcd85574b13921482e2aac8dc9f4dd4a100279307c773f9edeccc2e2326af46998f278998fa21f7e0219e2fa7bf4",
"rand": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
},
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -318,16 +318,16 @@
],
"prep_shares": [
[
"66e2a7759d077c408a12e7d051cc184d1836e2e9d0a9519a200da0997ca41e66",
"66e2a7759d077c408a12e7d051cc184d1836e2e9d0a9519a200da0997ca41e66"
"3d845f82d4941801f70f9d764c5474e8446bc22fbf160ce7d9c6d813888e3bbe",
"3d845f82d4941801f70f9d764c5474e8446bc22fbf160ce7d9c6d813888e3bbe"
]
],
"public_share": "f1008031b3e41fc4b2fe2a3f77de06db7fe06eb6ffd9b0e2083236efcc45c94d7ca7c061c2d66fafdc0b34509f1ee246cbb15e5ac395c89a2db8dbb05470e32bb53f2e5dce6ec3fc1614aeae2cc0abde9ed7149b0a3cb2046aef8e96793a0ac548f162d5e495135c2e58052f8f36198892949f86b8b81414971f05f924425ae428b5a936fed7a48b510d19fd09bbfab24426f53efa61f0150248095da69d5a7c1f4fee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d951995ab0e635ea4fedf3caa17b706f31176ecf46fb2e546968cacd3a14cc0d62fa67c6a09c7f01c16d806cec200dc627740e5f34a4a7ea2e9e55e3194a8652a67860743cae347ccd1d6500674997f9434c2b9d10c2045b0334a5f6011d684811832b216b9c711ae4a9c4cb19fce661cfadaa821b51f5fbf87fc26694836ce0248e9",
"rand": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
},
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -380,16 +380,16 @@
],
"prep_shares": [
[
"1d12dfd5d8e831d525bcbe038a44a9a93bc63c7a7bb7e20cf65e699723c961ea",
"1d12dfd5d8e831d525bcbe038a44a9a93bc63c7a7bb7e20cf65e699723c961ea"
"4f544ae523a7700fa951fc737daebe5e97e3eff452c7b41de8ca1c5c4460ea48",
"4f544ae523a7700fa951fc737daebe5e97e3eff452c7b41de8ca1c5c4460ea48"
]
],
"public_share": "31028031b3e41fc4b2fe2a3f77de06db7fe06eb6ffd9b0e2083236efcc45c94d7ca7c061c2d66fafdc0b34509f1ee246cbb18481284d0d1422caa93c58f805ae12fc96571eb833cf5d83fb68cbb285da472b149b0a3cb2046aef8e96793a0ac548f162d5e495135c2e58052f8f36198892949f86b8b81414971f05f924425ae428b556e4139b9825e7e74c4196275f57f2fc35eb52f72c55e93e3193770130eeba06ee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d951995ab0e635ea4fedf3caa17b706f31176ecf46fb2e546968cacd3a14cc0d62fa67c6a09c7f01c16d806cec200dc627740e5f34a4a7ea2e9e55e3194a8652a6786e7470ead40be1b247b55d606b969ae0c3d0360c532198dcad4e005bf46c41a53dba6144791872eda1df638dddb9611af728d28038b36219984799f53979b99c7",
"rand": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
},
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -442,16 +442,16 @@
],
"prep_shares": [
[
"1d12dfd5d8e831d525bcbe038a44a9a93bc63c7a7bb7e20cf65e699723c961ea",
"1d12dfd5d8e831d525bcbe038a44a9a93bc63c7a7bb7e20cf65e699723c961ea"
"4f544ae523a7700fa951fc737daebe5e97e3eff452c7b41de8ca1c5c4460ea48",
"4f544ae523a7700fa951fc737daebe5e97e3eff452c7b41de8ca1c5c4460ea48"
]
],
"public_share": "31028031b3e41fc4b2fe2a3f77de06db7fe06eb6ffd9b0e2083236efcc45c94d7ca7c061c2d66fafdc0b34509f1ee246cbb18481284d0d1422caa93c58f805ae12fc96571eb833cf5d83fb68cbb285da472b149b0a3cb2046aef8e96793a0ac548f162d5e495135c2e58052f8f36198892949f86b8b81414971f05f924425ae428b556e4139b9825e7e74c4196275f57f2fc35eb52f72c55e93e3193770130eeba06ee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d951995ab0e635ea4fedf3caa17b706f31176ecf46fb2e546968cacd3a14cc0d62fa67c6a09c7f01c16d806cec200dc627740e5f34a4a7ea2e9e55e3194a8652a6786e7470ead40be1b247b55d606b969ae0c3d0360c532198dcad4e005bf46c41a53dba6144791872eda1df638dddb9611af728d28038b36219984799f53979b99c7",
"rand": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
},
{
"input_shares": [
"000102030405060708090a0b0c0d0e0f2712998769f26b6277b32c9f3a40c040110fbc523feaddcea2f553d5770bb55232e052d8e61616f7",
"000102030405060708090a0b0c0d0e0fbc9d4edba668bfa99c817dcb3af8b3608b53977f5cd619325599c61e6fd457021a9b2a9af0ab24d5",
"101112131415161718191a1b1c1d1e1f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f"
],
"measurement": [
Expand Down Expand Up @@ -504,8 +504,8 @@
],
"prep_shares": [
[
"1d12dfd5d8e831d525bcbe038a44a9a93bc63c7a7bb7e20cf65e699723c961ea",
"1d12dfd5d8e831d525bcbe038a44a9a93bc63c7a7bb7e20cf65e699723c961ea"
"4f544ae523a7700fa951fc737daebe5e97e3eff452c7b41de8ca1c5c4460ea48",
"4f544ae523a7700fa951fc737daebe5e97e3eff452c7b41de8ca1c5c4460ea48"
]
],
"public_share": "31028031b3e41fc4b2fe2a3f77de06db7fe06eb6ffd9b0e2083236efcc45c94d7ca7c061c2d66fafdc0b34509f1ee246cbb18481284d0d1422caa93c58f805ae12fc96571eb833cf5d83fb68cbb285da472b149b0a3cb2046aef8e96793a0ac548f162d5e495135c2e58052f8f36198892949f86b8b81414971f05f924425ae428b556e4139b9825e7e74c4196275f57f2fc35eb52f72c55e93e3193770130eeba06ee93800b487bd2d95f87686634e4c74723ab3aa3d8e288a63d584e3ce60d951995ab0e635ea4fedf3caa17b706f31176ecf46fb2e546968cacd3a14cc0d62fa67c6a09c7f01c16d806cec200dc627740e5f34a4a7ea2e9e55e3194a8652a6786e7470ead40be1b247b55d606b969ae0c3d0360c532198dcad4e005bf46c41a53dba6144791872eda1df638dddb9611af728d28038b36219984799f53979b99c7",
Expand Down
Loading

0 comments on commit 9eac4c1

Please sign in to comment.