annotate NaCl/randombytes.cs @ 54:ba4e2cb031e0
Added general purpose tar archive reader class
author |
Ivo Smits <Ivo@UCIS.nl> |
date |
Wed, 02 Oct 2013 21:17:30 +0200 |
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 } |