TUPLE: windows-crypto-context < win32-handle provider type ;
-M: windows-crypto-context dispose* ( tuple -- )
+M: windows-crypto-context dispose*
[ handle>> 0 CryptReleaseContext win32-error=0/f ]
[ f >>handle drop ] bi ;
swap >>provider
initialize-crypto-context ; inline
-M: windows-crypto-context random-bytes* ( n windows-crypto-context -- bytes )
+M: windows-crypto-context random-bytes*
handle>> swap dup <byte-array>
[ CryptGenRandom win32-error=0/f ] keep ;