-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.tex
1719 lines (1472 loc) · 83.6 KB
/
main.tex
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass{ufsctex/ufsctex}
\usepackage{amsmath, amsfonts, amsthm, makecell, mathtools, pdfpages, tikz}
% English captions
\addto\captionsbrazil{
\renewcommand{\figurename}{Figure}
\renewcommand{\tablename}{Table}
\renewcommand{\listfigurename}{List of Figures}
\renewcommand{\listtablename}{List of Tables}
\renewcommand{\contentsname}{Table of Contents}
\renewcommand{\bibname}{REFERENCES}
\renewcommand{\proofname}{Proof.}
}
\makeatletter
\renewcommand{\listadeabreviaturas}{
\pretextualchapter{List of Acronyms}\@starttoc{las}}
\renewcommand{\listadesimbolos}{
\pretextualchapter{List of Symbols}\@starttoc{lsb}}
\renewcommand{\listadealgoritmos}{
\pretextualchapter{List of Algorithms}\@starttoc{loa}}
\makeatother
% Use standard \mathcal font
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
% Create theorem environments
\newtheorem{definition}{Definition}
\newtheorem{corollary}{Corollary}
% Tabular configurations
\renewcommand\theadfont{\bfseries}
% Cover info
\instituicao[a]{Universidade Federal de Santa Catarina}
\departamento[o]{Departamento de Informática e Estatística}
\curso[o]{Programa de Graduação em Ciência da Computação}
\documento[a]{Monografia}
\titulo{Reducing keys in Rainbow-like signature schemes}
\autor{Matheus Silva Pinheiro Bittencourt}
\grau{Bacharel em Ciência da Computação}
\local{Florianópolis}
\data{11}{Novembro}{2019}
\orientador[Orientador]{Prof.\ Ricardo Felipe Custódio, Dr.}
\coorientador[Coorientador]{Gustavo Zambonin, Bel.}
\coordenador[Coordenador]
{Prof.\ José Francisco Danilo de Guadalupe Correa Fletes}
\numerodemembrosnabanca{2}
\orientadornabanca{nao}
\coorientadornabanca{nao}
\bancaMembroA{
Prof. Daniel Panario, Dr.\\
Carleton University
}
\bancaMembroB{
Lucas Pandolfo Perin, Me.\\
Universidade Federal de Santa Catarina
}
\dedicatoria{A Fátima, que infelizmente não pode acompanhar minha trajetória,
mas tenho certeza de que estaria orgulhosa.}
\agradecimento{Agradeço aos meus pais que me fizeram capaz de entender e
percorrer os caminhos do conhecimento e da vida. A toda a minha família que
nunca me faltou com apoio sempre que precisei, em especial ao meu padrinho
Fernando e a minha madrinha Daniela. Ao meu orientador Prof. Ricardo e ao Prof.
Daniel pela ajuda no desenvolvimento deste trabalho com as inúmeras e
produtivas reuniões. Ao Gustavo que me proporcionou a oportunidade de ser
orientado por um amigo, e que contribui enormemente para este trabalho. Ao
Douglas Silva e ao Douglas Martins que me orientaram em diversos aspectos da
vida acadêmica e profissional. A todos os amigos que fiz dentro e fora do
curso, que me acompanharam e me ajudaram direta ou indiretamente a percorrer
esse trajeto. Em especial, agradeço ao Lucas e ao Vinicius que sempre me
motivaram a vencer as batalhas enfrentadas com o ânimo e a dedicação
necessária. Por último, e com certeza não menos importante, agradeço ao Mateus
e ao Luís pela cumplicidade e companhia mesmo quando nada parecia bem, e por
todas as pessoas incríveis que eles me proporcionaram conhecer.}
\epigrafe{``\textit{Ce qui embellit le désert,
c'est qu'il cache un puits quelque part...}''}{Le Petit Prince}
\textoResumo{Os algoritmos clássicos de assinatura digital como RSA e ECDSA
baseiam sua segurança na dificuldade da fatoração de inteiros, e no logaritmo
discreto, respectivamente. Esses problemas já possuem algoritmos quânticos que
os resolvem em tempo polinomial, ou seja, com computadores quânticos poderosos
o suficiente, o uso dos algoritmos de assinatura digital mais difundidos
tornará-se impraticável. Naturalmente, com o aumento do poder computacional
quântico, o interesse por criptossistemas resistentes a ataques que utilizam-se
de tais computadores também cresceu. A área que estuda esses criptossistemas é
chamada de criptografia pós-quântica. Particularmente, esses algoritmos
baseiam-se numa série de problemas que, por enquanto, permanecem difíceis,
mesmo que computadores quânticos poderosos sejam utilizados, logo, despertam o
interesse para substituir os criptossistemas clássicos. Este trabalho aborda
criptossistemas baseados em sistemas de polinômios multivariados, que,
baseiam-se em problemas como a solução de sistemas de polinômios e o
isomorfismo de polinômios, os quais ainda são resistentes a algoritmos
quânticos, e portanto, são candidatos para criptografia pós-quântica. Tais
esquemas possuem tamanhos de chaves muito maiores que os algoritmos clássicos.
Neste trabalho um novo método para redução de chaves privadas do esquema de
assinatura digital Rainbow é proposto. Usando este método as chaves privadas
podem ser reduzidas em até 84\%. Ainda, este método pode ser combinado com
outros de forma a reduzir tanto a chave privada como a chave pública.}
\palavrasChave{criptografia pós-quântica, assinatura digital, Rainbow}
\textAbstract{Classic digital signature algorithms base their security upon the
difficulty of the integer factorization problem, and the discrete logarithm
problem, respectively. These problems already have quantum algorithms that
solve them in polynomial time, consequently, with sufficiently powerful quantum
computers, the use of the most common digital signature algorithms would become
impractical. Naturally, with the rise in quantum computational power, the
interest in cryptosystems resistant to attacks that make use of such computers
has raised as well. The area that studies such cryptosystems is called
post-quantum cryptography. Particularly, these algorithms are based upon a
series of problems that, at this time, continue to be hard, even with quantum
computers available, hence, provoke interest to substitute the classical
schemes. This work approaches cryptosystems based on systems of multivariate
polynomials. They base their security upon problems like the polynomial system
solving and the isomorphism of polynomials, which are still resistant to
quantum computers, henceforth are candidates to post-quantum cryptography.
Such schemes have much larger keys than classical algorithms. In this work a
new method that allows the reduction of private keys of the Rainbow digital
signature scheme is proposed. Using this method, private keys can be reduced by
up to 84\%. Still, this method can be combined with others to reduce the
private key and the public key simultaneously.}
\keywords{post-quantum cryptography, digital signatures, Rainbow}
\begin{document}
\pagenumbering{roman}
\capa{}
\pretextuais{}
\listadefiguras{}
\listadetabelas{}
\listadeabreviaturas{}
\sumario{}
\chapter{Introduction}
Classic asymmetric cryptography is threatened as a result of the advance in
quantum algorithms development. The hardness of recovering private keys, for
instance, RSA\sigla{RSA}{Rivest-Shamir-Adleman} and ECDSA\sigla{ECDSA}{Elliptic
Curve Digital Signature Algorithm} keys, relies, respectively, on the hardness
of the integer factorization problem and the discrete logarithm problem.
Quantum polynomial-time algorithms that solve those problems already
exist~\cite{shor1999polynomial}. Using such algorithms, recovering private keys
can be done efficiently by a sufficiently powerful quantum computer. Hence, the
most used digital signature algorithms would become insecure.
In such a scenario, cryptosystems that run on classical computers and cannot be
broken by quantum computers should be used for handling digital signatures. The
area that studies such cryptosystems is called post-quantum cryptography, and
the interest in this has emerged with the development of quantum computers. The
security of these algorithms relies on problems that are not known to be
solvable in polynomial-time, therefore, they appear to be good candidates for
use in a scenario of quantum adversaries.
There are several classes of post-quantum cryptosystems proposed in the
literature, and each of them relies on one kind of hard problem. This work aims
to study Multivariate Public-Key Cryptosystems
(MPKCs)\sigla{MPKCs}{Multivariate Public-Key Cryptosystems} based on
Rainbow~\cite{ding2005rainbow}. These cryptosystems are constructed using
multivariate polynomials systems. A polynomial system is usually composed of
polynomial equations with single variable monomials, and can be easily solved
using, for instance, Gaussian elimination. However, with the inclusion of more
variables into the monomials, it becomes a multivariate system. The problem of
solving multivariate systems is NP-Hard~\cite{garey1979npc}. Therefore, it may
be interesting to build cryptosystems based on this trait.
Several digital signature schemes were developed based on the structure of
multivariate systems. One of the first schemes presented was the Oil and
Vinegar\sigla{OV}{Oil and Vinegar} (OV) signature scheme~\cite{patarin1997ov},
which was broken by Kipnis and Shamir in its original
specification~\cite{kipnis1998cryptanalysis}. A subsequent
work~\cite{kipnis1999unbalanced} reparametrized it, leading to a scheme called
Unbalanced Oil and Vinegar.\sigla{UOV}{Unbalanced Oil and Vinegar} The trapdoor
introduced in the original OV is used in many other schemes. In essence, they
are similar to OV but ended up optimizing the signature, and key sizes, while
maintaining security levels. These schemes are still considered secure.
MPKCs have very efficient signature generation and verification algorithms, as
well as small signatures, in some cases, smaller than classic algorithms. The
main caveat of such schemes is that they have large public and private keys.
Various efforts were made to reduce such parts of these cryptosystems, but, to
the best of our knowledge, none of them reduced both public and private keys.
This work aims to understand the Rainbow signature scheme, its subsequent
optimized schemes and the key reduction techniques proposed in the literature.
Finally, a new framework that allows for a reduction of both the private and
the public keys in Rainbow-like schemes is proposed.
\section{Goals and scope}
\textit{General goal:} Study and describe Rainbow-like digital signature
schemes, understand the optimizations that reduce keys and signature sizes, and
their impact on the security of the classic schemes. Observe and analyze the
impact of parameter selection for such algorithms, as this plays an important
role in efficient and fast implementations of the schemes. Analyze the
state-of-the-art schemes, to understand the strategies being used to optimize
the cryptosystems.
\textit{Specific goals:} Describe the classic OV and the UOV digital signature
schemes; Describe the Rainbow signature scheme; Introduce relevant
optimizations on Rainbow, like CyclicRainbow~\cite{petzoldt2010cyclicrainbow};
Compare and analyze the performance of the aforementioned schemes in terms of
operations needed to generate and verify signatures as well as storage
requirements. Finally, propose new optimizations on top of those schemes.
\textit{Scope:} This work is focused on the Rainbow digital signature scheme,
its ancestors, and the optimizations made on top of it. Other classes of
post-quantum algorithms such as code-, lattice- and hash-based cryptosystems
are not covered. Classical asymmetric algorithms are not covered as well.
Quantum algorithms are also not discussed.
\section{Method}
The work was developed using the infrastructure and resources provided by the
Computer Security Laboratory (LabSEC/UFSC). A literature review was made to
determine the state-of-the-art in MPKCs. Recently proposed schemes were
studied, as well as broken ones for a better understanding of the constructions
used that optimize the classic multivariate schemes. The performance of all the
schemes studied were observed along with the impact of the optimizations.
\chapter{Cryptography and Algebra background}
In this chapter some basic background on cryptography and algebra is given for
a complete understanding of the following chapters. All definitions and
descriptions are based on \cite{stinson2005cryptography}.
\section{Public Key Cryptography}
Symmetric cryptography consists of ciphering and deciphering a message with the
same key. This can be very useful if two parties, say Alice and Bob, have
agreed upon using the same key through a secure channel. But if Alice and Bob
are distant and do not have a secure channel to share a symmetric key, this
cannot be used. Public key cryptography solves this issue, as there exists two
keys. One of the keys is public, everyone can have access, and it is used to
encrypt a message. The other key is private and can be held only by its owner,
no one else can access it. Deciphering a message can only be made with the
private key. Also, getting the private key from the public key should be
computationally unfeasible. Now, if Bob wants to send a private message to
Alice, he gets her public key through any channel of communication, encrypts
the message, and sends it to Alice. Alice, which possesses the private key, is
the only one capable of decrypting Bob's message.
The idea of public key cryptosystems was first introduced
in~\cite{diffie1976new}, but the first practical scheme of such kind was
proposed in~\cite{rivest1977digital}. These algorithms can be thought as a
trapdoor one-way function, i.e. the encryption process ``traps'' the message,
and only with the possession of the private key, one can untangle the original
message from the trap. The security of these algorithms rely on the difficulty
of getting the private key from the public one, that is, it should be hard to
unravel the message from the trap.
\section{Digital Signatures}
Conventional signatures are used everyday to provide authenticity of documents,
like letters and contracts. A digital signature is a signature to a digital
document, that can be transmitted across a digital medium. Digitally signed
documents have considerable differences to conventional signatures. First, a
digital signature is not physically bonded to the signed document. Second, the
verification procedure of the signature is done in a different way than
classical signatures. Conventional signatures are verified by similarity to
other signatures that are trusted. Digital signatures are verified using
publicly known algorithms. Also, a digital signature can be copied several
times, and it remains authentic. Care should be taken, such that a document is
not used more times than it should be. For instance, a signed document saying
that Alice wants to transfer some amount of money to Bob should be used only
once, as Bob could force the bank to transfer this same amount multiple times.
Adding the time the signature was made to the signed document can mitigate this
problem.
A digital signature scheme is composed of three efficient\footnote{Can be
computed in a reasonable time by the parties involved.} algorithms:
\begin{itemize}
\item \textbf{Key generation:} Alice generates a key pair, publishes the
public key to anyone who wants to verify her signatures, and keeps the
private key secret.
\item \textbf{Signature generation:} Alice, possessing the private key,
signs a document $d$, yielding a signature $\sigma$, and publishes the pair
$(d, \sigma)$. For each different document, a different signature is
produced.
\item \textbf{Signature verification:} Bob wants to verify Alice's
signature $(d, \sigma)$. With the public key, Bob can verify that, indeed,
only Alice's private key could generate $\sigma$ for $d$. If someone
altered $d$ to insert malicious information and sent this modified document
$d'$, to Bob, the signature $\sigma$ would not be verified by the
verification algorithm.
\end{itemize}
This can be seen as the inverse of sending private messages using public key
cryptography, as the owner of the private key ciphers the message to be signed.
Recall that it should be hard to find the private key from the public one, thus
it is hard to forge new signatures without possessing the private key.
A secure digital signature scheme should provide three properties to the signed
documents, as long as they are valid:
\begin{itemize}
\item \textbf{Integrity:} The document is untouched compared to the
originally signed document. Flipping one bit of the document would render
the signature invalid.
\item \textbf{Authenticity:} Only the owner of the private key can generate
valid signatures for the corresponding public key. So, if a document is
signed, it could only be signed be the private key owner. Generating new
signatures, without the private key, should be computationally unfeasible
for secure schemes.
\item \textbf{Non-repudiation:} The signer cannot deny having created a
valid signature $\sigma$ for a document $d$. This is due to the fact that,
it is unfeasible to forge signatures.
\end{itemize}
\section{Cryptographic Hash Functions}
In the scope of this work, a hash function is a function that is used to map
arbitrarily sized data to a fixed length value, \text{i.e.} $\mathcal{H}:\{0,
1\}^* \rightarrow \{0, 1\}^n$. Such functions are useful to maintain integrity
of documents, for instance, a document $d$ has this fingerprint $h =
\mathcal{H}(d)$, which can be verified whenever one wants to ensure that $d$
was not modified. If for some reason the document was changed, this modified
version $d'$ would have a different fingerprint $h' = \mathcal{H}(d')$, and the
integrity of the original document would not be verified because $h \ne h'$.
Of course, due to the ``compression'' made by $\mathcal{H}$, there ought to
exist two documents that generate the same fingerprint, that is $h =
\mathcal{H}(d_1) = \mathcal{H}(d_2)$ and $d_1 \ne d_2$. This happens due to the
fact that there exists infinitely more documents than fingerprints, so by the
pigeonhole principle there are infinitely many documents with the same
fingerprint. This can be a problem, because the integrity of those documents
could be erroneously verified. However, in practice, for secure hash functions,
this happens with negligible probability for a large enough $n$.
Hash functions are extensively used in digital signatures. It enables the
algorithms to sign arbitrarily big documents by signing only the fingerprint
$h$. However, a hash function should satisfy some properties to be considered
cryptographically secure. Specially, three problems should be unfeasible to
solve. Let $\mathcal{H}:X \rightarrow Y$ be a hash function:
\begin{itemize}
\item \textbf{Preimage:} Given $y \in Y$, find $x \in X$ such that $y =
\mathcal{H}(x)$.
\item \textbf{Second preimage:} Given $x \in X$, find $x' \in X,\; x' \ne
x$ such that $\mathcal{H}(x) = \mathcal{H}(x')$.
\item \textbf{Collision:} Find $x,\; x' \in X$ such that $\mathcal{H}(x) =
\mathcal{H}(x')$.
\end{itemize}
Suppose that Alice is using $\mathcal{H}$ to sign a document $d$, this is,
Alice only signs $h = \mathcal{H}(d)$. If a malicious party, namely Eve, could
solve any of the preimage problems efficiently, let's say, Eve finds $d'$ such
that $h = \mathcal{H}(d) = \mathcal{H}(d')$, then she could publish the same
signature yielded by Alice as a valid signature for $d'$ without Alice's
private key. If Eve solves the collision problem efficiently, she could hand
Alice a document $d$ to be signed, while having generated a document with
malicious content $d'$. The signature created by Alice would be valid for both
$d$ and $d'$.
\section{Finite Fields}
These section's definitions are based on \cite{lidl1983encyclopedia}, and a
basic understanding of the algebraic structures used in multivariate schemes is
given.
\begin{definition}
A group $(G, *)$ with the set $G$ and the binary operation $*$ satisfies the
following conditions:
\begin{itemize}
\item $*$ is associative, that is, $a*(b*c) = (a*b)*c$ for any $a, b, c \in
G$.
\item There exists an identity element $e \in G$ such that $a * e = e * a =
a$.
\item There exists an inverse for every $a \in G$ such that $a*a^{-1} =
a^{-1}*a = e$.
\end{itemize}
If the group also satisfies the condition $a*b = b*a$ for all $a, b \in G$ then
it is called an abelian or commutative group.
\end{definition}
\begin{corollary}
The set of integers modulo $n$, denoted $\mathbb{Z}/n$, along with the ordinary
addition, form a finite abelian group denoted $\mathbb{Z}_n$.
\end{corollary}
\begin{proof}
The associativity and commutativity come from the regular addition operation.
The identity element is $0$ and the inverse element of any $a \in \mathbb{Z}/n$
is $-a \mod n$. Hence, $(\mathbb{Z}/n, +)$ is an abelian group.
\end{proof}
\begin{definition}
A ring $(R, +, *)$ with the set $R$ and the two binary operations $+$ and $*$
satisfies the conditions:
\begin{itemize}
\item $(R, +)$ forms an abelian group.
\item $*$ is associative, that is, $a*(b*c) = (a*b)*c$ for any $a, b, c \in
R$.
\item $*$ is distributive, that is, $a*(b+c) = a*b + a*c$ for any $a, b, c
\in R$.
\end{itemize}
\end{definition}
It must be emphasized that not only the ordinary multiplication and addition
can be used to form groups or rings.
\begin{definition}
A ring $(R, +, *)$ can be further classified as:
\begin{itemize}
\item \textbf{Commutative} if $*$ is commutative, that is, $a*b = b*a$ for
all $a, b \in R$.
\item A \textbf{division ring} if the nonzero elements of $R$ form a group
under $*$.
\item A \textbf{field} if it is a commutative division ring.
\end{itemize}
\end{definition}
\begin{corollary}
The set of integers modulo a prime $p$, denoted $\mathbb{Z}/p$, along with the
ordinary addition and multiplication, form a finite field denoted
$\mathbb{F}_p$.
\end{corollary}
\begin{proof}
As stated above $(\mathbb{Z}/n, +)$ is an abelian group, therefore
$(\mathbb{Z}/p, +)$ is a commutative group as well. The ordinary multiplication
is associative, distributive and commutative. Now it must be shown that
$(\mathbb{Z} \setminus \{0\}, *)$ forms a group. The identity element of this
group is $1$. It can be observed that $a*b$ is never zero, because if $a*b
\equiv 0 \mod p$ then either $a$ or $b$ is zero and divides $p$, which is a
contradiction because $p$ is prime. Now to show that all elements have
inverses, the Bézout's identity can be used. For every $a \in \mathbb{Z}/p$
there exists $x, y \in \mathbb{Z}/p$ such that $a*x + p*y \equiv 1 \mod p$, due
to the fact that $\text{gcd}(a, p) = 1$. Note that $p*y \equiv 0 \mod p$, hence
$a*x \equiv 1 \mod p$ and $x$ is the inverse of $a$. It can be concluded that
$(\mathbb{Z}/p, +, *)$ is a finite field.
\end{proof}
\begin{definition}
Given a ring $(R, +, *)$ there exists a positive integer $n$ such that $n*r =
0$ for every $r \in R$. The least such positive integer is the characteristic
of the ring. If $n$ does not exist, the characteristic is $0$.
\end{definition}
It can be noted that finite fields have prime characteristic. If a finite field
had a characteristic $n = p*q$ with $p, q \in \mathbb{Z}$ and $1 < p,q < n$,
then $n*e = (p*q)*e = (p*e)*(q*e) = 0$ which implies that either $p*e = 0$ or
$q*e = 0$ and it is a contradiction, because $n$ should be the least positive
integer such that $n*e = 0$.
\begin{corollary}\label{cor:extension}
Let $\mathbb{F}_p[x]/f$ be the set of polynomials with coefficients in a finite
field $\mathbb{F}_p$, modulo an irreducible polynomial\footnote{An irreducible
polynomial cannot be divided by a polynomial other than $f(x) = 1$.} $f$ of
degree $n$. $\mathbb{F}_p[x]/f$ along with the ordinary polynomial addition and
multiplication modulo $f$, form an extension field denoted $\mathbb{F}_{p^n}$.
\end{corollary}
For illustration, the finite field $\mathbb{F}_{2^2}$ can be defined with its
elements being $P = \{0, 1, x, x+1\}$, and the operations, the ordinary
addition and multiplication of polynomials modulo $f(x) = x^2 + x + 1$. Note
that all coefficients are in $\mathbb{F}_2$. The addition operation is given in
Table \ref{tab:addition} and the multiplication in Table
\ref{tab:multiplication}. The addition in $\mathbb{F}_{2^2}$ is the trivial
polynomial addition with coefficients modulo $2$, and there is no need for
polynomial reductions. The multiplication though needs reductions modulo the
irreducible polynomial. For instance, $x*(x+1) \equiv x^2+x \equiv 1 + 1*f(x)
\equiv 1 \mod f$.
\begin{table}
\begin{center}
\begin{tabular}{c|cccc}
$+$ & $0$ & $1$ & $x$ & $x+1$ \\
\hline
$0$ & $0$ & $1$ & $x$ & $x+1$ \\
$1$ & $1$ & $0$ & $x+1$ & $x$ \\
$x$ & $x$ & $x+1$ & $0$ & $1$ \\
$x+1$ & $x+1$ & $x$ & $1$ & $0$ \\
\end{tabular}
\caption{Addition operation of $\mathbb{F}_{2^2}$}
\label{tab:addition}
\end{center}
\end{table}
\begin{table}
\begin{center}
\begin{tabular}{c|cccc}
$*$ & $0$ & $1$ & $x$ & $x+1$ \\
\hline
$0$ & $0$ & $0$ & $0$ & $0$ \\
$1$ & $0$ & $1$ & $x$ & $x+1$ \\
$x$ & $0$ & $x$ & $x+1$ & $1$ \\
$x+1$ & $0$ & $x+1$ & $1$ & $x$ \\
\end{tabular}
\caption{Multiplication operation of $\mathbb{F}_{2^2}$}
\label{tab:multiplication}
\end{center}
\end{table}
\begin{proof}
To prove Corollary \ref{cor:extension} the field properties should hold for the
finite fields of this fashion. Let $P = \mathbb{F}_p[x]/f$. Then, $(P, +)$
forms an abelian group with $e = 0$ and the inverse of any $a \in P$ being
$-a$. Also, $(P \setminus \{0\}, *)$ forms a group, with the identity element
being $1$. The inverse element of any $a \in P \setminus \{0\}$ can be found
using Bézout's indentity because $\text{gcd}(a, f) = 1$, this comes from the
fact that $f$ is irreducible. So, there exists $g, h \in P \setminus \{0\}$
such that $a*g + f*h \equiv 1 \mod f$. Note that $f*h \equiv 0 \mod f$, hence
$g$ is the inverse of $a$. Observe that $a*b \equiv 0 \mod f$ never happens in
the group $(P \setminus \{0\}, *)$, because either $a$ or $b$ would need to be
zero and would divide $f$, which is a contradiction because $f$ is irreducible.
All other properties can be trivially extended from the ordinary polynomial
addition and multiplication. Therefore, $(P, +, *)$ is a finite field.
\end{proof}
Extensions of the binary field $\mathbb{F}_2$ are specially interesting because
representing and operating with them can be very computationally efficient. An
element of $\mathbb{F}_{p^n}$ needs $n$ elements of $\mathbb{F}_p$ to be
represented, hence an element of $\mathbb{F}_{2^8}$ needs $8$ bits, or $1$
byte. For instance, the element $x^7 + x^5 + x + 1 \in \mathbb{F}_{2^8}$ can be
represented by the binary $8$-uple $(1, 0, 1, 0, 0, 0, 1, 1)$. The addition,
when elements are represented in such way, is simply the bitwise exclusive or
XOR operation. The multiplication operation can be performed efficiently using
a modification to the Peasant's algorithm, which takes advantage of the binary
representation. The reduction modulo $f$ can also be done by a series of
bitwise XOR operations. For small finite fields, a lookup table such as Table
\ref{tab:addition} and \ref{tab:multiplication}, can be precomputed in order to
dramatically improve the efficiency of the operations, as only one query to
such table would be needed to obtain the result.
\chapter{Multivariate cryptography}
In this chapter, basic foundations are given for the comprehension of the
techniques proposed in the current work. Section \ref{sec:mqsystems} contains a
description of the basic mathematical structure used to build MPKCs. Section
\ref{sec:bipolar} presents the construction used in the schemes discussed in
this work. Section \ref{sec:problems} depicts the underlying problems in which
MPKCs rely their security on. Section \ref{sec:mqschemes} describes the schemes
addressed in this study. Section \ref{sec:rainbowvariants} illustrates some
variants of the Rainbow digital signature scheme present in the literature.
Section \ref{sec:equivalentkeys} demonstrates a method to find equivalent
private keys in Rainbow-like schemes and how it can be used to reduce the outer
maps.
\section{Systems of multivariate equations}\label{sec:mqsystems}
Standard polynomials are simply a sum of monomials, each monomial consists of a
variable and a constant that multiplies it. Polynomials can be represented
using a vector that stores those constants. With multivariate polynomials, each
monomial consists of a multiplication of more than one variable and, again, a
constant. This inclusion of multiple variables to the monomials is what makes
them interesting to use in cryptosystems, since solving a system of such
polynomials is computationally hard. For the purpose of multivariate
cryptography, multivariate quadratic equations are sufficient, hence most
commonly used.
\begin{definition}
A multivariate quadratic polynomial over a finite field $\mathbb{F}$ is defined
as:
\begin{equation}
p(x_1,\dots,x_n) = \sum_{i=1}^n \sum_{j=i}^n \alpha_{ij} x_i x_j +
\sum_{i=1}^n \beta_i x_i + \gamma,
\end{equation}
where all $x, \alpha, \beta, \gamma \in \mathbb{F}$.
\end{definition}
A system of polynomials is a set of polynomials that share the same variables.
It is known that, for polynomials with $n$ variables, systems that have at
least $n$ linear polynomials, may be solvable, and the existence of solutions
can be checked efficiently. One of the most common methods for solving such
systems is the Gaussian elimination. Note that, not all systems with $n$
polynomials and $n$ variables have a unique solution, some of them may even
have infinitely many solutions. It happens due to the fact that a polynomial
can be linearly dependent of others in the systems.
Systems of multivariate polynomials can be constructed as well. Opposed to the
systems explained above, solving multivariate systems is a NP-Hard
problem~\cite{garey1979npc}, even for the simplest case of quadratic
polynomials, therefore they are interesting to be used in building
cryptosystems. Specially, systems of multivariate quadratic polynomials are
used, as the addition of more variables to the monomials does not increase the
hardness of the problem.
These systems can be seen as maps. For instance, a system $\mathcal{P}$, with
$n$ variables and $m$ equations, defines a map $\mathcal{P}:\mathbb{F}^n \to
\mathbb{F}^m$. Applying this map over a vector of variables consists of
substituting these variables into the equations and taking their results as the
output of the map.
\begin{definition}\label{def:mqsystem}
A system $\mathcal{P}$ of multivariate quadratic polynomials over a finite
field $\mathbb{F}$ is defined as:
\begin{equation}\label{eq:mqsystem}
\begin{split}
p^{(1)}(x_1,\dots,x_n) &= \sum_{i=1}^n \sum_{j=i}^n \alpha^{(1)}_{ij} x_i x_j
+ \sum_{i=1}^n \beta^{(1)}_i x_i + \gamma^{(1)}, \\
p^{(2)}(x_1,\dots,x_n) &= \sum_{i=1}^n \sum_{j=i}^n \alpha^{(2)}_{ij} x_i x_j
+ \sum_{i=1}^n \beta^{(2)}_i x_i + \gamma^{(2)}, \\
&\vdotswithin{=} \\
p^{(m)}(x_1,\dots,x_n) &= \sum_{i=1}^n \sum_{j=i}^n \alpha^{(m)}_{ij} x_i x_j
+ \sum_{i=1}^n \beta^{(m)}_i x_i + \gamma^{(m)},
\end{split}
\end{equation}
where all $x, \alpha, \beta, \gamma \in \mathbb{F}$.
\end{definition}
Each equation of the system can be represented as an upper triangular square
matrix of order $n+1$, where the element on the $i$-th line and the $j$-th
column represents the constant that multiplies the monomial $x_i x_j$. The last
column is used to represent the linear terms and the constant term. The $k$-th
polynomial of the system is represented by a matrix of the form:
\begin{equation}\label{eq:matrixrepresentation}
A^{(k)} =
\begin{pmatrix}
\alpha^{(k)}_{11} & \alpha^{(k)}_{12} & \alpha^{(k)}_{13} & \cdots &
\alpha^{(k)}_{1n} & \beta^{(k)}_1 \\
0 & \alpha^{(k)}_{22} & \alpha^{(k)}_{23} & \cdots &
\alpha^{(k)}_{2n} & \beta^{(k)}_2 \\
0 & 0 & \alpha^{(k)}_{33} & \cdots &
\alpha^{(k)}_{3n} & \beta^{(k)}_3 \\
\vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
0 & 0 & 0 & \cdots & \alpha^{(k)}_{nn} & \beta^{(k)}_n \\
0 & 0 & 0 & \cdots & 0 & \gamma^{(k)} \\
\end{pmatrix}.
\end{equation}
Furthermore, $p^{(k)}$ may be written as:
\begin{equation}
p^{(k)}(x_1,\dots,x_n) =
(x_1,\dots,x_n,1) \cdot A^{(k)} \cdot (x_1,\dots,x_n,1)^T.
\end{equation}
Systems of multivariate quadratic equations can be represented and stored with
ease, as shown above. It is worth recalling that the coefficients of those
equations are elements in a small finite field, thus operating with them is
computationally efficient. Although easy to manipulate, storing these matrices
is not space efficient. A notable effort resulted in various works that reduce
the public map, e.g. \cite{petzoldt2010cyclicrainbow}, or the private map, e.g.
\cite{yasuda2012reducing}, but none of them reduced the key pair
simultaneously.
With the keys represented as matrices, some works introduce special structures
into these matrices, in such a way that representing them requires less space.
For instance, the series of works by Petzoldt et al., introduce a framework
that enables the public key to be partially selected. Such selection is done in
a way that some special structure is introduced into the matrices, hence
reducing their space requirements. Notably,
CyclicRainbow~\cite{petzoldt2010cyclicrainbow} uses a cyclic structure in the
matrix representation of the public key.
\section{Bipolar construction}\label{sec:bipolar}
The basic construction used in multivariate cryptosystems is based on the
composition of multiple transformations. As described above, a multivariate
system, as per Definition \ref{def:mqsystem}, may be used as a map
$\mathcal{F}:\mathbb{F}^n\to\mathbb{F}^m$. The central transformation of this
construction is a system of such kind, that contains some specific structure
such that, one can find preimages. In this case, $\mathcal{F}$ remains secret,
and with the combination of one or more affine transformations, a public system
of equations, with no apparent structure, is generated.
As shown in Figure \ref{fig:bipolar}, the bipolar construction consists of
three secret maps, and a public map that is derived from these three. Let,
$\mathcal{P}$ and $\mathcal{F}$ be multivariate systems, and $\mathcal{S}$ and
$\mathcal{T}$ be random invertible affine maps. Affine maps are simply linear
maps that do not preserve the origin, that is, they may translate the object.
In the signing procedure, $\mathcal{F}^{-1}$ means finding one of possibly many
preimages, and $\mathcal{F}$ introduces some structure that allows one to do
such. The affine maps take care of hiding this structure by actually scrambling
the variables of the system. When generating the keys, one calculates
$\mathcal{P}$ composing the secret maps $\mathcal{P} = \mathcal{S} \circ
\mathcal{F} \circ \mathcal{T}$.
\begin{figure}
\centering
\begin{tikzpicture}
\node (h) at (0, 0) {$h \in \mathbb{F}^m$};
\node (y) at (3, 0) {$y \in \mathbb{F}^m$};
\node (x) at (6, 0) {$x \in \mathbb{F}^n$};
\node (z) at (9, 0) {$\sigma \in \mathbb{F}^n$};
\draw[-latex] (h) -- node[above]{$\mathcal{S}^{-1}$} (y);
\draw[-latex] (y) --
node[above]{$\mathcal{F}^{-1}$} node[below]{\textbf{Sign}} (x);
\draw[-latex] (x) -- node[above]{$\mathcal{T}^{-1}$} (z);
\draw[-latex] (z) to[bend left=35] node[above]{$\mathcal{P}$}
node[below]{\textbf{Verify}} (h);
\end{tikzpicture}
\caption{Flow of the bipolar construction}\label{fig:bipolar}
\end{figure}
Note that $n \geq m > 0$ should hold when using the construction for digital
signature schemes. This makes the public map $\mathcal{P}$ surjective, and
ensures that for every hash $h \in \mathbb{F}^m$ there exists a signature
$\sigma \in \mathbb{F}^n$. Encryption schemes can be constructed too, in this
case $n \leq m$ should hold, thus making the map injective and ensuring that
the decryption process results in only one plain text.
With a hash function $\mathcal{H}:\{0,1\}^* \to \mathbb{F}^m$ one can sign a
document $d$ by calculating $h = \mathcal{H}(d)$. As shown in Figure
\ref{fig:bipolar}, recursively compute the signature $\sigma =
\mathcal{T}^{-1}(\mathcal{F}^{-1}(\mathcal{S}^{-1}(h)))$. This is possible due
to the fact that those maps are constructed such that they can be inverted.
Actually, $\mathcal{F}$ can't be inverted, but preimages can be found. To
verify the signature $\sigma$ for document $d$ one can simply check if $h =
\mathcal{P}(\sigma)$ holds.
\section{Underlying computational problems}\label{sec:problems}
This section describes the problems in which multivariate cryptosystems
security rely on.
\subsection{Polynomial system solving}\label{sec:posso}
Solving systems of polynomials is the basic underlying problem, since, solving
the public system is sufficient to forge new signatures.
\begin{definition}
Polynomial System Solving problem: given a system $\mathcal{P}$ as per Equation
\ref{eq:mqsystem}, find a vector $x' = (x_1',\cdots,x_n')$ such that
$p^{(1)}(x') = p^{(2)}(x') = \cdots = p^{(m)}(x') = 0$.
\end{definition}
This problem was proven to be NP-Hard~\cite[Appendix A7.2]{garey1979npc} even
for the simplest case of quadratic polynomials over $\mathbb{F}_2$. The special
case of this problem where the polynomials have degree 2 is called
\textbf{MQ-Problem}. The NP-Hardness of this problem is important due to the
fact that, it is not feasible for an attacker to solve the public map
$\mathcal{P}$ directly, hence not feasible to forge signatures this way.
\subsection{Isomorphism of polynomials}
The security of multivariate cryptosystems, due to their construction, usually
does not rely exclusively on the MQ-Problem. An attacker knows that the public
map is constructed by the composition of the private maps, thus one can try to
decompose the map $\mathcal{P}$ into three maps, isomorphic to the private
ones, and forge new signatures. The problem of finding such isomorphic maps is
the Extended Isomorphism of Polynomials problem.
\begin{definition}
Extended Isomorphism of Polynomials problem: given a nonlinear multivariate
system $\mathcal{P} = \mathcal{S} \circ \mathcal{F} \circ \mathcal{T}$ with
$\mathcal{F}$ belonging to some class $\mathcal{C}$ of special nonlinear
systems that can be inverted, find $\tilde{\mathcal{S}}$, $\tilde{\mathcal{F}}$
and $\tilde{\mathcal{T}}$ such that $\mathcal{P} = \tilde{\mathcal{S}} \circ
\tilde{\mathcal{F}} \circ \tilde{\mathcal{T}}$ and $\tilde{\mathcal{F}} \in
\mathcal{C}$.
\end{definition}
With $\tilde{\mathcal{S}}$, $\tilde{\mathcal{F}}$ and $\tilde{\mathcal{T}}$ one
may forge a signature for a document $d$ by computing $\sigma =
\tilde{\mathcal{T}}^{-1}(\tilde{\mathcal{F}}^{-1}(\tilde{\mathcal{S}}^{-1}(
\mathcal{H}(d))))$ and publish it as a valid signature for the public key
$\mathcal{P}$. Recall that $\tilde{\mathcal{F}} \in \mathcal{C}$ so it can be
inverted.
Some variations of the problem with only one affine map or others that
involve finding the original central map $\mathcal{F}$ exist, but the extended
variation is the most generic one. In fact, solving the problem as stated
above, in polynomial time, is enough to break the Rainbow Signature
Scheme~\cite{ding2005rainbow} submitted to the NIST Post-Quantum Cryptography
Standardization Process~\cite{ding2017nist}.
Opposed to the MQ-Problem, the hardness of this problem is not well
established. Actually, on the balanced Oil and Vinegar
scheme~\cite{patarin1997ov} decomposing the public map was done efficiently by
~\cite{kipnis1998cryptanalysis}. While this remains an open problem, security
proofs for multivariate schemes based on the bipolar construction will be
absent. Still, MQDSS\sigla{MQDSS}{Multivariate Quadratic Digital Signature
Scheme}~\cite{chen20165} is a provably secure multivariate cryptosystem,
however it is based on a totally different construction.
\section{Multivariate digital signature schemes}\label{sec:mqschemes}
This section contains a description of the main schemes that are based on the
bipolar construction.
\subsection{Oil and Vinegar}\label{sec:ov}
The original Oil and Vinegar signature scheme was presented by
\cite{patarin1997ov}. It introduces a trapdoor that is based upon the idea of
having two sets of variables in the central map, called oil and vinegar. The
central map is constructed in such a way that the polynomials are linear in the
oil variables, that is, there are no monomials with two oil variables. With
this fact in mind, when generating a signature, one may actually linearize the
central system and solve for oil variables. A detailed description of the Oil
and Vinegar signature scheme follows.
\subsubsection{Key generation}
Let $K$ be a small finite field, e.g. $\mathbb{F}_2$. Let $o$ and $v$ be
integers, such that $o$ is the number of oil variables and $v$ the number of
vinegar variables. Let $O$ be the set of oil variables and $V$ the set of
vinegar ones. Let $\mathcal{H}: \{0,1\}^* \to K^o$ be a cryptographic hash
function.
The private key consists of two maps $\mathcal{T}$ and $\mathcal{F}$. Let
$\mathcal{T}: K^{o+v} \to K^{o+v}$ be a random \textit{invertible} affine
transformation, its effect is to rewrite every variable as a linear combination
of all other variables. This map is used to hide the structure of the central
map. Let $\mathcal{F}: K^{o+v} \to K^{o}$ be the central map, composed of $o$
equations of the form:
\begin{equation}\label{eq:ovpolynomial}
y^{(k)} =
\underbrace{\sum_{i=1}^{v}\sum_{j=i}^{v} \alpha^{(k)}_{ij} x_i x_j}_{
V \times V} +
\underbrace{\sum_{i=v+1}^{v+o}\sum_{j=1}^{v} \beta^{(k)}_{ij} x_i x_j}_{
O \times V} +
\underbrace{\sum_{i=1}^{o+v} \gamma^{(k)}_{i} x_i}_{\text{linear}} +
\underbrace{\delta^{(k)}}_{\text{constant}},
\end{equation}
\noindent
where $x_1,\dots,x_v \in V$ are the ``vinegar'' variables and
$x_{v+1},\dots,x_{v+o} \in O$ are the ``oil'' variables. Note that the oil
variables are not multiplied between themselves, this is important to find
preimages for this map when signing a message.
The public map $\mathcal{P}: K^{o+v} \to K^{o}$ is a simple composition of the
secret maps, $\mathcal{P} = \mathcal{F} \circ \mathcal{T}$. Both $\mathcal{F}$
and $\mathcal{P}$ are multivariate systems, and $\mathcal{F}$ has the special
structure mentioned above, nevertheless $\mathcal{P}$ looks randomly built.
With these maps described, let the public/private key pair be
$(\mathcal{P},(\mathcal{F},\mathcal{T}))$.
\subsubsection{Signature generation}
To sign a document $d$, compute its hash value $h = \mathcal{H}(d)$ and find a
preimage $(x_1,\dots,x_{o+v})$ for the map $\mathcal{F}$ such that
$(y^{(1)},\dots,y^{(o)}) = (h_1,\dots,h_o)$. Observe that the structure present
in $\mathcal{F}$ implies that, setting random values to the vinegar variables
makes the system linear. Hence, finding a preimage consists of selecting
vinegar variables at random, substituting them into $\mathcal{F}$, and finding
the oil variables through Gaussian elimination. If the system cannot be solved,
new vinegar variables need to be chosen. The vector of variables $x$ are found
such that $\mathcal{F}(x)=h$. Next, using the map $\mathcal{T}$ the signature
itself may be computed. Recall that $\mathcal{T}$ is invertible, thus
$\mathcal{T}^{-1}$ can be obtained. With both maps inverted, the signature
$\sigma$ of $d$ is published as $\sigma = \mathcal{T}^{-1}(x)$.
\subsubsection{Signature verification}
To verify a signature $\sigma$ of a document $d$, one can simply check if
$\mathcal{P}(\sigma) = \mathcal{H}(d)$ holds, therefore the signature is valid,
otherwise it is invalid. The equality does actually hold for valid signatures,
as $\mathcal{P}$ is a composition of the maps that were inverted in the signing
procedure. Remember that $\mathcal{P}$ is a system of multivariate equations,
hence hard to solve.
\subsection{Unbalanced Oil and Vinegar}
The original Oil and Vinegar explained in Section \ref{sec:ov} is actually
insecure due to the fact that $o = v$. It is called Balanced Oil and Vinegar
due the same amount of oil and vinegar variables. This aspect of the
cryptosystem was exploited by~\cite{kipnis1998cryptanalysis}, where a method
was introduced to efficiently forge new signatures when $o = v$. Subsequently,
a new scheme was proposed, namely Unbalanced Oil and
Vinegar~\cite{kipnis1999unbalanced}. This work proposes new parameters for the
original OV. The most common instantiation of this new scheme is the $v = 2o$
case.
\subsection{Rainbow}\label{sec:rainbow}
The Rainbow signature scheme was proposed in~\cite{ding2005rainbow}. It can be
described simply as a multilayered UOV. Actually, it is a generalization of the
UOV scheme, in other words, UOV is a single layer Rainbow instantiation. This
newly proposed scheme greatly improves space requirements in comparison to UOV.
Both public and private key sizes, as well as signatures size, are reduced for
equivalent security levels. A detailed description of the Rainbow cryptosystem
follows.
Each layer of this Rainbow has its own polynomials, as well as its own set of
oil and vinegar variables. These polynomials have the same structure as OV
polynomials, but the layers are intrinsically connected when constructed.
Namely, $V_l$ and $O_l$ are respectively the set of vinegar variables and the
set of oil variables of the $l$-th layer. Let $u$ be the number of layers. Let
$v_1, v_2, \dots, v_{u+1}$ be the number of vinegar variables in each layer,
such that $0 < v_1 < v_2 < \cdots < v_{u+1} = n$. It may be observed that the
layers actually grow bigger, this is due to the fact that each set of vinegar
variables contains the vinegar variables from the previous layer, that is $V_1
\subset V_2 \subset \cdots \subset V_{u}$. Deeper into the layers, the oil
variables become vinegar variables, \textit{i.e.} $V_{l+1} = V_l \cup O_l$.
Keep in mind that $|V_l| = v_l$ and $|O_l| = o_l = v_{l+1} - v_{l}$.
The connection between variables of the layers exist in such a way that the
layers have to be inverted one after the other for the complete inversion of
the central map. To start this process, one randomly selects the first set of
vinegar variables and substitutes them, making the first layer linear. Notice
that the oil variables of some layer are part of the vinegar variables of the
subsequent layer. When the first layer is solved, the set $O_1$ can be used to
construct $V_2$ in its entirety. With known values for $V_2$ one can linearize
the second layer and solve it. Repeating this process for every layer, inverts
the whole central map. It may happen that some layer is not be solvable, in
this case, a new set $V_1$ is chosen and the inversion process starts over.
This happens with very small probability as shown in Section
\ref{sec:invertibility}.
\subsubsection{Key generation}
Let the sets $V_l = \{x_1, \dots, x_{v_l}\}$ be the vinegar variables of the
$l$-th layer, and $O_l = V_{l+1} - V_l$ the respective oil variables. Observe
that, each layer $l$ has $o_l = v_{l+1} - v_{l}$ equations, and thus $o_l$
equations are needed to solve for $O_l$ variables. For each layer $l$,
construct a system $\mathcal{F}_l$ composed of $o_l$ polynomials of the form:
\begin{equation}\label{eq:rainbowmap}
y^{(k)} =
\sum_{i=1}^{v_l}\sum_{j=i}^{v_l} \alpha^{(k)}_{ij} x_i x_j +
\sum_{i=v_l+1}^{v_{l+1}}\sum_{j=1}^{v_l} \beta^{(k)}_{ij} x_i x_j +
\sum_{i=1}^{v_{l+1}} \gamma^{(k)}_{i} x_i +
\delta^{(k)},
\end{equation}
\noindent
for $k = v_l, \dots, v_{l+1} - 1$ and $l = 1, \dots, u$. Observe that the
polynomials are Oil and Vinegar polynomials, just like the ones in
Equation~\ref{eq:ovpolynomial}, and they can be solved for $O_l$ when $V_l$ has
known values. Let the central map $\mathcal{F}:K^{n} \to K^{n-v_1}$ be the
union of the $u$ layers. To hide the central map, two random invertible affine
maps are used. Let $\mathcal{S}:K^{n-v_1} \to K^{n-v_1}$ and $\mathcal{T}:K^{n}
\to K^{n}$ be part of the private key. Then, $\mathcal{P} = \mathcal{S} \circ
\mathcal{F} \circ \mathcal{T}$ is published as the public key.
\subsubsection{Signature generation}
Let $\mathcal{H}: \{0,1\}^* \to K^{n-v_1}$ be a cryptographic hash function. To
sign a document $d$, compute $h = \mathcal{H}(d)$. Compute $y = (y_1, \dots,
y_{n-v_1}) = \mathcal{S}^{-1}(h)$. All layers of $\mathcal{F}$ are solved using
the process described above, in order to find $x = (x_1, \cdots, x_n)$ such
that $\mathcal{F}(x) = y$. Finally, $\sigma = \mathcal{T}^{-1}(x)$ is published
as the signature for $d$.
\subsubsection{Signature verification}
Verifying a signature $\sigma$ for a document $d$ is as simple as checking if
$\mathcal{P}(\sigma) = \mathcal{H}(d)$ holds. Remark that, again, $\mathcal{P}$
is a multivariate system that appears to be randomly built, thus hard to solve
directly.
\subsubsection{Key sizes}
\begin{table}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
% header
\thead{Security level\\(bits)} & \thead{Parameters\\$(K, o_1, v_1, v_2)$}
& \thead{Private key size\\(bytes)} & \thead{Public key size\\(bytes)} \\
\hline
% data
80 & $(\mathbb{F}_{256}, 17, 17, 9)$ & 19208 & 25740 \\ \hline
100 & $(\mathbb{F}_{256}, 26, 22, 11)$ & 45450 & 60390 \\ \hline
128 & $(\mathbb{F}_{256}, 36, 28, 15)$ & 103704 & 139320 \\ \hline
192 & $(\mathbb{F}_{256}, 63, 46, 22)$ & 440638 & 596904 \\ \hline
256 & $(\mathbb{F}_{256}, 85, 63, 30)$ & 1086971 & 1498230 \\ \hline
\end{tabular}
\caption{Rainbow key sizes for parameters proposed in \cite{petzoldt2013thesis}}
\label{tab:rainbowkeysizes}
\end{center}
\end{table}
For illustration, Table \ref{tab:rainbowkeysizes} shows a comparison between
the key sizes of some Rainbow instances proposed in \cite[Chapter
6]{petzoldt2013thesis}. Let $m = n - v_1$ be the number of equations in Rainbow
central and public maps. The private and public key sizes of Rainbow-like
signature schemes are given, respectively, by the formulas:
\begin{equation}\label{eq:rainbowprivatekeysize}
K_{pr} =
\underbrace{m^2 + m}_{\mathcal{S}} + \underbrace{n^2 + n}_{\mathcal{T}} +
\underbrace{\sum_{l=1}^{u} o_l \left(
\frac{v_l(v_l + 1)}{2} + v_l o_l + v_{l+1} + 1
\right)}_{\mathcal{F}},
\end{equation}
\begin{equation}
K_{pu} = m \left( \frac{n (n + 1)}{2} + n + 1 \right)
= m \frac{(n+1)(n+2)}{2}.
\end{equation}
These can be easily checked by looking at Equation \ref{eq:rainbowmap} and the
size of the affine maps $\mathcal{S}$ and $\mathcal{T}$. Also, the public key
size is simply the size of a multivariate system with $n$ variables and $m$
equations. The public key size formula can be checked by observing Equation
\ref{eq:matrixrepresentation}, as the public map is composed of $m$ matrices of
such kind. With $u=1$, OV and UOV key sizes can be calculated using $K_{pr}$
and $K_{pu}$ also, as Rainbow is a generalization of the Oil and Vinegar
schemes.
\section{Rainbow variants}\label{sec:rainbowvariants}