view 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
line wrap: on
line source

???using System;
using System.Security.Cryptography;

namespace UCIS.NaCl {
	public static class randombytes {
		public static void generate(Byte[] x) {
			RNGCryptoServiceProvider rnd = new RNGCryptoServiceProvider();
			rnd.GetBytes(x);
		}
		public static Byte[] generate(int count) {
			Byte[] bytes = new Byte[count];
			generate(bytes);
			return bytes;
		}
	}
}