sha3.pas 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560
  1. unit SHA3;
  2. {SHA3 functions (including SHAKE) based on Keccak}
  3. interface
  4. {$i STD.INC}
  5. (*************************************************************************
  6. DESCRIPTION : SHA3 functions (including SHAKE) based on Keccak
  7. REQUIREMENTS : TP5-7, D1-D7/D9-D10/D12/D17-D18, FPC, VP
  8. EXTERNAL DATA : ---
  9. MEMORY USAGE : ---
  10. DISPLAY MODE : ---
  11. REFERENCES : SHA3:
  12. FIPS 202 SHA-3 Standard: 'Permutation-Based Hash and
  13. Extendable-Output Functions' available from
  14. http://csrc.nist.gov/publications/PubsFIPS.html or
  15. http://dx.doi.org/10.6028/NIST.FIPS.202 or
  16. http://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.202.pdf
  17. Keccak:
  18. https://github.com/gvanas/KeccakCodePackage
  19. http://keccak.noekeon.org/KeccakReferenceAndOptimized-3.2.zip
  20. http://keccak.noekeon.org/KeccakKAT-3.zip (17MB)
  21. http://csrc.nist.gov/groups/ST/hash/documents/SHA3-C-API.pdf
  22. REMARKS : 1. For 32-bit compilers with int64 (FPC, D6+) there are
  23. conditional defines to optionally use MMX or 64-bit code.
  24. 2. The current implementation needs little-endian machines
  25. Version Date Author Modification
  26. ------- -------- ------- ------------------------------------------
  27. 0.01 17.10.12 W.Ehrhardt Initial BP7 version from Keccak-simple32BI.c
  28. 0.02 18.10.12 we Fixed buf in xorIntoState
  29. 0.03 18.10.12 we Other compilers
  30. 0.04 19.10.12 we Separate unit
  31. 0.05 20.10.12 we Functions from KeccakSponge
  32. 0.06 21.10.12 we Functions from KeccakNISTInterface
  33. 0.07 21.10.12 we D2-D6 with ASM RotL function
  34. 0.08 22.10.12 we Include files keccperm.i16 and .i32
  35. 0.09 22.10.12 we __P2I type casts removed
  36. 0.10 22.10.12 we References, comments, remarks
  37. 0.11 25.10.12 we Make partialBlock longint
  38. 0.12 30.10.12 we Packed arrays, type TKDQueue
  39. 0.13 31.10.12 we Partially unrolled 64-bit code from Keccak-inplace.c
  40. 0.14 01.11.12 we Compact 64-bit code from Botan
  41. 0.15 02.11.12 we 64-bit code about 20% faster with local data
  42. 0.16 09.11.12 we KeccakFullBytes, TKeccakMaxDigest
  43. 0.17 12.11.12 we USE32BIT forces skipping of 64-bit code
  44. 0.18 12.04.14 we Unit renamed to SHA3, SHA3 type definitions
  45. 0.19 12.04.14 we SHA3_Init, SHA3_Update, SHA3_FinalEx
  46. 0.20 13.04.14 we SHA3_UpdateXL, SHA3_FinalHash, byte sized messages work
  47. 0.21 14.04.14 we LSB bit sized messages, SHA3_FinalBit_LSB, working SHAKE
  48. 0.22 11.05.14 we Fix duplicate return result and a few typos
  49. 0.23 08.08.15 we TSpongeState with words and Fill3, assert HASHCTXSIZE
  50. 0.24 09.08.15 we SHA3_FinalBit update final bits in MSB format
  51. 0.25 09.08.15 we Removed unused Keccak leftovers
  52. 0.26 09.08.15 we Error field in context, rewrite error handling
  53. 0.27 16.08.15 we Some code cleanup
  54. 0.28 17.08.15 we Updated references
  55. 0.29 26.08.15 we $defines USE_64BITCODE, USE_MMXCODE
  56. 0.30 23.04.16 we USE_MMX_AKP
  57. *************************************************************************)
  58. (*-------------------------------------------------------------------------
  59. Copyright (C) 2012-2016 Wolfgang Ehrhardt
  60. Copyright (C) 2025 Alexander Koblov ([email protected])
  61. This software is provided 'as-is', without any express or implied warranty.
  62. In no event will the authors be held liable for any damages arising from
  63. the use of this software.
  64. Permission is granted to anyone to use this software for any purpose,
  65. including commercial applications, and to alter it and redistribute it
  66. freely, subject to the following restrictions:
  67. 1. The origin of this software must not be misrepresented; you must not
  68. claim that you wrote the original software. If you use this software in
  69. a product, an acknowledgment in the product documentation would be
  70. appreciated but is not required.
  71. 2. Altered source versions must be plainly marked as such, and must not be
  72. misrepresented as being the original software.
  73. 3. This notice may not be removed or altered from any source distribution.
  74. ---------------------------------------------------------------------------
  75. *NOTE FROM THE DESIGNERS OF KECCAK*
  76. The Keccak sponge function, designed by Guido Bertoni, Joan Daemen,
  77. Michael Peeters and Gilles Van Assche. For more information, feedback or
  78. questions, please refer to our website: http://keccak.noekeon.org/
  79. Implementation by the designers (and Ronny Van Keer), hereby denoted
  80. as "the implementer".
  81. To the extent possible under law, the implementer has waived all copyright
  82. and related or neighboring rights to the source code in this file.
  83. http://creativecommons.org/publicdomain/zero/1.0/
  84. ----------------------------------------------------------------------------*)
  85. uses
  86. BTypes, Hash;
  87. const
  88. SHA3_ERR_INVALID_ALG = 1;
  89. SHA3_ERR_WRONG_FINAL = 2;
  90. const
  91. KeccakPermutationSize = 1600;
  92. KeccakMaximumRate = 1536;
  93. KeccakPermutationSizeInBytes = KeccakPermutationSize div 8;
  94. KeccakMaximumRateInBytes = KeccakMaximumRate div 8;
  95. type
  96. TState_B = packed array[0..KeccakPermutationSizeInBytes-1] of byte;
  97. TState_L = packed array[0..(KeccakPermutationSizeInBytes) div 4 - 1] of longint;
  98. TKDQueue = packed array[0..KeccakMaximumRateInBytes-1] of byte;
  99. type
  100. TSpongeState = packed record
  101. state: TState_B;
  102. dataQueue: TKDQueue;
  103. rate: word;
  104. capacity: word;
  105. bitsInQueue: word;
  106. fixedOutputLength: word;
  107. bitsAvailableForSqueezing: word;
  108. squeezing: word;
  109. Error: int16;
  110. Fill3: packed array[407..HASHCTXSIZE] of byte;
  111. end;
  112. {---------------------------------------------------------------------------}
  113. {------------------ S H A 3 / S H A K E functions -----------------------}
  114. {---------------------------------------------------------------------------}
  115. type
  116. TSHA3State = TSpongeState; {Hash state context}
  117. type
  118. TSHA3_Algo = (__SHA3_224, __SHA3_256, __SHA3_384, __SHA3_512, __SHAKE_128, __SHAKE_256);
  119. function SHA3_Init(var state: TSHA3State; algo: TSHA3_Algo): integer;
  120. {-Initialize the state of the Keccak[r, c] sponge function. The rate r and the}
  121. { capacity c values are determined from the SHA3 algorithm. Result 0=success. }
  122. function SHA3_UpdateXL(var state: TSHA3State; Msg: pointer; Len: longint): integer;
  123. {-Update context with Msg data of Len bytes}
  124. function SHA3_Update(var state: TSHA3State; Msg: pointer; Len: word): integer;
  125. {-Update context with Msg data of Len bytes}
  126. function SHA3_FinalHash(var state: TSHA3State; digest: pointer): integer;
  127. {-Compute SHA3 hash digest and store into hashval. Only for hash}
  128. { algorithms, result WRONG_FINAL if called for SHAKE functions. }
  129. function SHA3_FinalBit_LSB(var state: TSHA3State; bits: byte; bitlen: integer; hashval: pointer; numbits: longint): integer;
  130. {-Update final bits in LSB format, pad, and compute hashval}
  131. function SHA3_FinalBit(var state: TSHA3State; bits: byte; bitlen: integer; hashval: pointer; numbits: longint): integer;
  132. {-Update final bits in MSB format, pad, and compute hashval}
  133. {SHA3_LastError is set by SHA-3 functions which return an error code, where other}
  134. {units/algorithms use procedures. Note that the error variable should be treated }
  135. {as dummy because it is shared over all contexts/threads etc. The context field }
  136. {TSHA3State.error is used to handle context related errors. It will be set to }
  137. {0=no error during context initialization.}
  138. var
  139. SHA3_LastError: integer = 0;
  140. implementation
  141. {$IF DEFINED(CPUX86_64)}
  142. uses
  143. CPU;
  144. {$ENDIF}
  145. {---------------------------------------------------------------------------}
  146. {Helper types}
  147. {$ifndef BIT16}
  148. type
  149. TBABytes = array[0..MaxLongint-1] of byte;
  150. {$else}
  151. type
  152. TBABytes = array[0..$FFF0-1] of byte;
  153. {$endif}
  154. type
  155. PBA = ^TBABytes;
  156. {---------------------------------------------------------------------------}
  157. {$IF DEFINED(CPUX86_64)}
  158. {$include kperm_ax.inc}
  159. var
  160. KeccakPermutation: procedure(var state: TState_L);
  161. xorIntoState: procedure(var state: TState_L; inp: PLongint; laneCount: integer);
  162. extractFromState: procedure(outp: pointer; const state: TState_L; laneCount: integer);
  163. {$ELSEIF DEFINED(CPU64)}
  164. {$MACRO ON}
  165. {$DEFINE xorIntoState64:= xorIntoState}
  166. {$DEFINE extractFromState64:= extractFromState}
  167. {$DEFINE KeccakPermutation64:= KeccakPermutation}
  168. {$ENDIF}
  169. {$IF DEFINED(CPUI386)}
  170. {$include kperm_mx.inc}
  171. {$ELSEIF DEFINED(CPU64)}
  172. {$include kperm_64.inc}
  173. {$ELSE}
  174. {$include kperm_32.inc}
  175. {$ENDIF}
  176. {---------------------------------------------------------------------------}
  177. procedure KeccakAbsorb(var state: TState_B; data: pointer; laneCount: integer);
  178. begin
  179. xorIntoState(TState_L(state),data,laneCount);
  180. KeccakPermutation(TState_L(state));
  181. end;
  182. {---------------------------------------------------------------------------}
  183. function InitSponge(var state: TSpongeState; rate, capacity: integer): integer;
  184. {-Function to initialize the state of the Keccak sponge function.}
  185. { The sponge function is set to the absorbing phase. Result=0 if }
  186. { success, 1 if rate and/or capacity are invalid.}
  187. begin
  188. InitSponge := 1;
  189. {This is the only place where state.error is reset to 0 = SUCCESS}
  190. fillchar(state, sizeof(state),0);
  191. if (rate+capacity <> 1600) or (rate <= 0) or (rate >= 1600) or ((rate and 63) <> 0) then begin
  192. state.error := 1;
  193. exit;
  194. end;
  195. state.rate := rate;
  196. state.capacity := capacity;
  197. InitSponge := 0;
  198. end;
  199. {---------------------------------------------------------------------------}
  200. procedure AbsorbQueue(var state: TSpongeState);
  201. {-Absorb remaining bits from queue}
  202. begin
  203. {state.bitsInQueue is assumed to be equal to state.rate}
  204. KeccakAbsorb(state.state, @state.dataQueue, state.rate div 64);
  205. state.bitsInQueue := 0;
  206. end;
  207. {---------------------------------------------------------------------------}
  208. function Absorb(var state: TSpongeState; data: pointer; databitlen: longint): integer;
  209. {-Function to give input data for the sponge function to absorb}
  210. var
  211. i, j, wholeBlocks, partialBlock: longint;
  212. partialByte: integer;
  213. curData: pByte;
  214. begin
  215. Absorb := 1;
  216. if state.error<>0 then exit; {No further action}
  217. if (state.bitsInQueue and 7 <> 0) or (state.squeezing<>0) then begin
  218. {Only the last call may contain a partial byte}
  219. {and additional input if squeezing}
  220. state.error := 1;
  221. exit;
  222. end;
  223. i := 0;
  224. while i < databitlen do begin
  225. if ((state.bitsInQueue=0) and (databitlen >= state.rate) and (i <= (databitlen-state.rate))) then begin
  226. wholeBlocks := (databitlen-i) div state.rate;
  227. curData := @PBA(data)^[i div 8];
  228. j := 0;
  229. while j<wholeBlocks do begin
  230. KeccakAbsorb(state.state, curData, state.rate div 64);
  231. inc(j);
  232. inc(Ptr2Inc(curData), state.rate div 8);
  233. end;
  234. inc(i, wholeBlocks*state.rate);
  235. end
  236. else begin
  237. partialBlock := databitlen - i;
  238. if partialBlock+state.bitsInQueue > state.rate then begin
  239. partialBlock := state.rate - state.bitsInQueue;
  240. end;
  241. partialByte := partialBlock and 7;
  242. dec(partialBlock, partialByte);
  243. move(PBA(data)^[i div 8], state.dataQueue[state.bitsInQueue div 8], partialBlock div 8);
  244. inc(state.bitsInQueue, partialBlock);
  245. inc(i, partialBlock);
  246. if state.bitsInQueue=state.rate then AbsorbQueue(state);
  247. if partialByte > 0 then begin
  248. state.dataQueue[state.bitsInQueue div 8] := PBA(data)^[i div 8] and ((1 shl partialByte)-1);
  249. inc(state.bitsInQueue, partialByte);
  250. inc(i, partialByte);
  251. end;
  252. end;
  253. end;
  254. Absorb := 0;
  255. end;
  256. {---------------------------------------------------------------------------}
  257. procedure PadAndSwitchToSqueezingPhase(var state: TSpongeState);
  258. var
  259. i: integer;
  260. begin
  261. {Note: the bits are numbered from 0=LSB to 7=MSB}
  262. if (state.bitsInQueue + 1 = state.rate) then begin
  263. i := state.bitsInQueue div 8;
  264. state.dataQueue[i] := state.dataQueue[i] or (1 shl (state.bitsInQueue and 7));
  265. AbsorbQueue(state);
  266. fillchar(state.dataQueue, state.rate div 8, 0);
  267. end
  268. else begin
  269. i := state.bitsInQueue div 8;
  270. fillchar(state.dataQueue[(state.bitsInQueue+7) div 8], state.rate div 8 - (state.bitsInQueue+7) div 8,0);
  271. state.dataQueue[i] := state.dataQueue[i] or (1 shl (state.bitsInQueue and 7));
  272. end;
  273. i := (state.rate-1) div 8;
  274. state.dataQueue[i] := state.dataQueue[i] or (1 shl ((state.rate-1) and 7));
  275. AbsorbQueue(state);
  276. extractFromState(@state.dataQueue, TState_L(state.state), state.rate div 64);
  277. state.bitsAvailableForSqueezing := state.rate;
  278. state.squeezing := 1;
  279. end;
  280. {---------------------------------------------------------------------------}
  281. function Squeeze(var state: TSpongeState; output: pointer; outputLength: longint): integer;
  282. {-Squeeze output data from the sponge function. If the sponge function was }
  283. { in the absorbing phase, this function switches it to the squeezing phase.}
  284. { Returns 0 if successful, 1 otherwise. output: pointer to the buffer where}
  285. { to store the output data; outputLength: number of output bits desired, }
  286. { must be a multiple of 8.}
  287. var
  288. i: longint;
  289. partialBlock: integer;
  290. begin
  291. Squeeze := 1;
  292. if state.error<>0 then exit; {No further action}
  293. if state.squeezing=0 then PadAndSwitchToSqueezingPhase(state);
  294. if outputLength and 7 <> 0 then begin
  295. {Only multiple of 8 bits are allowed, truncation can be done at user level}
  296. state.error := 1;
  297. exit;
  298. end;
  299. i := 0;
  300. while i < outputLength do begin
  301. if state.bitsAvailableForSqueezing=0 then begin
  302. KeccakPermutation(TState_L(state.state));
  303. extractFromState(@state.dataQueue, TState_L(state.state), state.rate div 64);
  304. state.bitsAvailableForSqueezing := state.rate;
  305. end;
  306. partialBlock := state.bitsAvailableForSqueezing;
  307. if partialBlock > outputLength - i then partialBlock := outputLength - i;
  308. move(state.dataQueue[(state.rate - state.bitsAvailableForSqueezing) div 8], PBA(output)^[i div 8], partialBlock div 8);
  309. dec(state.bitsAvailableForSqueezing, partialBlock);
  310. inc(i,partialBlock);
  311. end;
  312. Squeeze := 0;
  313. end;
  314. {---------------------------------------------------------------------------}
  315. function Update(var state: TSpongeState; data: pointer; databitlen: longint): integer;
  316. {-Update state with databitlen bits from data. May be called multiple times, }
  317. { only the last databitlen may be a non-multiple of 8 (the corresponding byte}
  318. { must be MSB aligned, i.e. in the (databitlen and 7) most significant bits. }
  319. var
  320. ret: integer;
  321. lastByte: byte;
  322. begin
  323. if state.error<>0 then begin
  324. Update := state.error;
  325. exit;
  326. end;
  327. if databitlen and 7 = 0 then ret := Absorb(state, data, databitlen)
  328. else begin
  329. ret := Absorb(state, data, databitlen - (databitlen and 7));
  330. if ret=0 then begin
  331. {Align the last partial byte to the least significant bits}
  332. lastByte := PBA(data)^[databitlen div 8] shr (8 - (databitlen and 7));
  333. ret := Absorb(state, @lastByte, databitlen and 7);
  334. end
  335. end;
  336. update := ret;
  337. {Update error only with old error=0, i.e. do no reset a non-zero value}
  338. if state.error=0 then state.error := ret;
  339. end;
  340. {---------------------------------------------------------------------------}
  341. {---------------------------------------------------------------------------}
  342. {---------------------------------------------------------------------------}
  343. {---------------------------------------------------------------------------}
  344. function SHA3_Init(var state: TSHA3State; algo: TSHA3_Algo): integer;
  345. {-Initialize the state of the Keccak[r, c] sponge function. The rate r and the}
  346. { capacity c values are determined from the SHA3 algorithm. Result 0=success. }
  347. const
  348. FOL: array[TSHA3_Algo] of word = (224, 256, 384, 512, 0, 0);
  349. begin
  350. case algo of
  351. __SHA3_224: SHA3_Init := InitSponge(state, 1152, 448);
  352. __SHA3_256: SHA3_Init := InitSponge(state, 1088, 512);
  353. __SHA3_384: SHA3_Init := InitSponge(state, 832, 768);
  354. __SHA3_512: SHA3_Init := InitSponge(state, 576, 1024);
  355. __SHAKE_128: SHA3_Init := InitSponge(state, 1344, 256);
  356. __SHAKE_256: SHA3_Init := InitSponge(state, 1088, 512);
  357. else begin
  358. SHA3_Init := SHA3_ERR_INVALID_ALG;
  359. state.error := SHA3_ERR_INVALID_ALG;
  360. exit;
  361. end;
  362. end;
  363. state.fixedOutputLength := FOL[algo];
  364. end;
  365. {---------------------------------------------------------------------------}
  366. function SHA3_UpdateXL(var state: TSHA3State; Msg: pointer; Len: longint): integer;
  367. {-Update context with Msg data of Len bytes}
  368. begin
  369. SHA3_UpdateXL := Absorb(state, Msg, Len*8);
  370. end;
  371. {---------------------------------------------------------------------------}
  372. function SHA3_Update(var state: TSHA3State; Msg: pointer; Len: word): integer;
  373. {-Update context with Msg data of Len bytes}
  374. begin
  375. SHA3_Update := SHA3_UpdateXL(state, Msg, Len);
  376. end;
  377. {---------------------------------------------------------------------------}
  378. function SHA3_FinalHash(var state: TSHA3State; digest: pointer): integer;
  379. {-Compute SHA3 hash digest and store into hashval. Only for hash}
  380. { algorithms, result WRONG_FINAL if called for Shake functions. }
  381. var
  382. err: integer;
  383. begin
  384. err := 1;
  385. if state.error=0 then begin
  386. if state.fixedOutputLength=0 then err := SHA3_ERR_WRONG_FINAL
  387. else err := SHA3_FinalBit_LSB(state, 0, 0, digest, state.fixedOutputLength);
  388. end;
  389. {Update error only with old error=0, i.e. do no reset a non-zero value}
  390. if state.error=0 then state.error := err;
  391. SHA3_FinalHash := err;
  392. end;
  393. {---------------------------------------------------------------------------}
  394. function SHA3_FinalBit_LSB(var state: TSHA3State; bits: byte; bitlen: integer; hashval: pointer; numbits: longint): integer;
  395. {-Update final bits in LSB format, pad, and compute hashval}
  396. var
  397. err,ll: integer;
  398. lw: word;
  399. begin
  400. {normalize bitlen and bits (zero high bits)}
  401. bitlen := bitlen and 7;
  402. if bitlen=0 then lw := 0
  403. else lw := bits and pred(word(1) shl bitlen);
  404. {'append' (in LSB language) the domain separation bits}
  405. if state.fixedOutputLength=0 then begin
  406. {SHAKE: append four bits 1111}
  407. lw := lw or (word($F) shl bitlen);
  408. ll := bitlen+4;
  409. end
  410. else begin
  411. {SHA3: append two bits 01}
  412. lw := lw or (word($2) shl bitlen);
  413. ll := bitlen+2;
  414. end;
  415. {update state with final bits}
  416. if ll<9 then begin
  417. {0..8 bits, one call to update}
  418. lw := lw shl (8-ll);
  419. err := update(state, @lw, ll);
  420. {squeeze the digits from the sponge}
  421. if err=0 then err := Squeeze(state, hashval, numbits);
  422. end
  423. else begin
  424. {More than 8 bits, first a regular update with low byte}
  425. err := update(state, @lw, 8);
  426. if err=0 then begin
  427. {Finally update remaining last bits}
  428. dec(ll,8);
  429. lw := lw shr ll;
  430. err := update(state, @lw, ll);
  431. if err=0 then err := Squeeze(state, hashval, numbits);
  432. end;
  433. end;
  434. SHA3_FinalBit_LSB := err;
  435. if state.error=0 then state.error := err;
  436. end;
  437. {---------------------------------------------------------------------------}
  438. function SHA3_FinalBit(var state: TSHA3State; bits: byte; bitlen: integer; hashval: pointer; numbits: longint): integer;
  439. {-Update final bits in MSB format, pad, and compute hashval}
  440. var
  441. i,m: integer;
  442. r,b: byte;
  443. begin
  444. r := 0;
  445. m := bitlen and $7;
  446. if m>0 then begin
  447. {right align the m bits}
  448. b := bits shr (8-m);
  449. {store reflected bits in r}
  450. for i:=m downto 1 do begin
  451. r := r + r + (b and 1);
  452. b := b shr 1;
  453. end;
  454. end;
  455. SHA3_FinalBit := SHA3_FinalBit_LSB(state,r,bitlen,hashval,numbits);
  456. end;
  457. begin
  458. {$IF DEFINED(CPUX86_64)}
  459. if AVX2Support then
  460. begin
  461. xorIntoState:= xorIntoStateAVX;
  462. extractFromState:= extractFromStateAVX;
  463. KeccakPermutation:= KeccakPermutationAVX;
  464. end
  465. else begin
  466. xorIntoState:= xorIntoState64;
  467. extractFromState:= extractFromState64;
  468. KeccakPermutation:= KeccakPermutation64;
  469. end;
  470. {$ENDIF}
  471. Assert(SizeOf(TSHA3State) = HASHCTXSIZE , '** Invalid sizeof(TSHA3State)');
  472. end.