Skip to content

Commit

Permalink
feat!: implement reconstruct for leopard ffe8 (#5)
Browse files Browse the repository at this point in the history
Co-authored-by: Mikołaj Florkiewicz <mikolaj@florkiewicz.me>
  • Loading branch information
zvolin and fl0rek authored Feb 27, 2024
1 parent 115e308 commit 1e538fe
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 24 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'

- name: Install wasm Rust
uses: actions-rs/toolchain@v1
with:
Expand All @@ -31,6 +36,11 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'

- name: Run rustdoc check
env:
RUSTDOCFLAGS: -D warnings
Expand All @@ -50,6 +60,11 @@ jobs:
steps:
- uses: actions/checkout@v1

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'

- name: Set up cargo cache
uses: actions/cache@v3
with:
Expand All @@ -75,6 +90,11 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- name: Install Go
uses: actions/setup-go@v4
with:
go-version: '1.22.x'

- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly

Expand Down
5 changes: 1 addition & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,5 @@ test-strategy = "0.3"
[workspace]
members = ["go-leopard"]

[profile.test.package.proptest]
opt-level = 3

[profile.test.package.rand_chacha]
[profile.test]
opt-level = 3
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ The 8-bit implementation should be used with up to 256 total shards and 16-bit w
shards are needed.

- [x] Encoding parity shards using 8-bit leopard algorithm
- [ ] Reconstructing shards using 8-bit leopard algorithm
- [x] Reconstructing shards using 8-bit leopard algorithm
- [ ] Encoding parity shards using 16-bit leopard algorithm
- [ ] Reconstructing shards using 16-bit leopard algorithm
2 changes: 1 addition & 1 deletion go-leopard/go/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/eigerco/leopard-codec

go 1.23
go 1.22.0

require (
github.com/klauspost/cpuid/v2 v2.2.6 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go-leopard/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Rust wrapper over Go's reedsolomon module

use std::ffi::c_uchar;
use std::{ffi::c_uchar, ops::DerefMut};

use thiserror::Error;

Expand All @@ -26,7 +26,7 @@ pub enum Error {

/// Encode the shards using the Go's reedsolomon module
pub fn encode(
shards: &mut [&mut [u8]],
shards: &mut [impl DerefMut<Target = [u8]>],
data_shards: usize,
shard_size: usize,
) -> Result<(), Error> {
Expand Down
Loading

0 comments on commit 1e538fe

Please sign in to comment.