chromium/third_party/boringssl/src/crypto/poly1305/poly1305_vec.c

/* Copyright (c) 2014, Google Inc.
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */

// This implementation of poly1305 is by Andrew Moon
// (https://github.com/floodyberry/poly1305-donna) and released as public
// domain. It implements SIMD vectorization based on the algorithm described in
// http://cr.yp.to/papers.html#neoncrypto. Unrolled to 2 powers, i.e. 64 byte
// block size

#include <openssl/poly1305.h>

#include <assert.h>

#include "../internal.h"


#if defined(BORINGSSL_HAS_UINT128) && defined(OPENSSL_X86_64)

#include <emmintrin.h>

xmmi;

static const alignas(16) uint32_t poly1305_x64_sse2_message_mask[4] =;
static const alignas(16) uint32_t poly1305_x64_sse2_5[4] =;
static const alignas(16) uint32_t poly1305_x64_sse2_1shl128[4] =;

static inline uint128_t add128(uint128_t a, uint128_t b) {}

static inline uint128_t add128_64(uint128_t a, uint64_t b) {}

static inline uint128_t mul64x64_128(uint64_t a, uint64_t b) {}

static inline uint64_t lo128(uint128_t a) {}

static inline uint64_t shr128(uint128_t v, const int shift) {}

static inline uint64_t shr128_pair(uint64_t hi, uint64_t lo, const int shift) {}

poly1305_power;

poly1305_state_internal; /* 448 bytes total + 63 bytes for
                              alignment = 511 bytes raw */

static_assert;

static inline poly1305_state_internal *poly1305_aligned_state(
    poly1305_state *state) {}

static inline size_t poly1305_min(size_t a, size_t b) {}

void CRYPTO_poly1305_init(poly1305_state *state, const uint8_t key[32]) {}

static void poly1305_first_block(poly1305_state_internal *st,
                                 const uint8_t *m) {}

static void poly1305_blocks(poly1305_state_internal *st, const uint8_t *m,
                            size_t bytes) {}

static size_t poly1305_combine(poly1305_state_internal *st, const uint8_t *m,
                               size_t bytes) {}

void CRYPTO_poly1305_update(poly1305_state *state, const uint8_t *m,
                            size_t bytes) {}

void CRYPTO_poly1305_finish(poly1305_state *state, uint8_t mac[16]) {}

#endif  // BORINGSSL_HAS_UINT128 && OPENSSL_X86_64