|
| 1 | +/******************************************************************************* |
| 2 | +
|
| 3 | + D language bindings for libsodium's crypto_core_ristretto255.h |
| 4 | +
|
| 5 | + License: ISC (see LICENSE.txt) |
| 6 | +
|
| 7 | +*******************************************************************************/ |
| 8 | + |
| 9 | +module libsodium.crypto_core_ristretto255; |
| 10 | + |
| 11 | +@nogc nothrow: |
| 12 | + |
| 13 | +import libsodium.export_; |
| 14 | + |
| 15 | +extern (C): |
| 16 | + |
| 17 | +enum crypto_core_ristretto255_BYTES = 32; |
| 18 | +size_t crypto_core_ristretto255_bytes (); |
| 19 | + |
| 20 | +enum crypto_core_ristretto255_HASHBYTES = 64; |
| 21 | +size_t crypto_core_ristretto255_hashbytes (); |
| 22 | + |
| 23 | +enum crypto_core_ristretto255_SCALARBYTES = 32; |
| 24 | +size_t crypto_core_ristretto255_scalarbytes (); |
| 25 | + |
| 26 | +enum crypto_core_ristretto255_NONREDUCEDSCALARBYTES = 64; |
| 27 | +size_t crypto_core_ristretto255_nonreducedscalarbytes (); |
| 28 | + |
| 29 | +int crypto_core_ristretto255_is_valid_point (const(ubyte)* p); |
| 30 | + |
| 31 | +int crypto_core_ristretto255_add (ubyte* r, const(ubyte)* p, const(ubyte)* q); |
| 32 | + |
| 33 | +int crypto_core_ristretto255_sub (ubyte* r, const(ubyte)* p, const(ubyte)* q); |
| 34 | + |
| 35 | +int crypto_core_ristretto255_from_hash (ubyte* p, const(ubyte)* r); |
| 36 | + |
| 37 | +void crypto_core_ristretto255_random (ubyte* p); |
| 38 | + |
| 39 | +void crypto_core_ristretto255_scalar_random (ubyte* r); |
| 40 | + |
| 41 | +int crypto_core_ristretto255_scalar_invert (ubyte* recip, const(ubyte)* s); |
| 42 | + |
| 43 | +void crypto_core_ristretto255_scalar_negate (ubyte* neg, const(ubyte)* s); |
| 44 | + |
| 45 | +void crypto_core_ristretto255_scalar_complement (ubyte* comp, const(ubyte)* s); |
| 46 | + |
| 47 | +void crypto_core_ristretto255_scalar_add ( |
| 48 | + ubyte* z, |
| 49 | + const(ubyte)* x, |
| 50 | + const(ubyte)* y); |
| 51 | + |
| 52 | +void crypto_core_ristretto255_scalar_sub ( |
| 53 | + ubyte* z, |
| 54 | + const(ubyte)* x, |
| 55 | + const(ubyte)* y); |
| 56 | + |
| 57 | +void crypto_core_ristretto255_scalar_mul ( |
| 58 | + ubyte* z, |
| 59 | + const(ubyte)* x, |
| 60 | + const(ubyte)* y); |
| 61 | + |
| 62 | +/* |
| 63 | + * The interval `s` is sampled from should be at least 317 bits to ensure almost |
| 64 | + * uniformity of `r` over `L`. |
| 65 | + */ |
| 66 | +void crypto_core_ristretto255_scalar_reduce (ubyte* r, const(ubyte)* s); |
| 67 | + |
0 commit comments