forked from project-everest/everest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-source-drop
executable file
·85 lines (67 loc) · 2.78 KB
/
make-source-drop
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env bash
# This script propagates the extracted C and assembly code for miTLS and
# HACL* out into standalone directories.
# set -x
print_usage ()
{
cat <<HELP
Usage: MakeSourceDrop destination_path
make-source-drop ~/drops/drop12
The directory path will be created if it doesn't already exist.
HELP
}
if [[ $1 == "" ]]; then
print_usage
exit 0
fi
# set current directory to the directory of this script
cd "${BASH_SOURCE%/*}" || exit
MITLS_EXTRACT=mitls-fstar/src/tls/extract
KRMLLIB=karamel/krmllib
HACL_HOME=hacl-star
HACL_CODE=hacl-star/code
# Headers #####################################################################
mkdir -p $1/include
cp mitls-fstar/libs/ffi/mitlsffi.h $1/include
cp hacl-star/providers/quic_provider/quic_provider.h $1/include
cp hacl-star/dist/evercrypt-external-headers/EverCrypt.h $1/include
cp karamel/include/krmllib.h $1/include
cp mitls-fstar/src/tls/extract/cstubs/RegionAllocator.h $1/include
cp -R karamel/include/* $1/include
cp -R karamel/krmllib/dist/generic/{FStar_UInt128.h,fstar_uint128_msvc.h,LowStar_Endianness.h,FStar_UInt_8_16_32_64.h} $1/include
# libkrmllib ##################################################################
mkdir -p $1/krmllib
cp -R karamel/krmllib/dist/generic/*.{c,h} $1/krmllib/
cp mitls-fstar/src/tls/extract/cstubs/RegionAllocator.c $1/krmllib
# libevercrypt ################################################################
mkdir -p $1/evercrypt
mkdir -p $1/evercrypt/amd64
mkdir -p $1/evercrypt/i386
cp hacl-star/dist/mitls/*x86_64*.asm $1/evercrypt/amd64
cp hacl-star/dist/mitls/*i686*.asm $1/evercrypt/i386
cp hacl-star/dist/mitls/*.{c,h} $1/evercrypt
# libmitls ####################################################################
mkdir -p $1/mitls
#Don't remove dllmain.c
#rm -f $1/mitls/*.c
find $1/mitls -maxdepth 1 -type f -and -name '*.c' -and -not -name dllmain.c | xargs rm -f
rm -f $1/mitls/*.h
cp $MITLS_EXTRACT/Karamel-Msvc-Library/*.{c,h} $1/mitls
cp $MITLS_EXTRACT/Karamel-Msvc-Library/include/*.h $1/mitls
cp $MITLS_EXTRACT/Karamel-Msvc-Library/stub/*.{c,h} $1/mitls
rm $1/mitls/RegionAllocator.*
# libquiccrypto ###############################################################
mkdir -p $1/quiccrypto
find $1/quiccrypto -maxdepth 1 -type f -and -name '*.c' -and -not -name dllmain.c | xargs rm -f
find $1/quiccrypto -maxdepth 1 -type f -and -name '*.h' -and -not -name CommonInclude.h | xargs rm -f
cp hacl-star/providers/quic_provider/quic_provider.c $1/quiccrypto
cp hacl-star/providers/quic_provider/test.c $1/quiccrypto
# binaries
mkdir -p $1/bin
rm -f $1/bin/*.dll
cp mitls-fstar/src/tls/extract/Karamel-Library/libmitls.dll $1/bin
cp MLCrypto/openssl/libcrypto-1_1-x64.dll $1/bin
cp hacl-star/providers/quic_provider/libquiccrypto.dll $1/bin
cp hacl-star/dist/mitls/libevercrypt.dll $1/bin
# hashes
cp hashes.sh $1/