Skip to content

Commit fa78952

Browse files
committed
some minor refactorings.
1 parent e2e1da5 commit fa78952

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

HashLib.Tests/src/CryptoTests.pas

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2718,7 +2718,7 @@ procedure TTestBlake2B.TestNullKeyVsUnKeyed;
27182718
procedure TTestBlake2B.SetUp;
27192719
var
27202720
LIdx: Int32;
2721-
LConfig: TBlake2BConfig;
2721+
LConfig: IBlake2BConfig;
27222722
LKey: TBytes;
27232723
begin
27242724
inherited;
@@ -2857,7 +2857,7 @@ procedure TTestBlake2S.TestNullKeyVsUnKeyed;
28572857
procedure TTestBlake2S.SetUp;
28582858
var
28592859
LIdx: Int32;
2860-
LConfig: TBlake2SConfig;
2860+
LConfig: IBlake2SConfig;
28612861
LKey: TBytes;
28622862
begin
28632863
inherited;

HashLib/src/Base/HlpHashFactory.pas

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,25 +1173,25 @@ class function THashFactory.TCrypto.CreateBlake2B(const AConfig: IBlake2BConfig;
11731173
class function THashFactory.TCrypto.CreateBlake2B_160: IHash;
11741174
begin
11751175
Result := THashFactory.TCrypto.CreateBlake2B
1176-
(TBlake2BConfig.Create(THashSize.hsHashSize160));
1176+
(TBlake2BConfig.Create(THashSize.hsHashSize160) as IBlake2BConfig);
11771177
end;
11781178

11791179
class function THashFactory.TCrypto.CreateBlake2B_256: IHash;
11801180
begin
11811181
Result := THashFactory.TCrypto.CreateBlake2B
1182-
(TBlake2BConfig.Create(THashSize.hsHashSize256));
1182+
(TBlake2BConfig.Create(THashSize.hsHashSize256) as IBlake2BConfig);
11831183
end;
11841184

11851185
class function THashFactory.TCrypto.CreateBlake2B_384: IHash;
11861186
begin
11871187
Result := THashFactory.TCrypto.CreateBlake2B
1188-
(TBlake2BConfig.Create(THashSize.hsHashSize384));
1188+
(TBlake2BConfig.Create(THashSize.hsHashSize384) as IBlake2BConfig);
11891189
end;
11901190

11911191
class function THashFactory.TCrypto.CreateBlake2B_512: IHash;
11921192
begin
11931193
Result := THashFactory.TCrypto.CreateBlake2B
1194-
(TBlake2BConfig.Create(THashSize.hsHashSize512));
1194+
(TBlake2BConfig.Create(THashSize.hsHashSize512) as IBlake2BConfig);
11951195
end;
11961196

11971197
class function THashFactory.TCrypto.CreateBlake2S(const AConfig: IBlake2SConfig;
@@ -1210,25 +1210,25 @@ class function THashFactory.TCrypto.CreateBlake2S(const AConfig: IBlake2SConfig;
12101210
class function THashFactory.TCrypto.CreateBlake2S_128: IHash;
12111211
begin
12121212
Result := THashFactory.TCrypto.CreateBlake2S
1213-
(TBlake2SConfig.Create(THashSize.hsHashSize128));
1213+
(TBlake2SConfig.Create(THashSize.hsHashSize128) as IBlake2SConfig);
12141214
end;
12151215

12161216
class function THashFactory.TCrypto.CreateBlake2S_160: IHash;
12171217
begin
12181218
Result := THashFactory.TCrypto.CreateBlake2S
1219-
(TBlake2SConfig.Create(THashSize.hsHashSize160));
1219+
(TBlake2SConfig.Create(THashSize.hsHashSize160) as IBlake2SConfig);
12201220
end;
12211221

12221222
class function THashFactory.TCrypto.CreateBlake2S_224: IHash;
12231223
begin
12241224
Result := THashFactory.TCrypto.CreateBlake2S
1225-
(TBlake2SConfig.Create(THashSize.hsHashSize224));
1225+
(TBlake2SConfig.Create(THashSize.hsHashSize224) as IBlake2SConfig);
12261226
end;
12271227

12281228
class function THashFactory.TCrypto.CreateBlake2S_256: IHash;
12291229
begin
12301230
Result := THashFactory.TCrypto.CreateBlake2S
1231-
(TBlake2SConfig.Create(THashSize.hsHashSize256));
1231+
(TBlake2SConfig.Create(THashSize.hsHashSize256) as IBlake2SConfig);
12321232
end;
12331233

12341234
class function THashFactory.TCrypto.CreateBlake2BP(AHashSize: Int32;

HashLib/src/Crypto/HlpBlake2B.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,7 @@ function TBlake2BMACNotBuildInAdapter.Clone(): IHash;
22852285
constructor TBlake2BMACNotBuildInAdapter.Create(const ABlake2BKey, ASalt,
22862286
APersonalisation: THashLibByteArray; AOutputLengthInBits: Int32);
22872287
var
2288-
LConfig: TBlake2BConfig;
2288+
LConfig: IBlake2BConfig;
22892289
begin
22902290
LConfig := TBlake2BConfig.Create(AOutputLengthInBits shr 3);
22912291
LConfig.Key := ABlake2BKey;

HashLib/src/Crypto/HlpBlake2S.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2060,7 +2060,7 @@ function TBlake2SMACNotBuildInAdapter.Clone(): IHash;
20602060
constructor TBlake2SMACNotBuildInAdapter.Create(const ABlake2SKey, ASalt,
20612061
APersonalisation: THashLibByteArray; AOutputLengthInBits: Int32);
20622062
var
2063-
LConfig: TBlake2SConfig;
2063+
LConfig: IBlake2SConfig;
20642064
begin
20652065
LConfig := TBlake2SConfig.Create(AOutputLengthInBits shr 3);
20662066
LConfig.Key := ABlake2SKey;

0 commit comments

Comments
 (0)