cesride icon indicating copy to clipboard operation
cesride copied to clipboard

ed448 poc

Open jasoncolburne opened this issue 3 years ago • 1 comments

The crate is marked specifically as not suitable for production, but I wanted to see if things would work. I found issues with the Sizage tables.

The problems occured due to the representation of a compressed point as 57 octets, where the codes for Ed448_Seed and X448 only allow for exactly 448 bits (56 octets). I suppose we could try to avoid encoding the sign but the spec says to use 57 bytes:

https://www.rfc-editor.org/rfc/rfc8032

See Section 5.2.6, for an example.

76 b64 chars - 1 code char = 75 b64 chars * 3 octets / 4 b64 chars = 56.25 octets. We also can't (not that we should) abuse that 0.25 because padding checks will explode.

The other codes for public keys were correct in length, with fs == 80 and a 4 char code, leaving 76 b64 chars = 57 octets.

Incorrect, however, was the Matter/Cigar signature length which was indicated to be fs == 56, when in reality 156 is the correct value for a 4 char code (152 b64 chars = 114 octets).

jasoncolburne avatar Mar 06 '23 15:03 jasoncolburne

Codecov Report

Merging #119 (70a8516) into main (f00a844) will decrease coverage by 0.39%. The diff coverage is 71.11%.

@@            Coverage Diff             @@
##             main     #119      +/-   ##
==========================================
- Coverage   94.88%   94.50%   -0.39%     
==========================================
  Files          29       29              
  Lines        2778     2820      +42     
==========================================
+ Hits         2636     2665      +29     
- Misses        142      155      +13     
Impacted Files Coverage Δ
src/core/cigar.rs 97.36% <ø> (ø)
src/core/verfer.rs 100.00% <ø> (ø)
src/core/signer.rs 87.75% <28.57%> (-4.56%) :arrow_down:
src/crypto/sign.rs 90.69% <77.14%> (-9.31%) :arrow_down:
src/core/matter/tables.rs 100.00% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

codecov[bot] avatar Mar 06 '23 15:03 codecov[bot]