Conversation
Follow-up to PR MHumm#102 (points 1, 3, 5, 6). Reading CalculatedAuthenticationTag before Done now raises EDECCipherException. Protected EncodeGCM/EncodeCCM are unified as EncodeAuthenticated (Decode counterpart too). CCM materializes the authentication tag in Done so GCM and CCM share one lifecycle. Modes without prescribed tag lengths document returning an empty array. Co-authored-by: Olaf Monien <omonien@users.noreply.github.com>
Follow-up to PR MHumm#102 (points 2 and 4). CCM can process several Encode/Decode chunks when the total payload length is known (AuthenticatedPayloadLength or a one-shot Size / EncodeStream DataSize). B_0 still encodes l(m) as required by RFC 3610 / NIST SP 800-38C. InitMode keeps the 128-bit block-size check for both GCM and CCM; comments cite the original CCM spec, RFC 3610, and SP 800-38C/38D. SupportsAuthenticatedMultiChunk reports the capability. Co-authored-by: Olaf Monien <omonien@users.noreply.github.com>
…api-2915 AEAD lifecycle/API: tag after Done, EncodeAuthenticated, CCM via Done
…spec-2915 CCM multi-chunk streaming; keep 128-bit InitMode check (spec)
Make TCCM.DeclarePayloadLength fail hard after start or when a different length is declared, while still allowing an idempotent re-declare of the same length. EncodeStream only auto-declares when no length is set yet so multi-chunk streams keep working. Follow-up to MHumm#106. Co-authored-by: Olaf Monien <omonien@users.noreply.github.com>
Owner
Author
|
Opened upstream as MHumm#107 — closing this fork listing as duplicate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to MHumm#106.
Markus noted that
TCCM.DeclarePayloadLengthwas inconsistent:CheckNotFinalizedalready raises after Done, but a call after processing has started or after a length was already declared was silently ignored.Agreed with Markus (“Jupp!”) — this PR applies that:
CheckNotFinalized.EDECCipherException.EDECCipherException.FExpectedPayloadLength/FPayloadLengthDeclaredas before.EncodeStreamonly auto-declares when no payload length is set yet, so existing multi-chunk streams that already setAuthenticatedPayloadLengthkeep working.SupportsMultiChunkstays a Boolean.Unit tests in
TestDECCipherModesCCM.pascover the cases above (including Decode-after-start).Target: intended merge is
MHumm/DelphiEncryptionCompendiumbranchdevelopment(cross-fork). Versus that base the delta is 5 files / +164 −8. This GitHub App cannot open the upstream PR (createPullRequestis not allowed on MHumm); please retarget or open fromomonien:cursor/ccm-declare-payload-length-201bonto MHummdevelopment. The larger diff on this fork PR is only becauseomonien/developmentdoes not yet include merged MHumm#106.