#!/usr/bin/make

# This file is intended to be run by Debian package maintainers to
# download the s2n-bignum files that are vendored by this package.
# This download files into a location that will be picked up during
# build of the Debian package.

URL=https://raw.githubusercontent.com/awslabs/s2n-bignum/acbb18e6343f12a7944de72c1ec0991739600f8c

.PHONY: all

all:
	rm -rf debian/s2n-bignum
	mkdir -pv debian/s2n-bignum/x86/curve25519 debian/s2n-bignum/arm/curve25519
	wget -nv -P debian/s2n-bignum/x86/curve25519/ $(URL)/x86/curve25519/curve25519_x25519base.S
	wget -nv -P debian/s2n-bignum/x86/curve25519/ $(URL)/x86/curve25519/curve25519_x25519base_alt.S
	wget -nv -P debian/s2n-bignum/x86/curve25519/ $(URL)/x86/curve25519/curve25519_x25519.S
	wget -nv -P debian/s2n-bignum/x86/curve25519/ $(URL)/x86/curve25519/curve25519_x25519_alt.S
	wget -nv -P debian/s2n-bignum/x86/curve25519/ $(URL)/x86/curve25519/bignum_inv_p25519.S
	wget -nv -P debian/s2n-bignum/arm/curve25519/ $(URL)/arm/curve25519/curve25519_x25519base_byte.S
	wget -nv -P debian/s2n-bignum/arm/curve25519/ $(URL)/arm/curve25519/curve25519_x25519base_byte_alt.S
	wget -nv -P debian/s2n-bignum/arm/curve25519/ $(URL)/arm/curve25519/curve25519_x25519_byte.S
	wget -nv -P debian/s2n-bignum/arm/curve25519/ $(URL)/arm/curve25519/curve25519_x25519_byte_alt.S
	wget -nv -P debian/s2n-bignum/arm/curve25519/ $(URL)/arm/curve25519/bignum_inv_p25519.S
