[BACK]Return to fe25519.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

File: [local] / src / usr.bin / ssh / Attic / fe25519.h (download)

Revision 1.3, Mon Dec 9 11:03:45 2013 UTC (10 years, 5 months ago) by markus
Branch: MAIN
CVS Tags: OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.2: +6 -2 lines

Add Authors for the public domain ed25519/nacl code.
see also http://nacl.cr.yp.to/features.html
	All of the NaCl software is in the public domain.
and http://ed25519.cr.yp.to/software.html
	The Ed25519 software is in the public domain.

/* $OpenBSD: fe25519.h,v 1.3 2013/12/09 11:03:45 markus Exp $ */

/*
 * Public Domain, Authors: Daniel J. Bernstein, Niels Duif, Tanja Lange,
 * Peter Schwabe, Bo-Yin Yang.
 * Copied from supercop-20130419/crypto_sign/ed25519/ref/fe25519.h
 */

#ifndef FE25519_H
#define FE25519_H

#include "crypto_api.h"

#define fe25519              crypto_sign_ed25519_ref_fe25519
#define fe25519_freeze       crypto_sign_ed25519_ref_fe25519_freeze
#define fe25519_unpack       crypto_sign_ed25519_ref_fe25519_unpack
#define fe25519_pack         crypto_sign_ed25519_ref_fe25519_pack
#define fe25519_iszero       crypto_sign_ed25519_ref_fe25519_iszero
#define fe25519_iseq_vartime crypto_sign_ed25519_ref_fe25519_iseq_vartime
#define fe25519_cmov         crypto_sign_ed25519_ref_fe25519_cmov
#define fe25519_setone       crypto_sign_ed25519_ref_fe25519_setone
#define fe25519_setzero      crypto_sign_ed25519_ref_fe25519_setzero
#define fe25519_neg          crypto_sign_ed25519_ref_fe25519_neg
#define fe25519_getparity    crypto_sign_ed25519_ref_fe25519_getparity
#define fe25519_add          crypto_sign_ed25519_ref_fe25519_add
#define fe25519_sub          crypto_sign_ed25519_ref_fe25519_sub
#define fe25519_mul          crypto_sign_ed25519_ref_fe25519_mul
#define fe25519_square       crypto_sign_ed25519_ref_fe25519_square
#define fe25519_invert       crypto_sign_ed25519_ref_fe25519_invert
#define fe25519_pow2523      crypto_sign_ed25519_ref_fe25519_pow2523

typedef struct 
{
  crypto_uint32 v[32]; 
}
fe25519;

void fe25519_freeze(fe25519 *r);

void fe25519_unpack(fe25519 *r, const unsigned char x[32]);

void fe25519_pack(unsigned char r[32], const fe25519 *x);

int fe25519_iszero(const fe25519 *x);

int fe25519_iseq_vartime(const fe25519 *x, const fe25519 *y);

void fe25519_cmov(fe25519 *r, const fe25519 *x, unsigned char b);

void fe25519_setone(fe25519 *r);

void fe25519_setzero(fe25519 *r);

void fe25519_neg(fe25519 *r, const fe25519 *x);

unsigned char fe25519_getparity(const fe25519 *x);

void fe25519_add(fe25519 *r, const fe25519 *x, const fe25519 *y);

void fe25519_sub(fe25519 *r, const fe25519 *x, const fe25519 *y);

void fe25519_mul(fe25519 *r, const fe25519 *x, const fe25519 *y);

void fe25519_square(fe25519 *r, const fe25519 *x);

void fe25519_invert(fe25519 *r, const fe25519 *x);

void fe25519_pow2523(fe25519 *r, const fe25519 *x);

#endif