3 * System.Security.Cryptography.RNGCryptoServiceProvider support
6 * Mark Crichton (crichton@gimp.org)
7 * Patrik Torstensson (p@rxc.se)
8 * Sebastien Pouliot (sebastien@ximian.com)
10 * Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
11 * Copyright 2004-2009 Novell, Inc (http://www.novell.com)
12 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
19 #include "object-internals.h"
21 #include "utils/mono-rand.h"
22 #include "icall-decl.h"
24 #ifndef ENABLE_NETCORE
27 ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngOpen (MonoError
*error
)
29 return (MonoBoolean
) mono_rand_open ();
33 ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngInitialize (const guchar
*seed
, gssize seed_length
, MonoError
*error
)
35 return mono_rand_init (seed
, seed_length
);
39 ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngGetBytes (gpointer handle
, guchar
*array
, gssize array_length
, MonoError
*error
)
41 g_assert (array
|| !array_length
);
42 mono_rand_try_get_bytes (&handle
, array
, array_length
, error
);
47 ves_icall_System_Security_Cryptography_RNGCryptoServiceProvider_RngClose (gpointer handle
, MonoError
*error
)
49 mono_rand_close (handle
);
54 MONO_EMPTY_SOURCE_FILE (rand
);
56 #endif /* ENABLE_NETCORE */