| 1 |
maya |
3227 |
/* |
| 2 |
doda |
6841 |
* (C) 2004-2017 TeraTerm Project |
| 3 |
|
|
* All rights reserved. |
| 4 |
|
|
* |
| 5 |
|
|
* Redistribution and use in source and binary forms, with or without |
| 6 |
|
|
* modification, are permitted provided that the following conditions |
| 7 |
|
|
* are met: |
| 8 |
|
|
* |
| 9 |
|
|
* 1. Redistributions of source code must retain the above copyright |
| 10 |
|
|
* notice, this list of conditions and the following disclaimer. |
| 11 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
| 12 |
|
|
* notice, this list of conditions and the following disclaimer in the |
| 13 |
|
|
* documentation and/or other materials provided with the distribution. |
| 14 |
|
|
* 3. The name of the author may not be used to endorse or promote products |
| 15 |
|
|
* derived from this software without specific prior written permission. |
| 16 |
|
|
* |
| 17 |
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR |
| 18 |
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 19 |
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 20 |
|
|
* IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 21 |
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 22 |
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 23 |
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 24 |
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 |
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 |
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 |
|
|
*/ |
| 28 |
maya |
3227 |
|
| 29 |
yutakapon |
5496 |
#ifndef __ED25519_GE25519_H |
| 30 |
|
|
#define __ED25519_GE25519_H |
| 31 |
maya |
3227 |
|
| 32 |
yutakapon |
5496 |
#include "ed25519_fe25519.h" |
| 33 |
|
|
#include "ed25519_sc25519.h" |
| 34 |
maya |
3227 |
|
| 35 |
yutakapon |
5496 |
#define ge25519 crypto_sign_ed25519_ref_ge25519 |
| 36 |
|
|
#define ge25519_base crypto_sign_ed25519_ref_ge25519_base |
| 37 |
|
|
#define ge25519_unpackneg_vartime crypto_sign_ed25519_ref_unpackneg_vartime |
| 38 |
|
|
#define ge25519_pack crypto_sign_ed25519_ref_pack |
| 39 |
|
|
#define ge25519_isneutral_vartime crypto_sign_ed25519_ref_isneutral_vartime |
| 40 |
|
|
#define ge25519_double_scalarmult_vartime crypto_sign_ed25519_ref_double_scalarmult_vartime |
| 41 |
|
|
#define ge25519_scalarmult_base crypto_sign_ed25519_ref_scalarmult_base |
| 42 |
maya |
3227 |
|
| 43 |
yutakapon |
5496 |
typedef struct |
| 44 |
|
|
{ |
| 45 |
|
|
fe25519 x; |
| 46 |
|
|
fe25519 y; |
| 47 |
|
|
fe25519 z; |
| 48 |
|
|
fe25519 t; |
| 49 |
|
|
} ge25519; |
| 50 |
yutakapon |
4926 |
|
| 51 |
zmatsuo |
8527 |
extern const ge25519 ge25519_base; |
| 52 |
yutakapon |
4926 |
|
| 53 |
yutakapon |
5496 |
int ge25519_unpackneg_vartime(ge25519 *r, const unsigned char p[32]); |
| 54 |
yutakapon |
4926 |
|
| 55 |
yutakapon |
5496 |
void ge25519_pack(unsigned char r[32], const ge25519 *p); |
| 56 |
yutakapon |
4926 |
|
| 57 |
yutakapon |
5496 |
int ge25519_isneutral_vartime(const ge25519 *p); |
| 58 |
yutakapon |
4926 |
|
| 59 |
yutakapon |
5496 |
void ge25519_double_scalarmult_vartime(ge25519 *r, const ge25519 *p1, const sc25519 *s1, const ge25519 *p2, const sc25519 *s2); |
| 60 |
yutakapon |
4926 |
|
| 61 |
yutakapon |
5496 |
void ge25519_scalarmult_base(ge25519 *r, const sc25519 *s); |
| 62 |
yutakapon |
4926 |
|
| 63 |
maya |
3227 |
#endif |