#!/usr/bin/env perl
# Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the OpenSSL license (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
#
# ====================================================================
# Written by Andy Polyakov <appro@openssl.org> for the OpenSSL
# project. The module is, however, dual licensed under OpenSSL and
# CRYPTOGAMS licenses depending on where you obtain it. For further
# details see http://www.openssl.org/~appro/cryptogams/.
# ====================================================================
#
# Keccak-1600 for ARMv4.
#
# June 2017.
#
# Non-NEON code is KECCAK_1X variant (see sha/keccak1600.c) with bit
# interleaving. How does it compare to Keccak Code Package? It's as
# fast, but several times smaller, and is endian- and ISA-neutral. ISA
# neutrality means that minimum ISA requirement is ARMv4, yet it can
# be assembled even as Thumb-2. NEON code path is KECCAK_1X_ALT with
# register layout taken from Keccak Code Package. It's also as fast,
# in fact faster by 10-15% on some processors, and endian-neutral.
#
########################################################################
# Numbers are cycles per processed byte. Non-NEON results account even
# for input bit interleaving.
#
# r=1600(*),NEON r=1088(**),NEON
#
# Cortex-A5 67/+130%, 24 96, 36
# Cortex-A7 60/+90%, 23 87, 34
# Cortex-A8 39/+220%, 20 56, 30
# Cortex-A9 41/+160%, 17 58, 26
# Cortex-A15 30/+65%, 12 41, 18
# Snapdragon S4 35/+120%, 16 50, 24
#
# (*) Not used in real life, meaningful as estimate for single absorb
# operation performance. Percentage after slash is improvement
# over compiler-generated KECCAK_1X reference code.
# (**) Corresponds to SHA3-256, 8KB message size.
my @C = map("r$_",(0..9));
my @E = map("r$_",(10..12,14));
########################################################################