diff options
author | irungentoo <irungentoo@gmail.com> | 2013-07-02 09:53:34 -0400 |
---|---|---|
committer | irungentoo <irungentoo@gmail.com> | 2013-07-02 09:53:34 -0400 |
commit | e2967396ac73cb7410787886cdaf072a184ffc49 (patch) | |
tree | 527a74d25a4a0705fc641994fd35bfab22662034 /nacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h | |
parent | 8928c817df345f29aa0b194743595aa11bd6a8ba (diff) |
Added NaCl crypto library.
Diffstat (limited to 'nacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h')
-rw-r--r-- | nacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/nacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h b/nacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h new file mode 100644 index 00000000..48584a85 --- /dev/null +++ b/nacl/crypto_sign/edwards25519sha512batch/ref/sc25519.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef SC25519_H | ||
2 | #define SC25519_H | ||
3 | |||
4 | #define sc25519 crypto_sign_edwards25519sha512batch_sc25519 | ||
5 | #define sc25519_from32bytes crypto_sign_edwards25519sha512batch_sc25519_from32bytes | ||
6 | #define sc25519_from64bytes crypto_sign_edwards25519sha512batch_sc25519_from64bytes | ||
7 | #define sc25519_to32bytes crypto_sign_edwards25519sha512batch_sc25519_to32bytes | ||
8 | #define sc25519_pack crypto_sign_edwards25519sha512batch_sc25519_pack | ||
9 | #define sc25519_getparity crypto_sign_edwards25519sha512batch_sc25519_getparity | ||
10 | #define sc25519_setone crypto_sign_edwards25519sha512batch_sc25519_setone | ||
11 | #define sc25519_setzero crypto_sign_edwards25519sha512batch_sc25519_setzero | ||
12 | #define sc25519_neg crypto_sign_edwards25519sha512batch_sc25519_neg | ||
13 | #define sc25519_add crypto_sign_edwards25519sha512batch_sc25519_add | ||
14 | #define sc25519_sub crypto_sign_edwards25519sha512batch_sc25519_sub | ||
15 | #define sc25519_mul crypto_sign_edwards25519sha512batch_sc25519_mul | ||
16 | #define sc25519_square crypto_sign_edwards25519sha512batch_sc25519_square | ||
17 | #define sc25519_invert crypto_sign_edwards25519sha512batch_sc25519_invert | ||
18 | |||
19 | #include "crypto_uint32.h" | ||
20 | |||
21 | typedef struct { | ||
22 | crypto_uint32 v[32]; | ||
23 | } sc25519; | ||
24 | |||
25 | void sc25519_from32bytes(sc25519 *r, const unsigned char x[32]); | ||
26 | |||
27 | void sc25519_from64bytes(sc25519 *r, const unsigned char x[64]); | ||
28 | |||
29 | void sc25519_to32bytes(unsigned char r[32], const sc25519 *x); | ||
30 | |||
31 | void sc25519_pack(unsigned char r[32], const sc25519 *x); | ||
32 | |||
33 | unsigned char sc25519_getparity(const sc25519 *x); | ||
34 | |||
35 | void sc25519_setone(sc25519 *r); | ||
36 | |||
37 | void sc25519_setzero(sc25519 *r); | ||
38 | |||
39 | void sc25519_neg(sc25519 *r, const sc25519 *x); | ||
40 | |||
41 | void sc25519_add(sc25519 *r, const sc25519 *x, const sc25519 *y); | ||
42 | |||
43 | void sc25519_sub(sc25519 *r, const sc25519 *x, const sc25519 *y); | ||
44 | |||
45 | void sc25519_mul(sc25519 *r, const sc25519 *x, const sc25519 *y); | ||
46 | |||
47 | void sc25519_square(sc25519 *r, const sc25519 *x); | ||
48 | |||
49 | void sc25519_invert(sc25519 *r, const sc25519 *x); | ||
50 | |||
51 | #endif | ||