annotate NaCl/Native.cs @ 20:c873e3dd73fe

Added NaCl cryptography code
author Ivo Smits <Ivo@UCIS.nl>
date Mon, 15 Apr 2013 00:43:48 +0200
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
20
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
1 ???using System;
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
2 using System.Runtime.InteropServices;
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
3
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
4 namespace UCIS.NaCl {
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
5 public static class Native {
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
6 [DllImport("nacl")] public static unsafe extern int crypto_onetimeauth_poly1305(Byte* outv, Byte* inv, UInt64 inlen, Byte* k);
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
7 [DllImport("nacl")] public static unsafe extern int crypto_core_salsa20(Byte* outv, Byte* inv, Byte* k, Byte* c);
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
8 [DllImport("nacl")] public static unsafe extern int crypto_core_hsalsa20(Byte* outv, Byte* inv, Byte* k, Byte* c);
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
9 [DllImport("nacl")] public static unsafe extern int crypto_box_curve25519xsalsa20poly1305_afternm(Byte* c, Byte* m, UInt64 mlen, Byte* n, Byte* k);
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
10 [DllImport("nacl")] public static unsafe extern int crypto_box_curve25519xsalsa20poly1305_afternm(Byte[] c, Byte[] m, UInt64 mlen, Byte[] n, Byte[] k);
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
11 [DllImport("nacl")] public static unsafe extern int crypto_box_curve25519xsalsa20poly1305_open_afternm(Byte* m, Byte* c, UInt64 clen, Byte* n, Byte* k);
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
12 [DllImport("nacl")] public static unsafe extern int crypto_box_curve25519xsalsa20poly1305_open_afternm(Byte[] m, Byte[] c, UInt64 clen, Byte[] n, Byte[] k);
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
13
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
14 public static Boolean EnableNativeImplementation() {
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
15 //Todo: check if the library exists at all before probing for functions
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
16 return
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
17 UCIS.NaCl.crypto_onetimeauth.poly1305.EnableNativeImplementation() |
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
18 UCIS.NaCl.crypto_core.salsa20.EnableNativeImplementation() |
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
19 UCIS.NaCl.crypto_core.hsalsa20.EnableNativeImplementation() |
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
20 false;
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
21 }
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
22 }
c873e3dd73fe Added NaCl cryptography code
Ivo Smits <Ivo@UCIS.nl>
parents:
diff changeset
23 }