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>
Owner
Author
|
Opened upstream as MHumm#106 — 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 #102, split as requested (“Gerne in 2 PR”).
Depends on / stacked on the lifecycle/API PR (points 1, 3, 5, 6). Please merge that first; until then this diff vs
developmentalso includes those commits.Please merge against
MHumm/DelphiEncryptionCompendium:developmentasomonien:cursor/feat-ccm-multichunk-spec-2915. This listing is on the fork because the agent token cannot open PRs onMHumm.This PR covers Markus’s CCM multi-chunk / spec points from MHumm#102:
SupportsAuthenticatedMultiChunkis True for GCM and CCM. CCM is still not online (B_0 encodesl(m)); one-shot Encode/Decode without a pre-declared length still worksInitMode128-bit check vs original CCM spec vs RFCCCM multi-chunk (spec-honest)
CCM cannot start until the total payload length is known (
B_0/ RFC 3610). Callers can:Sizeis the whole message (existing tests).AuthenticatedPayloadLengthfirst, then Encode/Decode* , thenDone.EncodeStreamof the full message —DataSizeis declared automatically, so internal buffer-sized Encode calls are correct.Tests
RFC 3610 Packet 1 (23-byte PT, 64-bit tag):
TestEncodeMultiChunkUneven— 8+15TestDecodeMultiChunkUneven— 7+16TestEncodeStreamInternalChunks— smallStreamBufferSizeso one EncodeStream issues several Encode callsTestEncodeStreamMultiChunk— several EncodeStream calls with declared lengthTestSupportsAuthenticatedMultiChunk(CCM and GCM)Out of scope