The MASM Forum

General => The Workshop => Topic started by: jj2007 on December 12, 2017, 08:16:37 AM

Title: BCryptGenRandom
Post by: jj2007 on December 12, 2017, 08:16:37 AM
Rumours say it's fast and good quality...

include \masm32\MasmBasic\MasmBasic.inc         ; download (http://masm32.com/board/index.php?topic=94.0)
  Init
  randbytes=1000000
  Let edi=New$(randbytes)
  Dll "BCrypt"
  Declare void BCryptGenRandom, 4
  BCryptGenRandom(0, edi, randbytes, 2)
  For_ ecx=0 To 29
        Print Str$("%i\n", dword ptr [edi+4*ecx])
  Next
  Inkey "hit any key"
EndOfCode