2 * Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
11 #include <openssl/opensslconf.h>
12 #include "../ppc_arch.h"
14 #ifdef OPENSSL_NO_POLY1305
15 NON_EMPTY_TRANSLATION_UNIT
17 void poly1305_init_int(void *ctx
, const unsigned char key
[16]);
18 void poly1305_blocks(void *ctx
, const unsigned char *inp
, size_t len
,
20 void poly1305_emit(void *ctx
, unsigned char mac
[16],
21 const unsigned int nonce
[4]);
22 void poly1305_init_fpu(void *ctx
, const unsigned char key
[16]);
23 void poly1305_blocks_fpu(void *ctx
, const unsigned char *inp
, size_t len
,
25 void poly1305_emit_fpu(void *ctx
, unsigned char mac
[16],
26 const unsigned int nonce
[4]);
27 int poly1305_init(void *ctx
, const unsigned char key
[16], void *func
[2])
29 if (sizeof(size_t) == 4 && (OPENSSL_ppccap_P
& PPC_FPU
)) {
30 poly1305_init_fpu(ctx
, key
);
31 func
[0] = poly1305_blocks_fpu
;
32 func
[1] = poly1305_emit_fpu
;
34 poly1305_init_int(ctx
, key
);
35 func
[0] = poly1305_blocks
;
36 func
[1] = poly1305_emit
;