@@ -271,6 +271,36 @@ static final function Sha2SmallUpdate(
271
271
}
272
272
}
273
273
274
+ static final function Sha2SmallOut (
275
+ const out FCryptoSHA224Context Cc ,
276
+ out array <byte> Dst ,
277
+ int Num
278
+ )
279
+ {
280
+ local byte Buf [64 ];
281
+ local int Val [8 ];
282
+ local int Ptr ;
283
+
284
+ Ptr = Cc .Count & 63 ;
285
+ // class'FCryptoMemory'.static.MemCpy(Buf, Cf.Buf, Ptr);
286
+ // class'FCryptoMemory'.static.MemCpy(Val, CC.Val, 32 /* sizeof Val */);
287
+ Buf [Ptr ++] = 0x80 ;
288
+ if (Ptr > 56 )
289
+ {
290
+ // class'FCryptoMemory'.static.MemSet(Buf, 0, 64 - Ptr, Ptr);
291
+ // Sha2SmallRound(Buf, Val);
292
+ // class'FCryptoMemory'.static.MemSet(Buf, 0, 56);
293
+ }
294
+ else
295
+ {
296
+ class 'FCryptoMemory' .static .MemSet (Buf , 0 , 56 - Ptr , Ptr );
297
+ }
298
+
299
+ Enc64BE (Buf /* + 56 */ , Cc .Count << 3 ); // TODO
300
+ // Sha2SmallRound(Buf, Val); // TODO
301
+ // RangeEnc32BE(Dst, Val, Num); // TODO
302
+ }
303
+
274
304
// TODO: make this a macro for performance?
275
305
static final function RangeDec32BE (
276
306
out array <int> V ,
@@ -303,6 +333,28 @@ static final function int Dec32BE(
303
333
);
304
334
}
305
335
336
+ // TODO: make this a macro for performance?
337
+ static final function Enc64BE (
338
+ out array <byte> Dst ,
339
+ int X // TODO: need to use a QWORD here?
340
+ )
341
+ {
342
+ // br_enc32be(buf, (uint32_t)(x >> 32));
343
+ // br_enc32be(buf + 4, (uint32_t)x);
344
+ }
345
+
346
+ // TODO: make this a macro for performance?
347
+ static final function Enc32BE (
348
+ out array <byte> Dst ,
349
+ int X
350
+ )
351
+ {
352
+ Dst [0 ] = X >>> 24 ;
353
+ Dst [1 ] = X >>> 16 ;
354
+ Dst [2 ] = X >>> 8 ;
355
+ Dst [3 ] = X
356
+ }
357
+
306
358
DefaultProperties
307
359
{
308
360
SHA224_IV ={(
0 commit comments