annotate NaCl/randombytes.cs @ 73:6aca18ee4ec6
NaCl: improved ed25519 implementation, added simple API for ed25519 and sha512
author |
Ivo Smits <Ivo@UCIS.nl> |
date |
Sat, 02 Nov 2013 16:01:09 +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 } |