Skip to content

Implement Encoding for Int Aliases#990

Closed
ycscaly wants to merge 1 commit into
RustCrypto:masterfrom
ycscaly:int_encoding
Closed

Implement Encoding for Int Aliases#990
ycscaly wants to merge 1 commit into
RustCrypto:masterfrom
ycscaly:int_encoding

Conversation

@ycscaly

@ycscaly ycscaly commented Oct 22, 2025

Copy link
Copy Markdown
Contributor

This PR adds a missing functionality for Ixxx types by implementing the Encoding trait.

Work originally done by @erik-3milabs

@codecov

codecov Bot commented Oct 22, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.70%. Comparing base (7ba1398) to head (4d07bdb).
⚠️ Report is 186 commits behind head on master.

Files with missing lines Patch % Lines
src/int/encoding.rs 0.00% 18 Missing ⚠️
src/int/macros.rs 0.00% 18 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #990      +/-   ##
==========================================
- Coverage   79.86%   79.70%   -0.17%     
==========================================
  Files         163      164       +1     
  Lines       17593    17630      +37     
==========================================
+ Hits        14051    14052       +1     
- Misses       3542     3578      +36     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@erik-3milabs

Copy link
Copy Markdown
Contributor

I seem to recall that this code does not adhere to signed integer (de)serialization standards. In fact, I seem to recall this being rejected last year when introducing Int initially.

@ycscaly

ycscaly commented Oct 24, 2025

Copy link
Copy Markdown
Contributor Author

I seem to recall that this code does not adhere to signed integer (de)serialization standards. In fact, I seem to recall this being rejected last year when introducing Int initially.

@tarcieri what changes are needed for this to be accepted? Currently this very important functionality is missing.

@tarcieri

tarcieri commented Nov 5, 2025

Copy link
Copy Markdown
Member

@ycscaly it needs rustfmt for one, and also is triggering codecov due to lack of tests

@erik-3milabs hmm, do you have a more specific reference for that? I can try to dig it up. At first glance this looks fine to me?

@erik-3milabs

erik-3milabs commented Nov 6, 2025

Copy link
Copy Markdown
Contributor

@erik-3milabs hmm, do you have a more specific reference for that? I can try to dig it up. At first glance this looks fine to me?

Found it: we had a discussion about it in this thread. In the end, we decided to yank Encoding from that PR, which was done in this commit.

TL;DR:

Should this (and potentially the other methods) handle signed two's complement wire encodings, which are somewhat commonly used? e.g. ASN.1 BER/DER INTEGER and SSH mpint

@tarcieri

tarcieri commented Mar 5, 2026

Copy link
Copy Markdown
Member

Closing as stale

@tarcieri tarcieri closed this Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants