\section{Simulation of local NPI implementation during Victoria's second wave}

\subsection{School closures}
The effect of Victorian school closures is captured through the timeline presented in Table \ref{tab:school_timeline}.

\begin{table}[ht]
\renewcommand{\baselinestretch}{1}
	\begin{tabular}[ht]{| p{4.2cm} | p{6.2cm} | p{3.2cm} |}
	\hline
		Date of change & Policy change & Modification applied to school contacts contribution to mixing matrix, \(s(t)\) \\
		\hline
		From model start & Remote learning & 0.1 \\
		\hline
		26\textsuperscript{th} May & 400,000 school students return to school & 0.393 \\
		\hline
		9\textsuperscript{th} June & Remaining 618,000 school students return to school & 1 \\
		\hline
		9\textsuperscript{th} July & Remote learning for stage 3 restrictions & 0.1 \\
		\hline
    \end{tabular}
    \title{Timeline used to implement Victorian school closure policies.}
    \caption{\textbf{Timeline used to implement Victorian school closure policies.} The function is applied to both metropolitan and regional services.}
    \label{tab:school_timeline}
\end{table}

\subsection{Macrodistancing in workplaces and other locations}
The functions applied here are determined by the Google mobility data according to Table \ref{tab:mobility_map}, as described above, but are applied separately for each service. Because Google mobility data pertains to local government areas (LGAs), whereas health service clusters may receive patients from across the state, it was necessary to map mobility data to services. Health service clusters' overall mobility values in each location were calculated using a weighted average of LGA mobility values according to the historical pattern of the origin of patients presenting to services within each service.

As a hypothetical example, if 50\% of patients historically presenting to Barwon South West health services come from the City of Geelong, the mobility data for the City of Geelong will contribute 50\% of the Google mobility estimate of Barwon South West.

Historical patterns of patient presentations by health service cluster were provided by the Victorian Department of Health and Human Services (DHHS).

\subsection{Microdistancing approach}
In this application to Victoria, the microdistancing function \(m(t)\) is comprised of two components: physical distancing and face coverings. Both physical distancing and face coverings micro-distancing are applied to the three non-household locations, such that the microdistancing function for non-household locations is given by: \[m(t)=d(t)^2\times f(t)^2\]
The two interventions are assumed to be independent and so are multiplicative. As for the macrodistancing functions, the two functions of time are squared to represent their effects on both the infector and the infectee in any potentially infectious interaction.

\subsection{Physical distancing}
The physical distancing function \(d(t)\) is a transposed and translated hyperbolic tan function. The parameters of this function were estimated by using maximum a posteriori inference, with priors that penalised large shape parameters (to avoid extremely rapid transitions). The proportions of respondents answering ``always" to YouGov surveys of Victorian residents asking ``Thinking about the last 7 days, about how many people from your household have you come into physical contact with (within 2 meters / 6 feet)?" were used as input data. Resulting parameters were: shape, 0.262764; lower asymptote, 0.2803973; upper asymptote; 0.4421819; and inflection point, 15\textsuperscript{th} July. The resulting function is presented in Figure \ref{fig:physical}.

\begin{figure}[ht]
    \resizebox{1\textwidth}{!}{\includegraphics[scale=1]{../covid_19/projects/victoria/methods_figures/physical_distancing_fig.png}}
    \caption{\textbf{Physical distancing micro-distancing function with data used for fitting} (for all services).}
    \title{Physical distancing micro-distancing function with data used for fitting}
    \label{fig:physical}
\end{figure}

\subsection{Face coverings}
Two separate face coverings microdistancing functions are employed, one for metropolitan and one for regional health service clusters. These functions were fitted using the same methods as for physical distancing, using YouGov data on Victorian residents' survey responses to the question ``Thinking about the last 7 days, have you worn a face mask outside your home (e.g. when on public transport, going to a supermarket, going to a main road)?". Estimated parameters were: shape, 0.5261693; lower asymptote, 0.130469; upper asymptote, 0.9143849; and inflection point, 23\textsuperscript{rd} July (consistent with the policy change in metropolitan Melbourne). This was applied directly to metropolitan services and translated ten days later for regional services, where face coverings were mandated from the 2\textsuperscript{nd} August. The resulting function is presented in Figure \ref{fig:face}.

\begin{figure}[ht]
 	\resizebox{1\textwidth}{!}{\includegraphics[scale=1]{../covid_19/projects/victoria/methods_figures/face_covering_fig.png}}
    \caption{\textbf{Face coverings micro-distancing function for metropolitan Melbourne services with data used for fitting.}}
	\label{fig:face}
	\title{Face coverings micro-distancing function for metropolitan Melbourne services with data used for fitting.}
\end{figure}


\subsection{Online Tensor Decomposition}
Since dynamic tensor decomposition pursues shorter time factor updates, fast decomposition process results low accuracy factorization when real-time data incomes.

\begin{center}
	\includegraphics[width=0.8\textwidth]{FIG/0-online-tensor-decomposition.pdf}
\end{center}

\subsubsection{\em Transformed Online CP}
We've developed \tocp by extending the basic intuition of \ocp. To optimize the speed accuracy problem, \tocp resembles \cpals by iteratively updating the factor matrix of temporal mode. In spite of time consumption, however it achieves remarkable accuracy improvement.

\subsubsection{\em DTD}
temporally growing dtd mentioned in Multi-aspect tensor completion

\newpage
\subsection{Drastic Data Handling}
When we decompose a tensor, we can find error norm comparing real and estimated entries. As the tensor temporally grows, we can calculate local and global error norm by measuring incoming slices and the whole tensor respectively.

Drastic data can be detected by measuring local error norm and distribution of previous norms. Using Welford's algorithm, we can track mean and deviation and find out anomalies in current local error norm by z-score calculation. Differentiating the upper and lower limit of z-score, we can trigger one of accuracy optimizing processes. Trigger function now decides whether to split or to concatenate behind after one temporal factor update. It allows to store the tensor efficiently by grouping tensors with similar themes and splitting them otherwise.

\begin{center}
	\includegraphics[width=0.8\textwidth]{FIG/0-drastic-data-handling.pdf}
\end{center}

\subsubsection{\em Split Process}
Anomaly detection in image error norm tells us sudden change in data. What if the incoming data may have a new theme unseen before? It implies that new decomposition starting point with tensor split is needed. In this process, we'd like to apply upper limit ${ul}$ to trigger splitting the tensor into serial tensors of different themes.

\subsubsection{\em Refinement Process}
Refinement process is to concatenate incoming tensor slices whose theme is similar to the previous tensor. Exceedance of lower limit ${ll}$ trigger forgetting preious decomposition result and decompose the tensor once again.

\begin{center}
	\includegraphics[width=0.49\textwidth]{FIG/1-online-tensor-decomposition.pdf}
	\includegraphics[width=0.49\textwidth]{FIG/1-drastic-data-handling.pdf}
\end{center}


\chapter{Further research}
\label{chap:furtherResearch}

It is possible to list an enormous number of ideas for further research in a field
like crypto-currencies, blockchain or cryptography. But some of those more related to the work
done in this paper are listed in the following. Some of them are improvements of
the work already done, but not yet ready for production, and some of them are
entirely exploratory.

% -----------------------------------------------------------------------------
\section{Side-channel attack resistant implementation and improvements}

The proposed implementation in the library \texttt{secp256k1} relies upon
\texttt{libgmp} for all mathematical calculus but this library is
not robust against side-channel attacks. The library has not
been developed for that particular purpose. Therefore, another implementation
is needed to handle, in constant time and constant memory if
possible, the mathematical calculus part. This is a significant improvement that
can be done, or must be done, before hoping to use the module in some real case
scenario.

\subsection{Second hash function}

The current implementation uses the hash function \texttt{SHA256} implemented
in the library \texttt{secp256k1} for $\Pi$ and $\Pi'$. This is not compliant
with the scheme requirements. Another hash function must be implemented
and used for $\Pi'$.

\subsection{Paillier cryptosystem}

Two major improvements or modifications can be made specifically on the
Paillier cryptosystem implementation. As shown in Paillier's paper, the
Chinese Remainder Theorem can be used to optimize the decryption. In the
standard approach, with a private key $(n, g, \lambda, \mu)$ and a ciphertext $c
\in \mathbb{Z}_{n^2}^*$ it is possible to compute the plaintext $m =
L(c^{\lambda} \mod n^2) \cdot \mu \mod n$ where $L(x) = \frac{x-1}{n}$. With the
CRT two functions $L_p$ and $L_q$ are defined as

\begin{ceqn}
\begin{align*}
  L_p(x) = \frac{x-1}{p} \quad \text{and} \quad L_q(x) = \frac{x-1}{q}
\end{align*}
\end{ceqn}

Decryption can, therefore, be performed with modulo $p$ and modulo $q$ and
recombining modular residues afterward

\begin{ceqn}
\begin{align*}
  m_p = L_p(c^{p-1} \mod p^2) \ h_p \mod p \\
  m_q = L_q(c^{q-1} \mod p^2) \ h_q \mod q \\
  m = \text{CRT}(m_p, m_q) \mod pq
\end{align*}
\end{ceqn}

with precomputations

\begin{ceqn}
\begin{align*}
  h_p &= L_p(g^{p-1} \mod p^2)^{-1} \mod p \quad \text{and} \\
  h_q &= L_q(g^{q-1} \mod p^2)^{-1} \mod q
\end{align*}
\end{ceqn}

Paillier cryptosystem can also be adapted to \gls{ec} cryptography as shown in the
paper \say{Trapdooring Discrete Logarithms on Elliptic Curves over Rings} by
Pascal Paillier \cite{10.1007/3-540-44448-3_44}. It is worth noting however that
the curve construction is different from the curve used to sign and so the code
base cannot necessarily be reused.

\subsection{Zero-knowledge proofs}

Non-interactive zero-knowledge proofs are a significant research field. The
article \say{From Extractable Collision Resistance to Succinct Non-interactive
Arguments of Knowledge, and Back Again} by Bitansky, Nir and Canetti, Ran and
Chiesa, Alessandro and Tromer, and Eran \cite{Bitansky:2012:ECR:2090236.2090263}
introduced the acronym zk-SNARK for zero-knowledge Succinct Non-interactive
ARgument of Knowledge that is the backbone of the Zcash protocol
\cite{cryptoeprint:2014:349}. In the recent paper \say{Bulletproofs: Efficient
Range Proofs for Confidential Transactions} \cite{cryptoeprint:2017:1066} a new
non-interactive zero-knowledge proof protocol with concise proofs and without a
trusted setup is proposed. Further research could be done to adapt the
zero-knowledge proof construction and migrate to a more generic approach. These
zero-knowledge proofs date from the early 2000s and advancement has been made
since then.

% -----------------------------------------------------------------------------
\section{Hardware wallets}

Hardware wallet devices have become increasingly popular. They promise to keep
the keys safe and, at least, expose the keys less
thanks to a dedicated and controlled environment. Keys can be stored
safely and, in an organization, for example, multiple hardware wallets can be
used to create a multi-signature to control the funds.

The development of this threshold library, even if it is just a 2-out-of-2
multi-signature script equivalent, can be used to create threshold hardware
wallet devices. Two hardware wallet devices can be set up together to create a
multi-user setup, or a hardware wallet device can be coupled with a phone to
secure a web-wallet.

% -----------------------------------------------------------------------------
\section{Key management}

Usually, when a new Bitcoin wallet is created a list of words, called a \textit{mnemonic} phrase,
is shown to the user as a backup of his key. The \textit{mnemonics} are between
twelve and twenty four words, and each word represents 11 bits of the initial seed
\cite{Mnemonic}. For a threshold key, it is not possible to represent all the
data in the same way given the size of the key (near 4.5 Kb). Another way to
display and transmit this information is needed to improve usability. Further
research could be done to find a better way to represent and display a threshold
key.

The master tag is not included in the \texttt{DER} schema. Is the key itself
responsible for storing this information or is this information part of the
setup and can be stored elsewhere? This question can also be explored.

% -----------------------------------------------------------------------------
\section{General threshold scheme}

The way multi-signature scripts work in Bitcoin requires exposing all
public keys related to the signatures. That increases the transaction size,
which implies significant fees. Due to the script size limit of near to 500 bytes,
the maximum number of signatories is around fifteen. The signatures are
naturally present with the public keys in the script, which implies that it is
possible to know which keys signed the transaction. That implies less anonymity
on the blockchain. With a general threshold scheme, these limitations would be
removed.

As previously mentioned, research has been done to generalize and find an
optimal $(t, n)$-threshold in \gls{ecdsa} \cite{10.1007/BFb0052253,
10.1007/978-3-642-27954-6_20}. These papers base their work on the scheme chosen
in this thesis, so a deeper analysis could be performed to assess the
changes needed and adapt the current implementation to construct a generic threshold scheme.

% -----------------------------------------------------------------------------
\section{Schnorr signatures}

In the paper \say{Efficient Identification and Signatures for Smart Cards}
published in CRYPTO 1989, C.P. Schnorr proposes the \say{Schnorr signature
algorithm} \cite{10.1007/0-387-34805-0_22}. The Schnorr signature is considered
the simplest digital signature scheme to be provably secure in a random oracle
model \cite{Bellare:1993:ROP:168588.168596, 10.1007/978-3-642-29011-4_33}.
Bitcoin developers and researchers have had a strong interest in this specific
scheme for some years now. Schnorr signatures could greatly reduce the size of
the signature from 65 bytes (\gls{ecdsa} in \texttt{DER} format) to around 40 bytes.

With the arrival of SegWit, script versioning was also introduced, making it
is easier to introduce a new \texttt{OP\_CODE} and so introduce a new signature
validation scheme. However, this will not invalidate the present work and
research because of the specific requirements needed to optimize payment channels.

Nevertheless, Schorr signatures are tipped to be the next scheme used in Bitcoin
and maybe in other crypto-currencies. Further research could be done to find a
protocol that fulfills the requirements defined for payment channel
optimization.


\subsubsection{\stid{3.12} Enabling Time Integrators for Exascale Through SUNDIALS} \label{subsubsect:SUNDIALS}

\paragraph{Overview}

This project is enhancing the SUNDIALS library of numerical software packages for integrating differential systems in time using state-of-the-art adaptive time step technologies for use on exascale systems.  Through software infrastructure developments, this project is enabling the efficient and robust SUNDIALS time integrator packages to easily interoperate with external linear and nonlinear solver packages developed for exascale computing.  In addition, this project is providing a many-vector capability so that SUNDIALS time integrators can more easily operate on data divided over heterogeneous architectures.  Lastly, this project is supporting the deployment and use of SUNDIALS packages within ECP applications, mainly through incorporation into the discretization-based Co-Design Centers, AMReX and CEED.

Efficient time integrators are essential for ECP because they are at the core of every time-dependent simulation application.  However, many applications do not use state-of-the-art methods, and if they do, they often do not yet use them fully on their systems.  For example, at the start of the ECP the astrophysics code, Nyx, used an adaptive integration package for solving individual reactions.  However, by applying a time integration package to a larger reaction system, the code is able to vectorize more of the calculations and get an accurate solution much faster.  By allowing for solvers tuned to exascale systems and vectors that are heterogeneous, SUNDIALS will be more applicable for use in multiphysics systems running on exascale platforms.

\paragraph{Key  Challenges}

Current implementations of efficient time integrators face challenges on many fronts.  First, integrators typically have treated the full physical problem with a single step size or have relied on low order operator splitting methods to couple physical processes at different time scales. While research is moving forward within the time integration community on methods for multirate systems, the software infrastructure needs to be in place to accommodate these schemes once they are developed.   Second, typical integrators operate on problem data in the form of vectors.  These operations suffer from low arithmetic intensity, and their efficiency is often memory bandwidth limited.  Lastly, implicit integrators, which are required in many exascale systems, require efficient linear and nonlinear solvers to be highly effective.  In addition, by applying integrator-dependent controls on these solvers, their efficiency can be significantly increased.  Applying these controls, however, often requires that information about the integrator and its progress be passed to the solver, and software must be designed to effectively pass that information while ensuring adequate encapsulation to provide ease of maintenance and software extension.

\paragraph{Solution Strategy}

This project includes a number of implementation activities that will prepare the SUNDIALS suite of time integrators for exascale systems. A major activity is a redesign of all linear solver interfaces and encapsulation of the nonlinear solvers within the time integrators in SUNDIALS.  The new linear solver interfaces make it much easier to interface external solver packages while maintaining the efficiency of SUNDIALS integrators. Encapsulating the nonlinear solvers reduces redundant code and allows the time integrators to better leverage common code resulting in a lower code maintenance burden within SUNDIALS.  In addition, the integrators are able to take advantage of outside nonlinear solvers.

This project also introduced a set of optional fused vector kernels into SUNDIALS.  These kernels execute multiple vector operations at once thereby reducing the number of kernel launches in GPU environments and also reducing the number of communications required for reduction operations.  These new kernels were added to all supplied SUNDIALS vectors and are invoked through optional interfaces.

Lastly, this project is developing a many-vector capability for SUNDIALS.  Due to the tight data encapsulation within SUNDIALS, users are able to supply any vector they would like underneath the integrators.  This project will supply the infrastructure needed to make it easy to place a vector of vectors underneath the integrators.  This vector of vectors is essential for later implementation of time integrators that will advance various parts of the system with different time step sizes.  This many-vector capability will also ease the use of different programming environments as differing vectors can be instantiated on different parts of a hybrid machine.

\paragraph{Recent Progress}

In May of 2018, SUNDIALS 4.0.0-dev was released, including new fused vector kernels in the vector API and in all supplied vectors.  Results show speedup from using these routines, especially for parallel reductions.  In September of 2018, SUNDIALS 4.0.0-dev.2 was released, including a full redesign of the nonlinear solver interfaces to the time integrators and encapsulation of the nonlinear solevrs.  Figure \ref{fig:sunorg1} shows the new organization of SUNDIALS where separate nonlinear solver interfaces are provided for Newton and fixed point nonlinear solver methods.  These interfaces are shared across all SUNDIALS integrators.
Individual integrators have the freedom to supply specific information from the integrator that controls the solver.  In addition, the SUNDIALS team has been collaborating closely with the AMReX Co-Design Center team to
design effective interfaces to SUNDIALS time integrators from AMReX for applications using ODE integrators,
such as for chemistry reaction systems as in Nyx, Castro, and PELE.

\begin{figure}[htb]
	\centering
	\includegraphics[width=6in]{projects/2.3.3-MathLibs/2.3.3.12-SUNDIALS-hypre/sunorg1.pdf}
	\caption{\label{fig:sunorg1}New structure of SUNDIALS showing options for the new SUNNONLINEARSOLVER classes.}
\end{figure}

\paragraph{Next Steps}

During the remainder of FY19, this project team will:
\begin{enumerate}
\item Complete a release of SUNDIALS with a new many-vector that will enable easier use of SUNDIALS on heterogeneous architectures and for multiphysics systems.
\item Complete a scalable demonstration example program that will enable performance assessments on large-scale problems and provide a testbed for new time integrators.
\item Continue to support AMReX and CEED Co-Design Centers in their use of SUNDIALS for ECP applications.
\end{enumerate}