Mercurial > hg > ucis.core
annotate NaCl/randombytes.cs @ 111:df53bdd49507 default tip
Merge
author | Ivo Smits <Ivo@UCIS.nl> |
---|---|
date | Fri, 07 Nov 2014 18:37:39 +0100 |
parents | c873e3dd73fe |
children |
rev | line source |
---|---|
20 | 1 ???using System; |
2 using System.Security.Cryptography; | |
3 | |
4 namespace UCIS.NaCl { | |
5 public static class randombytes { | |
6 public static void generate(Byte[] x) { | |
7 RNGCryptoServiceProvider rnd = new RNGCryptoServiceProvider(); | |
8 rnd.GetBytes(x); | |
9 } | |
10 public static Byte[] generate(int count) { | |
11 Byte[] bytes = new Byte[count]; | |
12 generate(bytes); | |
13 return bytes; | |
14 } | |
15 } | |
16 } |