Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent range check exception #60

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ DEC - Delphi Encryption Compendium
Version 6.5

Copyright (c) 2018 - 2020 Norman Gallery (ng931884 [at] gmx [dot] de)
Copyright (c) 2016 - 2022 Markus Humm (markus [dot] humm [at] googlemail [dot] com) (main contact)
Copyright (c) 2016 - 2023 Markus Humm (markus [dot] humm [at] googlemail [dot] com) (main contact)
Copyright (c) 2008 - 2019 Frederik A. Winkelsdorf (winkelsdorf [at] gmail [dot] com)
Copyright (c) 1999 - 2008 Hagen Reddmann (HaReddmann [at] T-Online [dot] de)

Expand All @@ -27,6 +27,7 @@ Gloegg
pierangelodalben
denovosoftware
alexrayne
Stevie

Parts of the work loosely based on the works of Wolfgang Erhardt, who is
unfortunately dead already.
Expand Down
6 changes: 4 additions & 2 deletions Source/DECCipherModesGCM.pas
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,8 @@ procedure TGCM.DecodeGCM(Source, Dest: TBytes; Size: Integer);
a_tag := XOR_T128(CalcGaloisHash(DataToAuthenticate, Source, Size), FE_K_Y0);

Setlength(FCalcAuthenticationTag, FCalcAuthenticationTagLength);
Move(a_tag[0], FCalcAuthenticationTag[0], FCalcAuthenticationTagLength);
if (FCalcAuthenticationTagLength > 0) then
Move(a_tag[0], FCalcAuthenticationTag[0], FCalcAuthenticationTagLength);

// Check for correct authentication result is in Done of DECCipherModes
// if not IsEqual(FExpectedAuthenticationTag, FCalcAuthenticationTag) then
Expand Down Expand Up @@ -646,7 +647,8 @@ procedure TGCM.EncodeGCM(Source, Dest: TBytes; Size: Integer);

AuthTag := XOR_T128(CalcGaloisHash(DataToAuthenticate, Dest, Size), FE_K_Y0);
Setlength(FCalcAuthenticationTag, FCalcAuthenticationTagLength);
Move(AuthTag[0], FCalcAuthenticationTag[0], FCalcAuthenticationTagLength);
if (FCalcAuthenticationTagLength > 0) then
Move(AuthTag[0], FCalcAuthenticationTag[0], FCalcAuthenticationTagLength);
end;

function TGCM.EncodeT128(Value: T128): T128;
Expand Down