-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable the SHA extension implementation of SHA-256/512 on x86 (#81)
* Enable the SHA extension implementation of SHA-256/512 on x86 This change enables the implementation of SHA-256/512 with SHA extension instruction set on x86 platforms. Signed-off-by: Kostic <[email protected]> * Fix the duplicate symbol build error when compiling in FIPS mode * Add dispatch test for SHA extension instructions This commit adds a dispatch test for SHA extension instructions. Dispatch tests are meant to ensure that the expected assembly functions are triggered by high-level API calls. * Small readability improvement * Run tests with Intel® Software Development Emulator. * Correct echo message. Co-authored-by: Kostic <[email protected]> Co-authored-by: Bryce Shang <[email protected]> Co-authored-by: Bryce Shang <[email protected]>
- Loading branch information
1 parent
4702a85
commit 6d9429d
Showing
12 changed files
with
125 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/ci/codebuild/linux-x86/amazonlinux-2_gcc-7x_intel-sde.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
version: 0.2 | ||
|
||
phases: | ||
pre_build: | ||
commands: | ||
- if [ $(gcc -dumpfullversion) == 7.3.1 ]; then echo "Found correct gcc version 7"; else gcc --version && echo "gcc version mismatch" && exit 1; fi | ||
# Based on Intel SDE README, SELinux should be turned off to allow pin to work. | ||
# https://software.intel.com/content/www/us/en/develop/articles/intel-software-development-emulator.html#system-configuration | ||
- if [ $(getenforce) == 'Disabled' ]; then echo "SELinux is disabled. Disabling SELinux is needed by sde to allow pin work." ; else echo "SELinux should be turned off to allow sde pin to work." && exit 1; fi | ||
- export CC=gcc | ||
- export CXX=g++ | ||
- export GO111MODULE=on | ||
build: | ||
commands: | ||
- ./tests/ci/run_tests_with_sde.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
tests/ci/docker_images/linux-x86/amazonlinux-2_gcc-7x-intel-sde/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
FROM amazonlinux-2:gcc-7x | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
|
||
# Enable the EPEL repository on Amazon Linux 2 before installing packages | ||
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/add-repositories.html | ||
|
||
# gcc 7.3.1 is the latest version versions `yum --showduplicates list gcc` | ||
# Install Valgrind for Valgrind test target even though it is not needed for the base test target. | ||
RUN set -ex && \ | ||
yum -y update && yum install -y \ | ||
# Without glibc.i686, running "./sde --help" generates error "bash: ./sde: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory" | ||
glibc.i686 \ | ||
# This provides command `getenforce`, which can tell the current status of SELinux. | ||
# Based on Interl SDE README, SELinux should be turned off to allow pin to work. | ||
libselinux-utils \ | ||
wget \ | ||
bzip2 \ | ||
tar && \ | ||
# Install Intel® Software Development Emulator | ||
# This emulator is needed when running BoringSSL/AWS-LC code under Intel's SDE for each supported chip (like ice lake). | ||
# https://software.intel.com/content/www/us/en/develop/articles/intel-software-development-emulator.html#system-configuration | ||
wget https://software.intel.com/content/dam/develop/external/us/en/documents/downloads/sde-external-8.59.0-2020-10-05-lin.tar.bz2 && \ | ||
tar -xvjf sde-external-8.59.0-2020-10-05-lin.tar.bz2 && \ | ||
cd sde-external-8.59.0-2020-10-05-lin \ | ||
yum clean packages && \ | ||
yum clean metadata && \ | ||
yum clean all && \ | ||
rm -rf /tmp/* && \ | ||
rm -rf /var/cache/yum | ||
|
||
ENV CC=gcc | ||
ENV CXX=g++ | ||
ENV SDEROOT=/sde-external-8.59.0-2020-10-05-lin | ||
ENV PATH="$SDEROOT:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash -ex | ||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
source tests/ci/common_posix_setup.sh | ||
|
||
echo "Testing AWS-LC in debug mode under Intel's SDE." | ||
build_and_test_with_sde | ||
|
||
echo "Testing AWS-LC in release mode under Intel's SDE." | ||
build_and_test_with_sde -DCMAKE_BUILD_TYPE=Release |