Skip to content

block-buffer: release 0.10 ? #669

Description

@mat-gas

Hi,
I was just wondering, block-buffer has been in pre (0.10.0-preX) state for almost a year now

In 0.10, this commit (#113) is of particular interest because of the "make it almost panic-free" part :
This PR modifies block-buffer and block-padding APIs to reduce their surface and to make them mostly panic-free

As quite some algorithms depends on it, releasing the version here and bumping dependencies should also make those panic-free too

For instance, with this mini-reproducer for the Shabal algorithm, still using block-buffer 0.9:

    let mut a = Shabal256::new();
    a.update(b"\x01");
    a.finalize();

When looking at the assembly:

  if ( (unsigned __int8)sub_9050(a1 + 8, 64LL, *(_QWORD *)a1) )
    sub_6E20(
      "called `Result::unwrap()` on an `Err` value  /home/test/.cargo/registry/src/github.com-1ecc6299db9ec823/shabal-0.3.0/src/shabal.rs",
      43LL,
      v20,
      &off_407B8,
      &off_407D8);

The related unwrap seems to be this one (https://github.com/RustCrypto/hashes/blob/master/shabal/src/shabal.rs#L248)

image

AFAIK, it should be panic-free in 0.10 and the compiler should optimize away this error handling

Again, sorry for the inconvenience and thanks for all the hard work on those different crates

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions