import libcrypto (LibreSSL 2.5.2)
[unleashed.git] / lib / libcrypto / curve25519 / curve25519-generic.c
blobe7373d2bcb8d04d8cbac23db96561e0dc209eacd
1 /*
2 * Copyright (c) 2015, Google Inc.
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 * This code is mostly taken from the ref10 version of Ed25519 in SUPERCOP
19 * 20141124 (http://bench.cr.yp.to/supercop.html). That code is released as
20 * public domain but this file has the ISC license just to keep licencing
21 * simple.
23 * The field functions are shared by Ed25519 and X25519 where possible.
26 #include "curve25519_internal.h"
28 void
29 x25519_scalar_mult(uint8_t out[32], const uint8_t scalar[32],
30 const uint8_t point[32])
32 x25519_scalar_mult_generic(out, scalar, point);