0% found this document useful (0 votes)
10 views87 pages

Mathematics of Public Key Cryptography 1st Edition by Steven Galbraith 1107013925 9781107013926

The document provides information about various ebooks related to public key cryptography, including titles by authors such as Steven Galbraith and Lynn Margaret Batten. It emphasizes the importance of understanding the mathematics behind public key cryptography for applications like digital signatures. The text serves as a resource for students and researchers in mathematics, computer science, and electrical engineering, featuring numerous examples and exercises.

Uploaded by

bijoearbesi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views87 pages

Mathematics of Public Key Cryptography 1st Edition by Steven Galbraith 1107013925 9781107013926

The document provides information about various ebooks related to public key cryptography, including titles by authors such as Steven Galbraith and Lynn Margaret Batten. It emphasizes the importance of understanding the mathematics behind public key cryptography for applications like digital signatures. The text serves as a resource for students and researchers in mathematics, computer science, and electrical engineering, featuring numerous examples and exercises.

Uploaded by

bijoearbesi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 87

Explore the full ebook collection and download it now at ebookball.

com

Mathematics of Public Key Cryptography 1st Edition


by Steven Galbraith 1107013925 9781107013926

https://ebookball.com/product/mathematics-of-public-key-
cryptography-1st-edition-by-steven-
galbraith-1107013925-9781107013926-16258/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://ebookball.com


Click here to visit ebookball.com and download ebookball now
Your digital treasures (PDF, ePub, MOBI) await
Download instantly and pick your perfect format...

Read anywhere, anytime, on any device!

Public Key Cryptography Applications and Attacks 1st


Edition by Lynn Margaret Batten 9781118482254

https://ebookball.com/product/public-key-cryptography-applications-
and-attacks-1st-edition-by-lynn-margaret-batten-9781118482254-16236/

ebookball.com

The Mathematics of Encryption An Elementary Introduction


1st Edition by Margaret Cozzens, Steven Miller ISBN
0821883216 9780821883211
https://ebookball.com/product/the-mathematics-of-encryption-an-
elementary-introduction-1st-edition-by-margaret-cozzens-steven-miller-
isbn-0821883216-9780821883211-15588/

ebookball.com

LNCS 3193 A Public Key Encryption Scheme with Pseudo


random Ciphertexts 1st edition by Bodo Möller ISBN
3540229876 978-3540229872
https://ebookball.com/product/lncs-3193-a-public-key-encryption-
scheme-with-pseudo-random-ciphertexts-1st-edition-by-bodo-mapller-
isbn-3540229876-978-3540229872-12934/

ebookball.com

Applied Public Key Infrastructure 4th International


Workshop IWAP 2005 1st Edition by Jianying Zhou, Meng Chow
Kang, Feng Bao, Hwee Hwa Pang ISBN 1586035509
9781586035501
https://ebookball.com/product/applied-public-key-infrastructure-4th-
international-workshop-iwap-2005-1st-edition-by-jianying-zhou-meng-
chow-kang-feng-bao-hwee-hwa-pang-isbn-1586035509-9781586035501-19710/

ebookball.com
A Simple Public Key Cryptosystem with a Double Trapdoor
Decryption Mechanism and Its Applications 1st edition by
Emmanuel Bresson, Dario Catalano, David Pointcheval ISBN
3540205920 9783540205920
https://ebookball.com/product/a-simple-public-key-cryptosystem-with-a-
double-trapdoor-decryption-mechanism-and-its-applications-1st-edition-
by-emmanuel-bresson-dario-catalano-david-pointcheval-
isbn-3540205920-9783540205920-10706/
ebookball.com

An Efficient Public Key Trace and Revoke Scheme Secure


against Adaptive Chosen Ciphertext Attack 1st edition by
Chong Hee Kim, Yong Ho Hwang, Pil Joong Lee ISBN
3540205920 9783540205920
https://ebookball.com/product/an-efficient-public-key-trace-and-
revoke-scheme-secure-against-adaptive-chosen-ciphertext-attack-1st-
edition-by-chong-hee-kim-yong-ho-hwang-pil-joong-lee-
isbn-3540205920-9783540205920-11948/
ebookball.com

IEEE Standard Glossary of Mathematics of Computing


Terminology 1st Edition by IEEE ISBN 0738145416

https://ebookball.com/product/ieee-standard-glossary-of-mathematics-
of-computing-terminology-1st-edition-by-ieee-isbn-0738145416-9108/

ebookball.com

Handbook of Applied Cryptography 1st edition by Alfred


Menezes ISBN 1138385972 978-1138385979

https://ebookball.com/product/handbook-of-applied-cryptography-1st-
edition-by-alfred-menezes-isbn-1138385972-978-1138385979-16304/

ebookball.com

Handbook of Applied Cryptography 1st edition by Alfred


Menezes ISBN 1138385972 978-1138385979

https://ebookball.com/product/handbook-of-applied-cryptography-1st-
edition-by-alfred-menezes-isbn-1138385972-978-1138385979-16308/

ebookball.com
MATHEMATICS OF PUBLIC KEY CRYPTOGRAPHY

Public key cryptography is a major interdisciplinary subject with many real-world appli-
cations, such as digital signatures. A strong background in the mathematics underlying
public key cryptography is essential for a deep understanding of the subject, and this book
provides exactly that for students and researchers in mathematics, computer science and
electrical engineering.
Carefully written to communicate the major ideas and techniques of public key cryp-
tography to a wide readership, this text is enlivened throughout with historical remarks and
insightful perspectives on the development of the subject. Numerous examples, proofs and
exercises make it suitable as a textbook for an advanced course, as well as for self-study.
For more experienced researchers, it serves as a convenient reference for many important
topics: the Pollard algorithms, Maurer reduction, isogenies, algebraic tori, hyperelliptic
curves, lattices and many more.

steven d. galbraith is a leading international authority on the mathematics of public


key cryptography. He is an Associate Professor in the Department of Mathematics at the
University of Auckland.
MATHEMATICS OF PUBLIC
KEY CRYPTOGRAPHY

STEVEN D. GALBRAITH
University of Auckland
cambridge university press
Cambridge, New York, Melbourne, Madrid, Cape Town,
Singapore, São Paulo, Delhi, Mexico City
Cambridge University Press
The Edinburgh Building, Cambridge CB2 8RU, UK
Published in the United States of America by Cambridge University Press, New York

www.cambridge.org
Information on this title: www.cambridge.org/9781107013926


C S. D. Galbraith 2012

This publication is in copyright. Subject to statutory exception


and to the provisions of relevant collective licensing agreements,
no reproduction of any part may take place without the written
permission of Cambridge University Press.

First published 2012

Printed in the United Kingdom at the University Press, Cambridge

A catalogue record for this publication is available from the British Library

Library of Congress Cataloguing in Publication data


Galbraith, Steven D.
Mathematics of public key cryptography / Steven D. Galbraith.
p. cm.
Includes bibliographical references and index.
ISBN 978-1-107-01392-6 (hardback)
1. Coding theory. 2. Cryptography – Mathematics. I. Title.
QA268.G35 2012
003 .54 – dc23 2011042606

ISBN 978-1-107-01392-6 Hardback

Additional resources for this publication at


www.math.auckland.ac.nz/∼sgal018/crypto-book/crypto-book.html

Cambridge University Press has no responsibility for the persistence or


accuracy of URLs for external or third-party internet websites referred to in
this publication, and does not guarantee that any content on such websites is,
or will remain, accurate or appropriate.
Contents

Preface page xiii


Acknowledgements xiv
1 Introduction 1
1.1 Public key cryptography 2
1.2 The textbook RSA cryptosystem 2
1.3 Formal definition of public key cryptography 4

PART I BACKGROUND 11
2 Basic algorithmic number theory 13
2.1 Algorithms and complexity 13
2.2 Integer operations 21
2.3 Euclid’s algorithm 24
2.4 Computing Legendre and Jacobi symbols 27
2.5 Modular arithmetic 29
2.6 Chinese remainder theorem 31
2.7 Linear algebra 32
2.8 Modular exponentiation 33
2.9 Square roots modulo p 36
2.10 Polynomial arithmetic 38
2.11 Arithmetic in finite fields 39
2.12 Factoring polynomials over finite fields 40
2.13 Hensel lifting 43
2.14 Algorithms in finite fields 43
2.15 Computing orders of elements and primitive roots 47
2.16 Fast evaluation of polynomials at multiple points 51
2.17 Pseudorandom generation 53
2.18 Summary 53
3 Hash functions and MACs 54
3.1 Security properties of hash functions 54
3.2 Birthday attack 55

v
vi Contents

3.3 Message authentication codes 56


3.4 Constructions of hash functions 56
3.5 Number-theoretic hash functions 57
3.6 Full domain hash 57
3.7 Random oracle model 58
PART II ALGEBRAIC GROUPS 59
4 Preliminary remarks on algebraic groups 61
4.1 Informal definition of an algebraic group 61
4.2 Examples of algebraic groups 62
4.3 Algebraic group quotients 63
4.4 Algebraic groups over rings 64
5 Varieties 66
5.1 Affine algebraic sets 66
5.2 Projective algebraic sets 69
5.3 Irreducibility 74
5.4 Function fields 76
5.5 Rational maps and morphisms 79
5.6 Dimension 83
5.7 Weil restriction of scalars 84
6 Tori, LUC and XTR 86
6.1 Cyclotomic subgroups of finite fields 86
6.2 Algebraic tori 88
6.3 The group Gq,2 89
6.4 The group Gq,6 94
6.5 Further remarks 99
6.6 Algebraic tori over rings 99
7 Curves and divisor class groups 101
7.1 Non-singular varieties 101
7.2 Weierstrass equations 105
7.3 Uniformisers on curves 106
7.4 Valuation at a point on a curve 108
7.5 Valuations and points on curves 110
7.6 Divisors 111
7.7 Principal divisors 112
7.8 Divisor class group 114
7.9 Elliptic curves 116
8 Rational maps on curves and divisors 121
8.1 Rational maps of curves and the degree 121
8.2 Extensions of valuations 123
Contents vii

8.3 Maps on divisor classes 126


8.4 Riemann–Roch spaces 129
8.5 Derivations and differentials 130
8.6 Genus zero curves 136
8.7 Riemann–Roch theorem and Hurwitz genus formula 137
9 Elliptic curves 138
9.1 Group law 138
9.2 Morphisms between elliptic curves 140
9.3 Isomorphisms of elliptic curves 142
9.4 Automorphisms 143
9.5 Twists 144
9.6 Isogenies 146
9.7 The invariant differential 153
9.8 Multiplication by n and division polynomials 155
9.9 Endomorphism structure 156
9.10 Frobenius map 158
9.11 Supersingular elliptic curves 164
9.12 Alternative models for elliptic curves 168
9.13 Statistical properties of elliptic curves over finite fields 175
9.14 Elliptic curves over rings 177
10 Hyperelliptic curves 178
10.1 Non-singular models for hyperelliptic curves 179
10.2 Isomorphisms, automorphisms and twists 186
10.3 Effective affine divisors on hyperelliptic curves 188
10.4 Addition in the divisor class group 196
10.5 Jacobians, Abelian varieties and isogenies 204
10.6 Elements of order n 206
10.7 Hyperelliptic curves over finite fields 206
10.8 Supersingular curves 209

PART III EXPONENTIATION, FACTORING AND DISCRETE


LOGARITHMS 213
11 Basic algorithms for algebraic groups 215
11.1 Efficient exponentiation using signed exponents 215
11.2 Multi-exponentiation 219
11.3 Efficient exponentiation in specific algebraic groups 221
11.4 Sampling from algebraic groups 231
11.5 Determining group structure and computing generators for elliptic
curves 235
11.6 Testing subgroup membership 236
viii Contents

12 Primality testing and integer factorisation using algebraic groups 238


12.1 Primality testing 238
12.2 Generating random primes 240
12.3 The p − 1 factoring method 242
12.4 Elliptic curve method 244
12.5 Pollard–Strassen method 245
13 Basic discrete logarithm algorithms 246
13.1 Exhaustive search 247
13.2 The Pohlig–Hellman method 247
13.3 Baby-step–giant-step (BSGS) method 250
13.4 Lower bound on complexity of generic algorithms for the DLP 253
13.5 Generalised discrete logarithm problems 256
13.6 Low Hamming weight DLP 258
13.7 Low Hamming weight product exponents 260
14 Factoring and discrete logarithms using pseudorandom walks 262
14.1 Birthday paradox 262
14.2 The Pollard rho method 264
14.3 Distributed Pollard rho 273
14.4 Speeding up the rho algorithm using equivalence classes 276
14.5 The kangaroo method 280
14.6 Distributed kangaroo algorithm 287
14.7 The Gaudry–Schost algorithm 292
14.8 Parallel collision search in other contexts 296
14.9 Pollard rho factoring method 297
15 Factoring and discrete logarithms in subexponential time 301
15.1 Smooth integers 301
15.2 Factoring using random squares 303
15.3 Elliptic curve method revisited 310
15.4 The number field sieve 312
15.5 Index calculus in finite fields 313
15.6 Discrete logarithms on hyperelliptic curves 324
15.7 Weil descent 328
15.8 Discrete logarithms on elliptic curves over extension fields 329
15.9 Further results 332

PART IV LATTICES 335


16 Lattices 337
16.1 Basic notions on lattices 338
16.2 The Hermite and Minkowski bounds 343
16.3 Computational problems in lattices 345
Contents ix

17 Lattice basis reduction 347


17.1 Lattice basis reduction in two dimensions 347
17.2 LLL-reduced lattice bases 352
17.3 The Gram–Schmidt algorithm 356
17.4 The LLL algorithm 358
17.5 Complexity of LLL 362
17.6 Variants of the LLL algorithm 365
18 Algorithms for the closest and shortest vector problems 366
18.1 Babai’s nearest plane method 366
18.2 Babai’s rounding technique 371
18.3 The embedding technique 373
18.4 Enumerating all short vectors 375
18.5 Korkine–Zolotarev bases 379
19 Coppersmith’s method and related applications 380
19.1 Coppersmith’s method for modular univariate polynomials 380
19.2 Multivariate modular polynomial equations 387
19.3 Bivariate integer polynomials 387
19.4 Some applications of Coppersmith’s method 390
19.5 Simultaneous Diophantine approximation 397
19.6 Approximate integer greatest common divisors 398
19.7 Learning with errors 400
19.8 Further applications of lattice reduction 402

PART V CRYPTOGRAPHY RELATED TO DISCRETE LOGARITHMS 403


20 The Diffie–Hellman problem and cryptographic applications 405
20.1 The discrete logarithm assumption 405
20.2 Key exchange 405
20.3 Textbook Elgamal encryption 408
20.4 Security of textbook Elgamal encryption 410
20.5 Security of Diffie–Hellman key exchange 414
20.6 Efficiency considerations for discrete logarithm cryptography 416
21 The Diffie–Hellman problem 418
21.1 Variants of the Diffie–Hellman problem 418
21.2 Lower bound on the complexity of CDH for generic
algorithms 422
21.3 Random self-reducibility and self-correction of CDH 423
21.4 The den Boer and Maurer reductions 426
21.5 Algorithms for static Diffie–Hellman 435
21.6 Hard bits of discrete logarithms 439
21.7 Bit security of Diffie–Hellman 443
x Contents

22 Digital signatures based on discrete logarithms 452


22.1 Schnorr signatures 452
22.2 Other public key signature schemes 459
22.3 Lattice attacks on signatures 466
22.4 Other signature functionalities 467
23 Public key encryption based on discrete logarithms 469
23.1 CCA secure Elgamal encryption 469
23.2 Cramer–Shoup encryption 474
23.3 Other encryption functionalities 478

PART VI CRYPTOGRAPHY RELATED TO INTEGER


FACTORISATION 483
24 The RSA and Rabin cryptosystems 485
24.1 The textbook RSA cryptosystem 485
24.2 The textbook Rabin cryptosystem 491
24.3 Homomorphic encryption 498
24.4 Algebraic attacks on textbook RSA and Rabin 499
24.5 Attacks on RSA parameters 504
24.6 Digital signatures based on RSA and Rabin 507
24.7 Public key encryption based on RSA and Rabin 511

PART VII ADVANCED TOPICS IN ELLIPTIC AND


HYPERELLIPTIC CURVES 513
25 Isogenies of elliptic curves 515
25.1 Isogenies and kernels 515
25.2 Isogenies from j -invariants 523
25.3 Isogeny graphs of elliptic curves over finite fields 529
25.4 The structure of the ordinary isogeny graph 535
25.5 Constructing isogenies between elliptic curves 540
25.6 Relating the discrete logarithm problem on isogenous curves 543
26 Pairings on elliptic curves 545
26.1 Weil reciprocity 545
26.2 The Weil pairing 546
26.3 The Tate–Lichtenbaum pairing 548
26.4 Reduction of ECDLP to finite fields 557
26.5 Computational problems 559
26.6 Pairing-friendly elliptic curves 561
Appendix A Background mathematics 564
A.1 Basic notation 564
A.2 Groups 564
Contents xi

A.3 Rings 565


A.4 Modules 565
A.5 Polynomials 566
A.6 Field extensions 567
A.7 Galois theory 569
A.8 Finite fields 570
A.9 Ideals 571
A.10 Vector spaces and linear algebra 572
A.11 Hermite normal form 575
A.12 Orders in quadratic fields 575
A.13 Binary strings 576
A.14 Probability and combinatorics 576

References 579
Author index 603
Subject index 608
Preface

The book has grown from lecture notes of a Master’s level course in mathematics, for
students who have already attended a cryptography course along the lines of Stinson’s or
Smart’s books. The book is therefore suitable as a teaching tool or for self-study. However,
it is not expected that the book will be read linearly. Indeed, we discourage anyone to start
reading with either Part I, Part II or Part III. The best place to start, for an understanding
of mathematical cryptography, is probably Part V (replacing all references to “algebraic
group G” by F∗p ). For an introduction to RSA and Rabin one could start reading at Part VI
and ignore most references to the earlier parts.
Exercises are distributed throughout the book so that the reader performing self-study
can do them at precisely the right point in their learning. Readers may find exercises denoted
by  somewhat more difficult than the others, but it would be dangerous to assume that
everyone’s experience of the exercises will be the same.
Despite our best efforts, it is inevitable that the book will contain errors and mis-
leading statements. Errata will be listed on the author’s webpage for the book at
www.math.auckland.ac.nz/∼sgal018/crypto-book/crypto-book.html. Readers are encour-
aged to bring any errors to the attention of the author.
I would like to thank Royal Holloway, University of London and the University of
Auckland, each of which in turn was my employer for a substantial time while I was
writing the book. I also thank the EPSRC, who supported my research with an advanced
fellowship for the first few years of writing the book.
The book is dedicated to Siouxsie and Eve, both of whom tolerated my obsession with
writing for the last four years.

Steven Galbraith
Auckland

xiii
Acknowledgements

The book grew out of my lecture notes from the Master’s course “Public key cryptography”
at Royal Holloway. I thank the students who took that course for asking questions and doing
their homework in unexpected ways.
The staff at Cambridge University Press have been very helpful during the preparation
of this book.
I also thank the following people for answering my questions, pointing out errors in drafts
of the book, helping with LaTeX, examples, proofs, exercises, etc: José de Jesús Angel
Angel, Olivier Bernard, Nicolas Bonifas, Nils Bruin, Ilya Chevyrev, Bart Coppens, Alex
Dent, Claus Diem, Marion Duporté, Andreas Enge, Victor Flynn, David Freeman, Pierrick
Gaudry, Takuya Hayashi, Nadia Heninger, Florian Hess, Mark Holmes, Everett Howe,
David Jao, Jonathan Katz, Eike Kiltz, Kitae Kim, David Kohel, Cong Ling, Alexander May,
Esmaeil Mehrabi, Ciaran Mullan, Mats Näslund, Francisco Monteiro, James McKee, James
Nelson, Samuel Neves, Phong Nguyen, TaeHun Oh, Chris Peikert, Michael Phillips, John
Pollard, Francesco Pretto, Oded Regev, Christophe Ritzenthaler, Karl Rubin, Raminder
Ruprai, Takakazu Satoh, Leanne Scheepers, Davide Schipani, Michael Schneider, Peter
Schwabe, Reza Sepahi, Victor Shoup, Igor Shparlinski, Andrew Shallue, Francesco Sica,
Alice Silverberg, Benjamin Smith, Martijn Stam, Damien Stehlé, Anton Stolbunov, Drew
Sutherland, Garry Tee, Emmanuel Thomé, Frederik Vercauteren, Timothy Vogel, Anastasia
Zaytseva, Chang-An Zhao, Paul Zimmermann.
Any remaining errors and omissions are the author’s responsibility.

xiv
1
Introduction

Cryptography is an interdisciplinary field of great practical importance. The subfield of


public key cryptography has notable applications, such as digital signatures. The security
of a public key cryptosystem depends on the difficulty of certain computational problems in
mathematics. A deep understanding of the security and efficient implementation of public
key cryptography requires significant background in algebra, number theory and geometry.
This book gives a rigorous presentation of most of the mathematics underlying public key
cryptography. Our main focus is mathematics. We put mathematical precision and rigour
ahead of generality, practical issues in real-world cryptography or algorithmic optimality.
It is infeasible to cover all the mathematics of public key cryptography in one book. Hence,
we primarily discuss the mathematics most relevant to cryptosystems that are currently
in use, or that are expected to be used in the near future. More precisely, we focus on
discrete logarithms (especially on elliptic curves), factoring based cryptography (e.g., RSA
and Rabin), lattices and pairings. We cover many topics that have never had a detailed
presentation in any textbook.
Due to lack of space some topics are not covered in as much detail as others. For
example, we do not give a complete presentation of algorithms for integer factorisation,
primality testing and discrete logarithms in finite fields, as there are several good references
for these subjects. Some other topics that are not covered in the book include hardware
implementation, side-channel attacks, lattice-based cryptography, cryptosystems based on
coding theory, multivariate cryptosystems and cryptography in non-Abelian groups. In
the future quantum cryptography or post-quantum cryptography (see the book [48] by
Bernstein, Buchmann and Dahmen) may be used in practice, but these topics are also not
discussed in this book.
The reader is assumed to have at least a standard undergraduate background in groups,
rings, fields and cryptography. Some experience with algorithms and complexity is also
assumed. For a basic introduction to public key cryptography and the relevant mathematics
the reader is recommended to consult Smart [513], Stinson [532] or Vaudenay [553].
An aim of the present book is to collect in one place all the necessary background
and results for a deep understanding of public key cryptography. Ultimately, the text
presents what I believe is the “core” mathematics required for current research in public
key cryptography and it is what I would want my PhD students to know.

1
2 Introduction

The remainder of this chapter states some fundamental definitions in public key cryp-
tography and illustrates them using the RSA cryptosystem.

1.1 Public key cryptography


Two fundamental goals of cryptography are to provide privacy of communication between
two entities and to provide authentication of one entity to another. Both goals can be achieved
with symmetric cryptography. However, symmetric cryptography is not convenient in some
applications for the following reasons. First, each pair of communicating entities needs to
have a shared key. Second, these keys must be transmitted securely. Third, it is difficult to
obtain signatures with non-repudiation (e.g., suitable for signing contracts).
In the mid 1970s Merkle, Diffie and Hellman proposed the idea of public key cryptog-
raphy (also sometimes called asymmetric cryptography). This idea was also proposed
by Ellis at GCHQ, under the name “non-secret encryption”. One of the earliest and most
important public key cryptosystems is RSA, invented by Adleman, Rivest and Shamir in
1977 (essentially the same scheme was also invented by Cocks at GCHQ in 1973).
As noted above, a major application of public key cryptography is to provide authenti-
cation. An extremely important example of this in the real world is digital signatures for
authenticating automatic software updates. The public key of the software developer is
stored in the application or operating system, and the software update is only performed
if the digital signature on the update is verified for that public key (see Section 11.1 of
Katz and Lindell [300] for more details). Signature schemes also provide message integrity,
message authentication and non-repudiation (see Section 9.2 of Smart [513]). Other impor-
tant applications of public key cryptography are key exchange and key transport for secure
communication (e.g., in SSL or TLS).

1.2 The textbook RSA cryptosystem


We briefly describe the “textbook” RSA cryptosystem. The word “textbook” indicates that,
although the RSA cryptosystem as presented below appears in many papers and books, this
is definitely not how it should be used in the real world. In particular, public key encryption
is most commonly used to transmit keys (the functionality is often called key transport or
key encapsulation) rather than to encrypt data. Chapter 24 gives many more details about
RSA including, in Section 24.7, a very brief discussion of padding schemes for use in real
applications.
Alice chooses two large primes p and q of similar size and computes N = pq. Alice
also chooses e ∈ N coprime to ϕ(N ) = (p − 1)(q − 1) and computes d ∈ N such that

ed ≡ 1 (mod ϕ(N )).

Alice’s public key is the pair of integers (N, e) and her private key is the integer d. To
encrypt a message to Alice, Bob does the following:
1.2 The textbook RSA cryptosystem 3

1. Obtain an authentic copy of Alice’s public key (N, e). This step may require trusted
third parties and public key infrastructures, which are outside the scope of this book;
see Chapter 11 of Smart [513] or Chapter 11 of Stinson [532]. We suppress this issue in
this book.
2. Encode the message as an integer 1 ≤ m < N . √
Note that m does not necessarily lie in (Z/NZ)∗ . However, √ if p, q ≈ N then the
probability that gcd(m, N ) > 1 is (p + q − 1)/(N − 1) ≈ 2/ N . Hence, in practice
one may assume that m ∈ (Z/N Z)∗ .1
3. Compute and transmit the ciphertext

c = me (mod N ).

To decrypt the ciphertext, Alice computes m = cd (mod N ) and decodes this to obtain the
original message.

Exercise 1.2.1 Show that if gcd(m, N ) = 1 then (me )d ≡ m (mod N ). Show that if
gcd(m, N ) = 1 then (me )d ≡ m (mod N ).

The RSA system can also be used as a digital signature algorithm. When sending a
message m to Bob, Alice computes the signature s = md (mod N ). When Bob receives
(m, s) he obtains an authentic copy of Alice’s public key and then verifies that m ≡
se (mod N). If the verification equation holds then Bob believes that the message m does
come from Alice. The value m is not usually an actual message or document (which might
be huge) but a short integer that is the output of some (non-injective) compression function
(such as a hash function). We sometimes call m a message digest.
The idea is that exponentiation to the power e modulo N is a one-way function: a
function that is easy to compute but such that it is hard to compute preimages. Indeed,
exponentiation modulo N is a one-way permutation on (Z/NZ)∗ when e is co-prime to
ϕ(N). The private key d allows the permutation to be efficiently inverted and is known as
a trapdoor. Therefore, RSA is often described as a trapdoor one-way permutation.
A number of practical issues must be considered:

1. Can public keys be efficiently generated?


2. Is the cryptosystem efficient in the sense of computation time and ciphertext size?
3. How does Bob know that Alice’s public key is authentic?
4. Is the scheme secure?
5. What does “security” mean anyway?

One aim of this book is to explore the above issues in depth. We will study RSA (and some
other cryptosystems based on integer factorisation) as well as cryptosystems based on the
discrete logarithm problem.

1
If N is a product of two 150 digit primes (which is the minimum size for an RSA modulus) then the expected number of trials
to find 1 ≤ m < N with gcd(m, N) > 1 is therefore ≈ 10150 . Note that the age of the universe is believed to be less than 1018
seconds.
4 Introduction

To indicate some of the potential problems with the “textbook” RSA cryptosystem as
described above we present three simple attacks.

1. Suppose the RSA cryptosystem is being used for an online election to provide privacy
of an individual’s vote to everyone outside the electoral office.2 Each voter encrypts
their vote under the public key of the electoral office and then sends their vote by email.
Voters do not want any other member of the public to know who they voted for.
Suppose the eavesdropper Eve is monitoring internet traffic from Alice’s computer
and makes a copy of the ciphertext corresponding to her vote. Since encryption is
deterministic and there is only a short list of possible candidates, it is possible for Eve
to compute each possible vote by encrypting each candidate’s name under the public
key. Hence, Eve can deduce who Alice voted for.
2. To speed up encryption it is tempting to use small encryption exponents, such as e = 3
(assuming that N = pq where p ≡ q ≡ 2 (mod 3)). Now suppose Bob is only sending
a very small message 0 < m < N 1/3 to Alice; this is quite likely, since public key
cryptography is most often used to securely transmit symmetric keys. Then c = m3 in
N, i.e. no modular reduction has taken place. An adversary can therefore compute the
message m from the ciphertext c by taking cube roots in N (using numerical analysis
techniques).
3. A good encryption scheme should allow an adversary to learn absolutely nothing about
a message from the ciphertext. But, with the RSA cryptosystem, one can compute the
Jacobi symbol ( Nm ) of the message by computing ( Nc ) (this can be computed efficiently
without knowing the factorisation of N ; see Section 2.4). The details are given in
Exercise 24.1.8.

The above three attacks may be serious for some applications, but not for others.
However, a cryptosystem designer often has little control over the applications in which
their system is to be used. Hence, it is preferable to have systems that are not vulnerable
to attacks of the above form. In Section 24.7 we will explain how to secure RSA against
these sorts of attacks, by making the encryption process randomised and by using padding
schemes that encode short messages as sufficiently large integers and that destroy algebraic
relationships between messages.

1.3 Formal definition of public key cryptography


To study public key cryptography using mathematical techniques it is necessary to give
a precise definition of an encryption scheme. The following definition uses terminology
about algorithms that is recalled in Section 2.1. Note that the problem of obtaining an

2
Much more interesting electronic voting schemes have been invented. This unnatural example is chosen purely for pedagogical
purposes.
1.3 Formal definition of public key cryptography 5

authentic copy of the public key is not covered by this definition; the public key is an input
to the encryption function.

Definition 1.3.1 Let κ ∈ N be a security parameter (note that κ is not necessarily the
same as the “key length”; see Example 1.3.2). An encryption scheme is defined by the
following spaces (all depending on the security parameter κ) and algorithms:
Mκ the space of all possible messages;
PKκ the space of all possible public keys;
SKκ the space of all possible private keys;
Cκ the space of all possible ciphertexts;
KeyGen a randomised algorithm that takes the security parameter κ, runs in
expected polynomial-time (i.e., O(κ c ) bit operations for some constant
c ∈ N) and outputs a public key pk ∈ PKκ and a private key sk ∈ SKκ ;
Encrypt a randomised algorithm that takes as input m ∈ Mκ and pk, runs in
expected polynomial-time (i.e., O(κ c ) bit operations for some constant
c ∈ N) and outputs a ciphertext c ∈ Cκ ;
Decrypt an algorithm (not usually randomised) that takes c ∈ Cκ and sk,
runs in polynomial-time and outputs either m ∈ Mκ or the
invalid ciphertext symbol ⊥.

It is required that

Decrypt(Encrypt(m, pk), sk) = m

if (pk, sk) is a matching key pair. Typically, we require that the fastest known attack on the
system requires at least 2κ bit operations.

Example 1.3.2 We sketch how to write “textbook” RSA encryption in the format of
Definition 1.3.1. The KeyGen algorithm takes input κ and outputs a modulus N that is
a product of two randomly chosen primes of a certain length, as well as an encryption
exponent e. Giving a precise recipe for the bit-length of the primes as a function of the
security parameter is non-trivial for RSA; we merely note here that if κ = 128 (i.e., so that
there is no known attack on the system performing fewer than 2128 bit operations) then it is
standard to use 1536-bit primes. As we will discuss in Chapter 12, one can generate primes
in expected polynomial-time and hence KeyGen is a randomised algorithm with expected
polynomial-time complexity.
The message space Mκ depends on the randomised padding scheme being used. The
ciphertext space Cκ in this case is (Z/N Z)∗ , which does not agree with Definition 1.3.1 as
it does not depend only on κ. Instead, one usually takes Cκ to be the set of log2 (N ) -bit
strings.
The Encrypt and Decrypt algorithms are straightforward (though the details depend on
the padding scheme). The correctness condition is easily checked.
6 Introduction

1.3.1 Security of encryption


We now give precise definitions for the security of public key encryption. An adversary is a
randomised polynomial-time algorithm that interacts with the cryptosystem in some way. It
is necessary to define the attack model, which specifies the way the adversary can interact
with the cryptosystem. It is also necessary to define the attack goal of the adversary. For
further details of these issues see Sections 10.2 and 10.6 of Katz and Lindell [300], Section
1.13 of Menezes, van Oorschot and Vanstone [376] or Section 15.1 of Smart [513].
We first list the attack goals for public key encryption. The most severe one is the total
break, where the adversary computes a private key. There are three other commonly studied
attacks, and they are usually formulated as security properties (the security property is the
failure of an adversary to achieve its attack goal).
The word oracle is used below. This is just a fancy name for a magic box that takes
some input and then outputs a correct answer in constant time. Precise definitions are given
in Section 2.1.3.

r One-way encryption (OWE): Given a challenge ciphertext c the adversary cannot


compute the corresponding message m.
r Semantic security: An adversary learns no information at all about a message from its
ciphertext, apart from possibly the length of the message.
This concept is made precise as follows: assume all messages in Mκ have the same
length. A semantic security adversary is a randomised polynomial-time algorithm A
that first chooses a function f : Mκ → {0, 1} such that the probability, over uniformly
chosen m ∈ Mκ , that f (m) = 1 is 1/2. The adversary A then takes as input a challenge
(c, pk) where c is the encryption of a randomly chosen message m ∈ Mκ , and outputs a
bit b. The adversary is successful if b = f (m).
Note that the standard definition of semantic security allows messages m ∈ Mκ to be
drawn according to any probability distribution. We have simplified to the case of the
uniform distribution on Mκ .
r Indistinguishability (IND): An adversary cannot distinguish the encryption of any two
messages m0 and m1 , chosen by the adversary, of the same length.
This concept is made precise by defining an indistinguishability adversary to be a
randomised polynomial-time algorithm A that plays the following game with a challenger:
first, the challenger generates a public key and gives it to A. Then (this is the “first phase”
of the attack) A performs some computations (and possibly queries to oracles) and outputs
two equal length messages m0 and m1 . The challenger computes the challenge ciphertext
c (which is an encryption of mb where b ∈ {0, 1} is randomly chosen) and gives it to A.
In the “second phase”, the adversary A performs more calculations (and possibly oracle
queries) and outputs a bit b . The adversary is successful if b = b .

For a fixed value κ one can consider the probability that an adversary is successful over
all public keys pk output by KeyGen, and (except when studying a total break adversary)
1.3 Formal definition of public key cryptography 7

all challenge ciphertexts c output by Encrypt, and over all random choices made by the
adversary. The adversary breaks the security property if its success probability is noticeable
as a function of κ (see Definition 2.1.10 for the terms noticeable and negligible). The cryp-
tosystem achieves the security property if every polynomial-time adversary has negligible
success probability as a function of κ. An adversary that works with probability 1 is called
a perfect adversary.
We now list the three main attack models for public key cryptography.
r Passive attack/chosen plaintext attack (CPA): The adversary is given the public key.
r Lunchtime attack (CCA1):3 The adversary has the public key and can also ask for
decryptions of ciphertexts of its choosing during the first stage of the attack (i.e., before
the challenge ciphertext is received).
r Adaptive chosen-ciphertext attack (CCA) (also denoted CCA2): The adversary has the
public key and is given access to a decryption oracle O that will provide decryptions of
any ciphertext of its choosing, with the restriction that O outputs ⊥ in the second phase
of the attack if the challenge ciphertext is submitted to O.
One can consider an adversary against any of the above security properties in any of
the above attack models. For example, the strongest security notion is indistinguishability
under an adaptive chosen-ciphertext attack. A cryptosystem that achieves this security level
is said to have IND-CCA security. It has become standard in theoretical cryptography
to insist that all cryptosystems have IND-CCA security. This is not because CCA attacks
occur frequently in the real world, but because a scheme that has IND-CCA security should
also be secure against any real-world attacker.4
Exercise 1.3.3 Show that the “textbook” RSA cryptosystem does not have IND-CPA
security.
Exercise 1.3.4 Show that the “textbook” RSA cryptosystem does not have OWE-CCA
security.
Exercise 1.3.5 Prove that if a cryptosystem has IND security under some attack model
then it has semantic security under the same attack model.

1.3.2 Security of signatures


Definition 1.3.6 A signature scheme is defined, analogously to encryption, by message,
signature and key spaces depending on a security parameter κ. There is a KeyGen algorithm
and algorithms:

3
The name comes from an adversary who breaks into someone’s office during their lunch break, interacts with their private key
in some way and then later in the day tries to decrypt a ciphertext.
4
Of course, there are attacks that lie outside the attack model we are considering, such as side-channel attacks or attacks by
dishonest system administrators.
8 Introduction

Sign: A randomised algorithm that runs in polynomial-time (i.e., O(κ c ) for


some constant c ∈ N), takes as input a message m and a private key sk,
and outputs a signature s.
Verify: An algorithm (usually deterministic) that runs in polynomial-time, takes
as input a message m, a signature s and a public key pk, and
outputs “valid” or “invalid”.

We require that Verify(m, Sign(m, sk), pk) = “valid”. Typically, we require that all known
algorithms to break the signature scheme require at least 2κ bit operations.

The main attack goals for signatures are the following (for more discussion see Gold-
wasser, Micali and Rivest [235], Section 12.2 of Katz and Lindell [300], Section 15.4 of
Smart [513], or Section 7.2 of Stinson [532]):
r Total break: An adversary can obtain the private key for the given public key.
r Selective forgery (also called target message forgery): An adversary can generate a
valid signature for the given public key on any message.
r Existential forgery: An adversary can generate a pair (m, s) where m is a message and
s is a signature for the given public key on that message.
The acronym UF stands for the security property “unforgeable”. In other words, a
signature scheme has UF security if every polynomial-time existential forgery algorithm
succeeds with only negligible probability. Be warned that some authors use UF to denote
“universal forgery”, which is another name for selective forgery.

As with encryption, there are various attack models.


r Passive attack: The adversary is given the public key only. This is also called a “public
key only” attack.
r Known message attack: The adversary is given various sample message–signature pairs
for the public key.
r Adaptive chosen-message attack (CMA): The adversary is given a signing oracle that
generates signatures for the public key on messages of their choosing.
In this case, signature forgery usually means producing a valid signature s for the
public key pk on a message m such that m was not already queried to the signing oracle
for key pk. Another notion, which we do not consider further in this book, is strong
forgery; namely, to output a valid signature s on m for public key pk such that s is not
equal to any of the outputs of the signing oracle on m.

As with encryption, one says the signature scheme has the stated security property under
the stated attack model if there is no polynomial-time algorithm A that solves the problem
with noticeable success probability under the appropriate game. The standard notion of
security for digital signatures is UF-CMA security.

Exercise 1.3.7 Give a precise definition for UF-CMA security.


1.3 Formal definition of public key cryptography 9

Exercise 1.3.8 Do “textbook” RSA signatures have selective forgery security under a
passive attack?
Exercise 1.3.9 Show that there is a passive existential forgery attack on “textbook” RSA
signatures.
Exercise 1.3.10 Show that, under a chosen-message attack, one can selectively forge
“textbook” RSA signatures.
PART I
BACKGROUND
2
Basic algorithmic number theory

The aim of this chapter is to give a brief summary of some fundamental algorithms for
arithmetic in finite fields. The intention is not to provide an implementation guide; instead,
we sketch some important concepts and state some complexity results that will be used
later in the book. We do not give a consistent level of detail for all algorithms; instead, we
only give full details for algorithms that will play a significant role in later chapters of the
book.
More details of these subjects can be found in Crandall and Pomerance [150], Shoup
[497], Buhler and Stevenhagen [106], Brent and Zimmermann [95], Knuth [308], von zur
Gathen and Gerhard [220], Bach and Shallit [21] and the handbooks [16, 376].
The chapter begins with some remarks about computational problems, algorithms and
complexity theory. We then present methods for fast integer and modular arithmetic. Next
we present some fundamental algorithms in computational number theory such as Euclid’s
algorithm, computing Legendre symbols and taking square roots modulo p. Finally, we
discuss polynomial arithmetic, constructing finite fields and some computational problems
in finite fields.

2.1 Algorithms and complexity


We assume the reader is already familiar with computers, computation and algorithms.
General references for this section are Chapter 1 of Cormen et al. [136], Davis and
Weyuker [154], Hopcroft and Ullman [265], Section 3.1 of Shoup [497], Sipser [509]
and Talbot and Welsh [539].
Rather than using a fully abstract model of computation, such as Turing machines, we
consider all algorithms as running on a digital computer with a typical instruction set, an
infinite number of bits of memory and constant-time memory access. This is similar to
the random access machine (or register machine) model; see Section 3.6 of [21], [129],
Section 2.2 of [136], Section 7.6 of [265] or Section 3.2 of [497]. We think of an algorithm
as a sequence of bit operations, though it is more realistic to consider word operations.
A computational problem is specified by an input (of a certain form) and an output
(satisfying certain properties relative to the input). An instance of a computational problem

13
14 Basic algorithmic number theory

is a specific input. The input size of an instance of a computational problem is the number
of bits required to represent the instance. The output size of an instance of a computational
problem is the number of bits necessary to represent the output. A decision problem is a
computational problem where the output is either “yes” or “no”. As an example, we give
one of the most important definitions in the book.

Definition 2.1.1 Let G be a group written in multiplicative notation. The discrete loga-
rithm problem (DLP) is: given g, h ∈ G find a, if it exists, such that h = g a .

In Definition 2.1.1 the input is a description of the group G together with the group
elements g and h and the output is a or the failure symbol ⊥ (to indicate that h ∈ g).
Typically, G is an algebraic group over a finite field and the order of g is assumed to be
known. We stress that an instance of the DLP, according to Definition 2.1.1, includes the
specification of G, g and h, so one must understand that they are all allowed to vary (note
that in many cryptographic applications one considers the group G and element g as being
fixed; we discuss this in Exercise 21.1.2). As explained in Section 2.1.2, a computational
problem should be defined with respect to an instance generator; in the absence of any
further information it is usual to assume that the instances are chosen uniformly from the
space of all possible inputs of a given size. In particular, for the DLP it is usual to denote
the order of g by r and to assume that h = g a where a is chosen uniformly in Z/rZ. The
output is the integer a (e.g., written in binary). The input size depends on the specific group
G and the method used to represent it. If h can take all values in g then one needs at least
log2 (r) bits to specify h from among the r possibilities. Hence, the input size is at least
log2 (r) bits. Similarly, if the output a is uniformly distributed in Z/rZ then the output size
is at least log2 (r) bits.
An algorithm to solve a computational problem is called deterministic if it does not
make use of any randomness. We will study the asymptotic complexity of deterministic
algorithms by counting the number of bit operations performed by the algorithm expressed
as a function of the input size. Upper bounds on the complexity are presented using “big
O” notation. When giving complexity estimates using big O notation we implicitly assume
that there is a countably infinite number of possible inputs to the algorithm.

Definition 2.1.2 Let f, g : N → R>0 . Write f = O(g) if there are c ∈ R>0 and N ∈ N
such that

f (n) ≤ cg(n)

for all n ≥ N.
Similarly, if f (n1 , . . . , nm ) and g(n1 , . . . , nm ) are functions from Nm to R>0 then we
write f = O(g) if there are c ∈ R>0 and N1 , . . . , Nm ∈ N such that f (n1 , . . . , nm ) ≤
cg(n1 , . . . , nm ) for all (n1 , . . . , nm ) ∈ Nm with ni ≥ Ni for all 1 ≤ i ≤ m.

Example 2.1.3 3n2 + 2n + 1 = O(n2 ), n + sin(n) = O(n), n100 + 2n = O(2n ),


log10 (n) = O(log(n)).
2.1 Algorithms and complexity 15

Exercise 2.1.4 Show that if f (n) = O(log(n)a ) and g(n) = O(log(n)b ) then (f +
g)(n) = f (n) + g(n) = O(log(n)max{a,b} ) and (fg)(n) = f (n)g(n) = O(log(n)a+b ). Show
that O(nc ) = O(2c log(n) ).

We also present the “little o”, “soft O”, “big Omega” and “big Theta” notation. These
will only ever be used in this book for functions of a single argument.

Definition 2.1.5 Let f, g : N → R>0 . Write f (n) = o(g(n)) if

lim f (n)/g(n) = 0.
n→∞

Write f (n) = Õ(g(n)) if there is some m ∈ N such that f (n) = O(g(n) log(g(n))m ). Write
f (n) = (g(n)) if g(n) = O(f (n)). Write f (n) = (g(n)) if f (n) = O(g(n)) and g(n) =
O(f (n)).

Exercise 2.1.6 Show that if g(n) = O(n) and f (n) = Õ(g(n)) then there is some m ∈ N
such that f (n) = O(n log(n)m ).

Definition 2.1.7 (Worst-case asymptotic complexity.) Let A be a deterministic algorithm


and let t(n) be a bound on the running time of A on every problem of input size n bits.

r A is polynomial-time if there is an integer k ∈ N such that t(n) = O(nk ).


r A is superpolynomial-time if t(n) = (nc ) for all c ∈ R>1 .
r A is exponential-time if there is a constant c2 > 1 such that t(n) = O(c2n ).
r A is subexponential-time if t(n) = O(cn ) for all c ∈ R>1 .

Exercise 2.1.8 Show that na log(log(n)) and na log(n) , for some a ∈ R>0 , are functions that are
(nc ) and O(cn ) for all c ∈ R>1 .

For more information about computational complexity, including the definitions of


complexity classes such as P and NP, see Chapters 2 to 4 of [539], Chapter 13 of [265],
Chapter 15 of [154], Chapter 7 of [509] or Chapter 34 of [136]. Definition 2.1.7 is for
uniform complexity, as a single algorithm A solves all problem instances. One can also
consider non-uniform complexity, where one has an algorithm A and, for each n ∈ N,
polynomially sized auxiliary input h(n) (the hint) such that if x is an n-bit instance of the
computational problem then A(x, h(n)) solves the instance. An alternative definition is a
sequence An of algorithms, one for each input size n ∈ N, and such that the description
of the algorithm is polynomially bounded. We stress that the hint is not required to be
efficiently computable. We refer to Section 4.6 of Talbot and Welsh [539] for details.
Complexity theory is an excellent tool for comparing algorithms, but one should always
be aware that the results can be misleading. For example, it can happen that there are several
algorithms to solve a computational problem and that the one with the best complexity is
slower than the others for the specific problem instance one is interested in (e.g., see
Remark 2.2.5).
16 Basic algorithmic number theory

2.1.1 Randomised algorithms


All our algorithms may be randomised, in the sense that they have access to a random
number generator. A deterministic algorithm should terminate after a finite number of
steps, but a randomised algorithm can run forever if an infinite sequence of “unlucky”
random choices is made.1 Also, a randomised algorithm may output an incorrect answer
for some choices of randomness. A Las Vegas algorithm is a randomised algorithm which,
if it terminates,2 outputs a correct solution to the problem. A randomised algorithm for a
decision problem is a Monte Carlo algorithm if it always terminates, and if the output
is “yes” then it is correct and if the output is “no” then it is correct with “noticeable”
probability (see the next section for a formal definition of noticeable success probability).
An example of a Las Vegas algorithm is choosing a random quadratic non-residue
modulo p by choosing random integers modulo p and computing the Legendre symbol
(see Exercise 2.4.6 in Section 2.4); the algorithm could be extremely unlucky forever. Of
course, there is a deterministic algorithm for this problem, but its complexity is worse than
the randomised algorithm. An example of a Monte Carlo algorithm is testing primality of
an integer N using the Miller–Rabin test (see Section 12.1.2). Many of the algorithms in
the book are randomised Monte Carlo or Las Vegas algorithms. We will often omit the
words “Las Vegas” or “Monte Carlo”.
Deterministic algorithms have a well-defined running time on any given problem
instance. For a randomised algorithm the running time for a fixed instance of the problem
is not necessarily well-defined. Instead, one considers the expected value of the running
time over all choices of the randomness. We usually consider worst-case complexity. The
worst-case complexity for input size n is the maximum, over all problem instances of size
n, of the expected running time of the algorithm. As always, when considering asymptotic
complexity it is necessary that the computational problem has a countably infinite number
of problem instances.
A randomised algorithm is expected polynomial-time if the worst case over all problem
instances of size n bits of the expected value of the running time is O(nc ) for some
c ∈ R>0 . (An expected polynomial-time algorithm can run longer than polynomial-time if
it makes many “unlucky” choices.) A randomised algorithm is expected exponential-time
(respectively, expected subexponential-time) if there exists c ∈ R>1 (respectively, for all
c ∈ R>1 ) such that the expected value of the running time on problem instances of size n
bits is O(cn ).
One can also consider average-case complexity, which is the average, over all problem
instances of size n, of the expected running time of the algorithm. Equivalently, the average-
case complexity is the expected number of bit operations of the algorithm where the

1
In algorithmic number theory it is traditional to allow algorithms that do not necessarily terminate, whereas in cryptography
it is traditional to consider algorithms whose running time is bounded (typically by a polynomial in the input size). Indeed, in
security reductions it is crucial that an adversary (i.e. randomised algorithm) always terminates. Hence, some of the definitions
in this section (e.g., Las Vegas algorithms) mainly arise in the algorithmic number theory literature.
2
An alternative definition is that a Las Vegas algorithm has finite expected running time, and outputs either a correct result or
the failure symbol ⊥.
2.1 Algorithms and complexity 17

expectation is taken over all problem instances of size n as well as all choices of the
randomness. For more details see Section 4.2 of Talbot and Welsh [539].

2.1.2 Success probability of a randomised algorithm


Throughout the book we give very simple definitions (like Definition 2.1.1) for compu-
tational problems. However, it is more subtle to define what it means for a randomised
algorithm A to solve a computational problem. A perfect algorithm is one where the
output is always correct (i.e., it always succeeds). We also consider algorithms that give the
correct answer only for some subset of the problem instances, or for all instances but only
with a certain probability.
The issue of whether an algorithm is successful is handled somewhat differently by
the two communities whose work is surveyed in this book. In the computational number
theory community, algorithms are expected to solve all problem instances with probability
of success close to 1. In the cryptography community, it is usual to consider algorithms that
only solve some noticeable (see Definition 2.1.10) proportion of problem instances, and
even then only with some noticeable probability. The motivation for the latter community is
that an algorithm to break a cryptosystem is considered devastating even if only a relatively
small proportion of ciphertexts are vulnerable to the attack. Two examples of attacks that
only apply to a small proportion of ciphertexts are the attack by Boneh, Joux and Nguyen
on textbook Elgamal (see Exercise 20.4.9) and the Desmedt–Odlyzko signature forgery
method (see Section 24.4.3).
We give general definitions for the success probability of an algorithm in this section,
but rarely use the formalism in our later discussion. Instead, for most of the book, we focus
on the case of algorithms that always succeed (or, at least, that succeed with probability
extremely close to 1). This choice allows shorter and simpler proofs of many facts. In any
case, for most computational problems the success probability can be increased by running
the algorithm repeatedly, see Section 2.1.4.
The success of an algorithm to solve a computational problem is defined with respect to
an instance generator, which is a randomised algorithm that takes as input κ ∈ N (often κ
is called the security parameter), runs in polynomial-time in the output size and outputs an
instance of the computational problem (or fails to generate an instance with some negligible
probability). The output is usually assumed to be (κ) bits,3 so “polynomial-time” in the
previous sentence means O(κ m ) bit operations for some m ∈ N. We give an example of an
instance generator for the DLP in Example 2.1.9.
Let A be a randomised algorithm that takes an input κ ∈ N. Write Sκ for the set of
possible outputs of A(κ). The output distribution of A on input κ is the distribution on Sκ
such that Pr(x) for x ∈ Sκ is the probability, over the random choices made by A, that the
output of A(κ) is x.

3
Hence, for problems related to RSA or factoring, κ is now assumed to be the bit-length of the modulus.
18 Basic algorithmic number theory

Example 2.1.9 Let a security parameter κ ∈ N be given. First, generate a random prime
number r such that 22κ < r < 22κ+1 (by choosing uniformly at random (2κ + 1)-bit integers
and testing each for primality). Next, try consecutive small integers k until p = kr + 1 is
prime. Then, choose a random integer 1 < u < p and set g = u(p−1)/r and repeat if g = 1.
It follows that g is a generator of a cyclic subgroup of G = F∗p of order r. Finally, choose
uniformly at random an integer 0 < a < r and set h = g a . Output (p, r, g, h), which can
be achieved using 3 log2 (p) + log2 (r) bits.
One sees that there are finitely many problem instances for a given value of the security
parameter κ, but infinitely many instances in total. The output distribution has (r, g, h)
uniform in the appropriate sets, but p is not uniform.

When considering an algorithm A to solve a computational problem we assume that A


has been customised for a particular instance generator. Hence, a problem might be easy
with respect to some instance generators and hard for others. Thus it makes no sense to
claim that “DLP is a hard problem”; instead, one should conjecture that DLP is hard for
certain instance generators.
We now define what is meant by the word negligible.

Definition 2.1.10 A function  : N → R>0 is negligible if for every polynomial p(x) ∈


R[x] there is some K ∈ N such that for all κ > K with p(κ) = 0 we have (κ) < 1/|p(κ)|.
A function  : N → R>0 is noticeable if there exists a polynomial p(x) ∈ R[x] and an
integer K such that (κ) > 1/|p(κ)| for all κ > K with p(κ) = 0.
Let [0, 1] = {x ∈ R : 0 ≤ x ≤ 1}. A function p : N → [0, 1] is overwhelming if 1 −
p(κ) is negligible.

Note that noticeable is not the logical negation of negligible. There are functions that
are neither negligible nor noticeable.

Example 2.1.11 The function (κ) = 1/2κ is negligible.

Exercise 2.1.12 Let f1 (κ) and f2 (κ) be negligible functions. Prove that f1 + f2 is a
negligible function and that p(κ)f1 (κ) is a negligible function for any polynomial p(x) ∈
R[x] such that p(x) > 0 for all sufficiently large x.

Definition 2.1.13 Let A be a randomised algorithm to solve instances of a computational


problem generated by a specific instance generator. The success probability of the algo-
rithm A is the function f : N → [0, 1] such that, for κ ∈ N, f (κ) is the probability that A
outputs the correct answer, where the probability is taken over the randomness used by A
and according to the output distribution of the instance generator on input κ. An algorithm
A with respect to an instance generator succeeds if its success probability is a noticeable
function.

Note that the success probability is taken over both the random choices made by A
and the distribution of problem instances. In particular, an algorithm that succeeds does
2.1 Algorithms and complexity 19

not necessarily solve a specific problem instance even when run repeatedly with different
random choices.
Example 2.1.14 Consider an algorithm A for the DLP with respect to the instance generator
of Example 2.1.9. Suppose A simply outputs an integer a chosen uniformly at random in
the range 0 < a < r. Since r > 22κ the probability that A is correct is 1/(r − 1) ≤ 1/22κ .
For any polynomial p(x) there are X, c ∈ R>0 and n ∈ N such that |p(x)| ≤ cx n for x ≥ X.
Similarly, there is some K ≥ X such that cK n ≤ 22K . Hence, the success probability of A
is negligible.
Certain decision problems (e.g., decision Diffie–Hellman) require an algorithm to behave
differently when given inputs drawn from different distributions on the same underlying
set. In this case, the success probability is not the right concept and one instead uses the
advantage. We refer to Definition 20.2.4 for an example.
Chapter 7 of Shoup [497] gives further discussion of randomised algorithms and success
probabilities.

2.1.3 Reductions
An oracle for a computational problem takes one unit of running time, independent of the
size of the instance, and returns an output. An oracle that always outputs a correct answer
is called a perfect oracle. One can consider oracles that only output a correct answer
with a certain noticeable probability (or advantage). For simplicity we usually assume that
oracles are perfect and leave the details in the general case as an exercise for the reader. We
sometimes use the word reliable for an oracle whose success probability is overwhelming
(i.e., success probability 1 −  where  is negligible) and unreliable for an oracle whose
success probability is small (but still noticeable).
Note that the behaviour of an oracle is only defined if its input is a valid instance of
the computational problem it solves. Similarly, the oracle performs with the stated success
probability only if it is given problem instances drawn with the correct distribution from
the set of all problem instances.
Definition 2.1.15 A reduction from problem A to problem B is a randomised algorithm
to solve problem A (running in expected polynomial-time and having noticeable success
probability) by making queries to an oracle (which succeeds with noticeable probability)
to solve problem B.
If there is a reduction from problem A to problem B then we write4
A ≤R B.
Theorem 2.1.16 Let A and B be computational problems such that A ≤R B. If there
is a polynomial-time randomised algorithm to solve B then there is a polynomial-time
randomised algorithm to solve A.
4
The subscript R denotes the word “reduction” and should also remind the reader that our reductions are randomised algorithms.
20 Basic algorithmic number theory

A reduction between problems A and B therefore explains that “if you can solve B then
you can solve A”. This means that solving A has been “reduced” to solving problem B and
we can infer that problem B is “at least as hard as” problem A or that problem A is “no
harder than” problem B.
Since oracle queries take one unit of running time and reductions are polynomial-time
algorithms, a reduction makes only polynomially many oracle queries.

Definition 2.1.17 If there is a reduction from A to B and a reduction from B to A then we


say that problems A and B are equivalent and write A ≡R B.

Some authors use the phrases polynomial-time reduction and polynomial-time equiv-
alent in place of reduction and equivalence. However, these terms have a technical meaning
in complexity theory that is different from reduction (see Section 34.3 of [136]). Defini-
tion 2.1.15 is closer to the notion of Turing reduction, except that we allow randomised
algorithms, whereas a Turing reduction is a deterministic algorithm. We abuse terminology
and define the terms subexponential-time reduction and exponential-time reduction by
relaxing the condition in Definition 2.1.15 that the algorithm be polynomial-time (these
terms are used in Section 21.4.3).

2.1.4 Random self-reducibility


There are two different ways that an algorithm or oracle can be unreliable. First, it may be
randomised and only output the correct answer with some probability; such a situation is
relatively easy to deal with by repeatedly running the algorithm/oracle on the same input.
The second situation, which is more difficult to handle, is when there is a subset of problem
instances for which the algorithm or oracle extremely rarely or never outputs the correct
solution; for this situation random self-reducibility is essential. We give a definition only
for the special case of computational problems in groups.

Definition 2.1.18 Let P be a computational problem for which every instance of the
problem is an n1 -tuple of elements of some cyclic group G of order r and such that the
solution is an n2 -tuple of elements of G together with an n3 -tuple of elements of Z/rZ
(where n2 or n3 may be zero).
The computational problem P is random self-reducible if there is a polynomial-time
algorithm that transforms an instance of the problem (with elements in a group G) into a
uniformly random instance of the problem (with elements in the same group G) such that
the solution to the original problem can be obtained in polynomial-time from the solution
to the new instance.

We stress that a random self-reduction of a computational problem in a group G gives


instances of the same computational problem in the same group. In general, there is no
way to use information about instances of a computational problem in a group G to solve
2.2 Integer operations 21

computational problems in G if G = G (unless perhaps G is a subgroup of G or vice


versa).

Lemma 2.1.19 Let G be a group and let g ∈ G have prime order r. Then the DLP in g
is random self-reducible.

Proof First, note that the DLP fits the framework of computational problems in Defini-
tion 2.1.18. Denote by X the set (g − {1}) × g. Let (g, h) ∈ X be an instance of the
DLP.
Choose 1 ≤ x < r and 0 ≤ y < r uniformly at random and consider the pair
(g x , hx g xy ) ∈ X . Every pair (g1 , g2 ) ∈ X arises in this way for exactly one pair (x, y).
Hence, we have produced a DLP instance uniformly at random.
If a is the solution to the new DLP instance, i.e. hx g xy = (g x )a , then the solution to the
original instance is

a − y (mod r).

This completes the proof. 

A useful feature of random self-reducible problems is that if A is an algorithm that solves


an instance of the problem in a group G with probability (or advantage)  then one can obtain
an algorithm A that repeatedly calls A and solves any instance in G of the problem with
overwhelming probability. This is called amplifying the success probability (or advantage).
An algorithm to transform an unreliable oracle into a reliable one is sometimes called a
self-corrector.

Lemma 2.1.20 Let g have prime order r and let G = g. Let A be an algorithm that solves
the DLP in G with probability at least  > 0. Let   > 0 and define n = log(1/  )/
(where log denotes the natural logarithm). Then there is an algorithm A that solves the
DLP in G with probability at least 1 −   . The running time of A is O(n log(r)) group
operations plus n times the running time of A.

Proof Run A on n random self-reduced versions of the original DLP. One convenient
feature of the DLP is that one can check whether a solution is correct (this takes O(log(r))
group operations for each guess for the DLP).

The probability that all n trials are incorrect is at most (1 − )n < (e− )log(1/ )/ =

elog( ) =   . Hence, A outputs the correct answer with probability at least 1 −   . 

2.2 Integer operations


We now begin our survey of efficient computer arithmetic. General references for this topic
are Section 9.1 of Crandall and Pomerance [150], Section 3.3 of Shoup [497], Section
4.3.1 of Knuth [308], Chapter 1 of Brent and Zimmermann [95] and von zur Gathen and
Gerhard [220].
22 Basic algorithmic number theory

Integers are represented as a sequence of binary words. Operations like add or multiply
may correspond to many bit or word operations. The length of an unsigned integer a
represented in binary is

log2 (a) + 1 if a = 0
len(a) =
1 if a = 0.

For a signed integer we define len(a) = len(|a|) + 1.


The complexity of algorithms manipulating integers depends on the length of the inte-
gers; hence, one should express the complexity in terms of the function len. However, it is
traditional to just use log2 or the natural logarithm log.

Exercise 2.2.1 Show that, for a ∈ N, len(a) = O(log(a)) and log(a) = O(len(a)).

Lemma 2.2.2 Let a, b ∈ Z be represented as a sequence of binary words.

1. It requires O(log(a)) bit operations to write a out in binary.


2. One can compute a ± b in O(max{log(a), log(b)}) bit operations.
3. One can compute ab in O(log(a) log(b)) bit operations.
4. Suppose |a| > |b|. One can compute q and r such that a = bq + r and 0 ≤ r < |b| in
O(log(b) log(q)) = O(log(b)(log(a) − log(b) + 1)) bit operations.

Proof Only the final statement is non-trivial. The school method of long division computes
q and r simultaneously and requires O(log(q) log(a)) bit operations. It is more efficient
to compute q first by considering only the most significant log2 (q) bits of a, and then to
compute r as a − bq. For more details see Section 4.3.1 of [308], Section 2.4 of [220] or
Section 3.3.4 of [497]. 

2.2.1 Faster integer multiplication


An important discovery is that it is possible to multiply integers more quickly than the
“school method”. General references for this subject include Section 9.5 of [150], Section
4.3.3 of [308], Section 3.5 of [497] and Section 1.3 of [95].
Karatsuba multiplication is based on the observation that one can compute (a0 +
2n a1 )(b0 + 2n b1 ), where a0 , a1 , b0 and b1 are n-bit integers, in three multiplications of
n-bit integers rather than four.

Exercise 2.2.3 Prove that the complexity of Karatsuba multiplication of n bit integers is
O(nlog2 (3) ) = O(n1.585 ) bit operations.
[Hint: Assume n is a power of 2.]

Toom–Cook multiplication is a generalisation of Karatsuba. Fix a value k and suppose


a = a0 + a1 2n + a2 22n + · · · ak 2kn and similarly for b. One can think of a and b as being
polynomials in x of degree k evaluated at 2n and we want to compute the product c = ab,
2.2 Integer operations 23

which is a polynomial of degree 2k in x evaluated at x = 2n . The idea is to compute the


coefficients of the polynomial c using polynomial interpolation and therefore to recover
c. The arithmetic is fast if the polynomials are evaluated at small integer values. Hence,
we compute c(1) = a(1)b(1), c(−1) = a(−1)b(−1), c(2) = a(2)b(2) etc. The complexity
of Toom–Cook multiplication for n-bit integers is O(nlogk+1 (2k+1) ) (e.g., when k = 3 the
complexity is O(n1.465 )). For more details see Section 9.5.1 of [150].

Exercise 2.2.4 Give an algorithm for Toom–Cook multiplication with k = 3.

Schönhage–Strassen multiplication multiplies n-bit integers in nearly linear time,


namely O(n log(n) log(log(n))) bit operations, using the fast Fourier transform (FFT).
The Fürer algorithm is slightly better. These algorithms are not currently used in the
implementation of RSA or discrete logarithm cryptosystems so we do not describe them
in this book. We refer to Sections 9.5.2 to 9.5.7 of [150], Chapter 8 of [220], Chapter 2 of
[95], [549] and Chapter 4 of [83] for details.

Remark 2.2.5 In practice, the “school” method is fastest for small numbers. The crossover
point (i.e., when Karatsuba becomes faster than the school method) depends on the word size
of the processor and many other issues, but seems to be for numbers of around 300–1000
bits (i.e., 90–300 digits) for most computing platforms. For a popular 32 bit processor,
Zimmermann [575] reports reports that Karatsuba beats the school method for integers
of 20 words (640 bits) and Toom–Cook with k = 3 beats Karatsuba at 77 words (2464
bits). Bentahar [40] reports crossovers of 23 words (i.e., about 700 bits) and 133 words
(approximately 4200 bits) respectively. The crossover point for the FFT methods is much
larger. Hence, for elliptic curve cryptography at current security levels the “school” method
is usually used, while for RSA cryptography the Karatsuba method is usually used.

Definition 2.2.6 Denote by M(n) the number of bit operations to perform a multiplication
of n bit integers.

For the remainder of the book we assume that M(n) = c1 n2 for some constant c1 when
talking about elliptic curve arithmetic, and that M(n) = c2 n1.585 for some constant c2 when
talking about RSA .

Applications of Newton’s method


Recall that if F : R → R is differentiable and if x0 is an approximation to a zero of F (x)
then one can efficiently get a very close approximation to the zero by running Newton’s
iteration

xn+1 = xn − F (xn )/F  (xn ).

Newton’s method has quadratic convergence, in general, so the precision of the approxi-
mation roughly doubles at each iteration.
24 Basic algorithmic number theory

It is beyond the scope of this book to give all applications of Newton’s method for fast
arithmetic. Instead, we briefly mention some complexity results.
First, one can use Newton’s method to compute rational approximations to 1/a ∈ Q of
the form b/2e . The complexity to get an approximation such that |1/a − b/2e | < 1/2m is
O(M(m)) bit operations. For details see Section 3.5 of [497] (especially Exercise 3.35),
Chapter 9 of [220] or, for a slightly different formulation, Section 9.2.2 of [150]. For
applications of this idea to efficient modular arithmetic see Section 2.5 or Section 10.5
of [16]; an important result is that one can compute a (mod b), where a and b are m-bit
integers, in O(M(m)) bit operations.
Another application is to compute integer roots of polynomials F (x) ∈ Z[x]. One uses
Newton’s method to find an approximation to a root x ∈ R, and then rounds to the nearest
integer. As a special case, integer square roots of m-bit numbers can be computed in
O(M(m)) bit operations. Similarly, other roots (such as cube roots) can be computed in
polynomial-time. It follows that one can test, in polynomial-time, whether an integer is a
perfect power (i.e., whether the integer is a m for some a, m ∈ N, m > 1).

Exercise 2.2.7 Show that if N = p e where p is prime and e ≥ 1 then one can factor N in
polynomial-time.

2.3 Euclid’s algorithm


For a, b ∈ N, Euclid’s algorithm computes d = gcd(a, b). A simple way to express Euclid’s
algorithm is by the recursive formula

gcd(a, 0) = a
gcd(a, b) =
gcd(b, a (mod b)) if b = 0.

The traditional approach is to work with positive integers a and b throughout the algorithm
and to choose a (mod b) to be in the set {0, 1, . . . , b − 1}. In practice, the algorithm can
be used with a, b ∈ Z and it runs faster if we choose remainders in the range {− |b|/2 +
1, . . . , −1, 0, 1, . . . , |b|/2 }. However, for some applications (especially, those related
to diophantine approximation) the version with positive remainders is the desired
choice.
In practice, we often want to compute integers (s, t) such that d = as + bt, in which
case we use the extended Euclidean algorithm (due to Lagrange). This is presented in
Algorithm 1, where the integers ri , si , ti always satisfy ri = si a + ti b.

Theorem 2.3.1 The complexity of Euclid’s algorithm is O(log(a) log(b)) bit operations.

Proof Each iteration of Euclid’s algorithm involves computing the quotient and remainder
of division of ri−2 by ri−1 where we may assume |ri−2 | > |ri−1 | (except maybe for i = 1).
2.3 Euclid’s algorithm 25

Algorithm 1 Extended Euclidean algorithm


Input: a, b ∈ Z
Output: d = gcd(a, b) and s, t ∈ Z such that d = sa + tb
1: r−1 = a, s−1 = 1, t−1 = 0
2: r0 = b, s0 = 0, t0 = 1
3: i = 0
4: while (ri = 0) do
5: i =i+1
6: find qi , ri ∈ Z such that −|ri−1 |/2 < ri ≤ |ri−1 |/2 and ri−2 = qi ri−1 + ri
7: si = si−2 − qi si−1
8: ti = ti−2 − qi ti−1
9: end while
10: return ri−1 , si−1 , ti−1

By Lemma 2.2.2 this requires ≤ c log(ri−1 )(log(ri−2 ) − log(ri−1 ) + 1) bit operations for
some constant c ∈ R>0 . Hence, the total running time is at most

c log(ri−1 )(log(ri−2 ) − log(ri−1 ) + 1).
i≥1

Rearranging terms gives



c log(r−1 ) log(r0 ) + c log(ri−1 )(1 + log(ri ) − log(ri−1 )).
i≥1

Now, 2|ri | ≤ |ri−1 | so 1 + log(ri ) ≤ log(ri−1 ); hence, all the terms in the above sum are
≤ 0. It follows that the algorithm performs O(log(a) log(b)) bit operations. 

Exercise 2.3.2 Show that the complexity of Algorithm 1 is still O(log(a) log(b)) bit oper-
ations even when the remainders in line 6 are chosen in the range 0 ≤ ri < ri−1 .

A more convenient method for fast computer implementation is the binary Euclidean
algorithm (originally due to Stein). This uses bit operations such as division by 2 rather
than taking general quotients; see Section 4.5.2 of [308], Section 4.7 of [21], Chapter 3
of [220], Section 9.4.1 of [150] or Section 14.4.3 of [376].
There are subquadratic versions of Euclid’s algorithm. One can compute the extended
gcd of two n-bit integers in O(M(n) log(n)) bit operations. We refer to Section 9.4 of [150],
[524] or Section 11.1 of [220].
The rest of the section gives some results about diophantine approximation that are used
later (e.g., in the Wiener attack on RSA, see Section 24.5.1). We assume that a, b > 0
and that the extended Euclidean algorithm with positive remainders is used to generate the
sequence of values (ri , si , ti ).
26 Basic algorithmic number theory

The integers si and ti arising from the extended Euclidean algorithm are equal, up to
sign, to the convergents of the continued fraction expansion of a/b. To be precise, if the
convergents of a/b are denoted hi /ki for i = 0, 1, . . . then, for i ≥ 1, si = (−1)i−1 ki−1 and
ti = (−1)i hi−1 . Therefore, the values (si , ti ) satisfy various equations, summarised below,
that will be used later in the book. We refer to Chapter 10 of [250] or Chapter 7 of [420]
for details on continued fractions.

Lemma 2.3.3 Let a, b ∈ N and let ri , si , ti ∈ Z be the triples generated by running Algo-
rithm 1 in the case of positive remainders 0 ≤ ri < ri−1 .

1. For i ≥ 1, |si | < |si+1 | and |ti | < |ti+1 |.


2. If a, b > 0 then ti > 0 when i ≥ 1 is even and ti < 0 when i is odd (and vice versa for
si ).
3. ti+1 si − ti si+1 = (−1)i+1 .
4. ri si−1 − ri−1 si = (−1)i b and ri ti−1 − ri−1 ti = (−1)i−1 a. In other words, ri |si−1 | +
ri−1 |si | = b and ri |ti−1 | + ri−1 |ti | = a.
5. |a/b + ti /si | ≤ 1/|si si+1 |.
6. |ri si | < |ri si+1 | ≤ |b| and |ri ti | < |ri ti+1 | ≤ |a|.
7. If s, t ∈ Z are such that |a/b + t/s| < 1/(2s 2 ) then (s, t) is (up to sign) one of the pairs
(si , ti ) computed by Euclid’s algorithm.
8. If r, s, t ∈ Z satisfy r = as + bt and |rs| < |b|/2 then (r, s, t) is (up to sign) one of the
triples (ri , si , ti ) computed by Euclid’s algorithm.

Proof Statements 1, 2 and 3 are proved using the relation si = (−1)i−1 ki−1 and
ti = (−1)i hi−1 where hi /ki are the continued fraction convergents to a/b. From Chap-
ter 10 of [250] and Chapter 7 of [420] one knows that hm = qm+1 hm−1 + hm−2 and
km = qm+1 km−1 + km−2 where qm+1 is the quotient in iteration m + 1 of Euclid’s algo-
rithm. The first statement follows immediately and the third statement follows from the fact
that hm km−1 − hm−1 km = (−1)m−1 . The second statement follows since a, b > 0 implies
hi , ki > 0.
Statement 4 can be proved by induction, using the fact that ri+1 si − ri si+1 = (ri−1 −
qi ri )si − ri (si−1 − qi si ) = −(ri si−1 − ri−1 si ). Statement 5 is the standard result (equa-
tion (10.7.7) of [250], Theorem 7.11 of [420]) that the convergents of a/b satisfy
|a/b − hm /km | < 1/|km km+1 |. Statement 6 follows directly from statements 2 and 4.
For example, a = ri (−1)i−1 ti + ri−1 (−1)i ti and both terms on the right-hand side are
positive.
Statement 7 is also a standard result in diophantine approximation; see Theorem 184 of
[250] or Theorem 7.14 of [420].
Finally, to prove statement 8 suppose r, s, t ∈ Z are such that r = as + bt and |rs| <
|b|/2. Then

|a/b + t/s| = |(as + bt)/bs| = |r|/|bs| = |rs|/|bs 2 | < 1/(2s 2 ).

The result follows from statement 7. 


2.4 Computing Legendre and Jacobi symbols 27

Example 2.3.4 The first few terms of Euclid’s algorithm on a = 513 and b = 311 give

i ri qi si ti |ri si | |ri ti |

−1 513 – 1 0 513 0
0 311 – 0 1 0 311
1 202 1 1 −1 202 202
2 109 1 −1 2 109 218
3 93 1 2 −3 186 279
4 16 1 −3 5 48 80
5 13 5 17 −28 221 364

One can verify that |ri si | ≤ |b| and |ri ti | ≤ |a|. Indeed, |ri si+1 | ≤ |b| and |ri ti+1 | ≤ |a|
as stated in part 6 of Lemma 2.3.3.

Diophantine approximation is the study of approximating real numbers by rationals.


Statement 7 in Lemma 2.3.3 is a special case of one of the famous results; namely,
that the “best” rational approximations to real numbers are given by the convergents in
their continued fraction expansion. Lemma 2.3.5 shows how the result can be relaxed
slightly, giving “less good” rational approximations in terms of convergents to continued
fractions.

Lemma 2.3.5 Let α ∈ R, c ∈ R>0 and let s, t ∈ N be such that |α − t/s| < c/s 2 . Then
(t, s) = (uhn+1 ± vhn , ukn+1 ± vkn ) for some n, u, v ∈ Z≥0 such that uv < 2c.

Proof See Theorem 1 and Remark 2 of Dujella [170]. 

2.4 Computing Legendre and Jacobi symbols


The Legendre symbol tells us when an integer is a square modulo p. It is a non-trivial group
homomorphism from (Z/pZ)∗ to the multiplicative group {−1, 1}.

Definition 2.4.1 Let p be an odd prime and a ∈ Z. The Legendre symbol ( pa ) is



  1 if x 2 ≡ a (mod p) has a solution
a
= 0 if p | a
p 
−1 otherwise.

If p is prime and a ∈ Z satisfies ( pa ) = 1 then a is a quadratic residue, while if ( pa ) = −1


then a is a quadratic non-residue.
28 Basic algorithmic number theory

Let n = i piei be odd. The Jacobi symbol is
 ei
a a
= .
n i
pi

A further generalisation is the Kronecker symbol ( an ), which allows n to be even. This


is defined in equation (25.4), which is the only place in the book that it is used.
Exercise 2.4.2 Show that if p is an odd prime then ( pa ) = 1 for exactly half the integers
1 ≤ a ≤ p − 1.
Theorem 2.4.3 Let n ∈ N be odd and a ∈ Z. The Legendre and Jacobi symbols satisfy the
following properties:
r ( an ) = ( a (mod n)
) and ( n1 ) = 1.
n
r (Euler’s criterion) If n is prime then ( an ) = a (n−1)/2 (mod n).
r (Multiplicative) ( ab ) = ( na )( nb ) for all a, b ∈ Z.
n
r ( −1 ) = (−1)(n−1)/2 . In other words
n
  
−1 1 if n ≡ 1 (mod 4)
=
n −1 otherwise.
r ( 2 ) = (−1)(n2 −1)/8 . In other words
n
  
2 1 if n ≡ 1, 7 (mod 8)
=
n −1 otherwise.
r (Quadratic reciprocity) Let n and m be odd integers with gcd(m, n) = 1. Then
n m
= (−1)(m−1)(n−1)/4 .
m n
In other words, ( mn ) = ( mn ) unless m ≡ n ≡ 3 (mod 4).
Proof See Section II.2 of [313], Sections 3.1, 3.2 and 3.3 of [420] or Chapter 6 of [250].

An important fact is that it is not necessary to factor integers to compute the Jacobi
symbol.
Exercise 2.4.4 Write down an algorithm to compute Legendre and Jacobi symbols using
quadratic reciprocity.
Exercise 2.4.5 Prove that the complexity of computing ( mn ) is O(log(m) log(n)) bit opera-
tions.
Exercise 2.4.6 Give a randomised algorithm to compute a quadratic non-residue modulo
p. What is the expected complexity of this algorithm?
Exercise 2.4.7 Several applications require knowing a quadratic non-residue modulo a
prime p. Prove that the values a in the following table satisfy ( pa ) = −1.
2.5 Modular arithmetic 29

p a

p ≡ 3 (mod 4) −1
p ≡ 1 (mod 4), p ≡ 2 (mod 3) 3

p ≡ 1 (mod 4), p ≡ 1 (mod 8) −1 √

p ≡ 1 (mod 8), p ≡ 1 (mod 16) (1 + −1)/ 2

Remark 2.4.8 The problem of computing quadratic non-residues has several algorith-
mic implications. One conjectures that the least quadratic non-residue modulo p is
O(log(p) log(log(p))).

Burgess proved that the least quadratic non-residue modulo p is
at most p1/(4 e)+o(1) ≈ p0.151633+o(1) , while Ankeny showed, assuming the extended Rie-
mann hypothesis, that it is O(log(p)2 ). We refer to Section 8.5 of Bach and Shallit [21]
for details and references. It follows that one can compute a quadratic non-residue in
O(log(p)4 ) bit operations, assuming the extended Riemann hypothesis.

Exercise 2.4.9 Give a Las Vegas algorithm to test whether a ∈ N is a square by computing
( pa ) for some random small primes p. What is the complexity of this algorithm?

Exercise 2.4.10 Let p be prime. In Section 2.8 we give algorithms to compute modular
exponentiation quickly. Compare the cost of computing ( pa ) using quadratic reciprocity
versus using Euler’s criterion.

Remark 2.4.11 An interesting computational problem (considered, for example, by


Damgård [152]) is: given a prime p, an integer k and the sequence ( pa ), ( a+1
p
), . . . , ( a+k−1
p
)
a+k
to output ( p ). A potentially harder problem is to determine a given the sequence of values.
It is known that if k is a little larger than log2 (p) then a is usually uniquely determined
modulo p and so both problems make sense. No efficient algorithms are known to solve
either of these problems. One can also consider the natural analogue for Jacobi symbols.
We refer to [152] for further details. This is also discussed as Conjecture 2.1 of Boneh and
Lipton [78].

Finally, we remark that one can compute the Legendre or Jacobi symbol of n-bit integers
in O(M(n) log(n)) operations using an analogue of fast algorithms for computing gcds. We
refer to Exercise 5.52 (also see pages 343–344) of Bach and Shallit [21] or Brent and
Zimmermann [96] for the details.

2.5 Modular arithmetic


In cryptography, modular arithmetic (i.e., arithmetic modulo n ∈ N) is a fundamental
building block. We represent elements of Z/nZ as integers from the set {0, 1, . . . , n − 1}.
We first summarise the complexity of standard “school” methods for modular arithmetic.
30 Basic algorithmic number theory

Lemma 2.5.1 Let a, b ∈ Z/nZ.


1. Computing a ± b (mod n) can be done in O(log(n)) bit operations.
2. Computing ab (mod n) can be done in O(log(n)2 ) bit operations.
3. Computing a −1 (mod n) can be done in O(log(n)2 ) bit operations.
4. For a ∈ Z, computing a (mod n) can be done in O(log(n)(log(a) − log(n) + 1)) bit
operations.

Montgomery multiplication
5
This method is useful when one needs to perform an operation such as a m (mod n) when
n is odd. It is based on the fact that arithmetic modulo 2s is easier than arithmetic modulo
n. Let R = 2s > n (where s is typically a multiple of the word size).
Definition 2.5.2 Let n ∈ N be odd and R = 2s > n. The Montgomery representation of
a ∈ (Z/nZ) is a = aR (mod n) such that 0 ≤ a < n.
To transform a into the Montgomery representation requires a standard modular mul-
tiplication. However, Lemma 2.5.3 shows that transforming back from the Montgomery
representation to standard representation may be performed more efficiently.
Lemma 2.5.3 (Montgomery reduction) Let n ∈ N be odd and R = 2s > n. Let n =
−n−1 (mod R) be such that 1 ≤ n < R. Let a be an element of (Z/nZ) in Mont-
gomery representation. Let u = an (mod R). Then w = (a + un)/R lies in Z and satisfies
w ≡ aR −1 (mod n).
Proof Write w = a + un. Clearly, w ≡ 0 (mod R) so w ∈ Z. Further, 0 ≤ w  ≤ (n −
1) + (R − 1)n = Rn − 1 and hence w < n. Finally, it is clear that w ≡ aR −1 (mod n).

The reason why this is efficient is that division by R is easy. The computation of n
is also easier than a general modular inversion (see Algorithm II.5 of [60]) and, in many
applications, it can be precomputed.
We now sketch the Montgomery multiplication algorithm. If a and b are in Mont-
gomery representation then we want to compute the Montgomery representation of ab,
which is abR −1 (mod n). Compute x = ab ∈ Z so that 0 ≤ x < n2 < nR, then compute
u = xn (mod R) and w = x + nu ∈ Z. As in Lemma 2.5.3, we have w  ≡ 0 (mod R) and
can compute w = w  /R. It follows that w ≡ abR −1 (mod n) and 0 ≤ w < 2n so ab is
either w or w − n.
Lemma 2.5.4 The complexity of the Montgomery multiplication modulo n is O(M(log(n)))
bit operations.
For further details see Section 9.2.1 of [150], Section II.1.4 of [60], Section 11.1.2.b
of [16] or Section 2.2.4 of [248].

5
Credited to Montgomery [391], but apparently a similar idea was used by Hensel.
2.6 Chinese remainder theorem 31

Faster modular reduction


Using Newton’s method to compute a/n one can compute a (mod n) using only mul-
tiplication of integers. If a = O(n2 ) then the complexity is O(M(log(n))). See Exercises
3.35, 3.36 of [497] and Section 9.1 of [220] for details. For large a, the cost of computing
a (mod n) remains O(log(a) log(n)) as before. This idea gives rise to Barret reduction; see
Section 9.2.2 of [150], Section 2.3.1 of [95], Section 14.3.3 of [376], Section II.1.3 of [60]
or Section 10.4.1 of [16].

Special moduli
For cryptography based on discrete logarithms, especially elliptic curve cryptography,
it is recommended to use primes of a special form to speed up arithmetic modulo p.
Commonly used primes are of the form p = 2k − c for some small c ∈ N or the NIST
primes p = 2nk w ± 2nk−1 w ± · · · ± 2n1 w ± 1 where w = 16, 32 or 64. In these cases, it is
possible to compute reduction modulo p much more quickly than for general p. See Section
2.2.6 of [248], Section 14.3.4 of [376] or Section 10.4.3 of [16] for examples and details.

Modular inversion
Suppose a, n ∈ N are such that gcd(a, n) = 1. One can compute a −1 (mod n) using the
extended Euclidean algorithm: computing integers s, t ∈ Z such that as + nt = 1 gives
a −1 ≡ s (mod n). Hence, if 0 < a < n then one can compute a −1 (mod n) in O(log(n)2 )
bit operations, or faster using subquadratic versions of the extended Euclidean algorithm.
In practice, modular inversion is significantly slower than modular multiplication. For
example, when implementing elliptic curve cryptography it is usual to assume that the cost
of an inversion in Fp is between 8 and 50 times slower than the cost of a multiplication in
Fp (the actual figure depends on the platform and algorithms used).

Simultaneous modular inversion


One can compute a1−1 −1
(mod n), . . . , am (mod n) with a single inversion modulo n and
a number of multiplications modulo n using a trick due to Montgomery. Namely, one
computes b = a1 · · · am (mod n), computes b−1 (mod n) and then recovers the individual
ai−1 .

Exercise 2.5.5 Give pseudocode for simultaneous modular inversion and show that it
requires one inversion and 3(m − 1) modular multiplications.

2.6 Chinese remainder theorem


The Chinese remainder theorem (CRT) states that if gcd(m1 , m2 ) = 1 then there is a unique
solution 0 ≤ x < m1 m2 to x ≡ ci (mod mi ) for i = 1, 2. Computing x can be done in
polynomial-time in various ways. One method is to use the formula

x = c1 + (c2 − c1 )(m−1
1 (mod m2 ))m1 .
32 Basic algorithmic number theory

This is a special case of Garner’s algorithm (see Section 14.5.2 of [376] or Section 10.6.4
of [16]).

Exercise 2.6.1 Suppose m1 < m2 and 0 ≤ ci < mi . What is the input size of the instance
of the CRT? What is the complexity of computing the solution?

Exercise 2.6.2 Let n > 2 and suppose coprime integers 2 ≤ m1 < · · · < mn and integers

c1 , . . . , cn such that 0 ≤ ci < mi for 1 ≤ i ≤ n are given. Let N = ni=1 mi . For 1 ≤ i ≤ n
define Ni = N/mi and ui = Ni−1 (mod mi ). Show that

n
x= ci ui Ni (2.1)
i=1

satisfies x ≡ ci (mod mi ) for all 1 ≤ i ≤ n.


Show that one can compute the integer x in equation (2.1) in O(n2 log(mn )2 ) bit opera-
tions.

Exercise 2.6.3 Show that a special case of Exercise 2.6.2 (which is recommended when
many computations are required for the same pair of moduli) is to precompute the integers
A = u1 N1 and B = u2 N2 so that x = c1 A + c2 B (mod N ).

Algorithm 10.22 of [220] gives an asymptotically fast CRT algorithm.

2.7 Linear algebra


Let A be an n × n matrix over a field k. One can perform Gaussian elimination to solve
the linear system Ax = b (or determine there are no solutions), to compute det(A) or to
compute A−1 in O(n3 ) field operations. When working over R a number of issues arise due
to rounding errors, but no such problems arise when working over finite fields. We refer to
Section 3.3 of Joux [283] for details.
A matrix is called sparse if almost all entries of each row are zero. To make this precise
one usually considers the asymptotic complexity of an algorithm on m × n matrices, as m
and/or n tends to infinity, and where the number of non-zero entries in each row is bounded
by O(log(n)) or O(log(m)).
One can compute the kernel (i.e., a vector x such that Ax = 0) of an n × n sparse
matrix A over a field in O(n2 ) field operations using the algorithms of Wiedemann [562]
or Lanczos [325]. We refer to Section 3.4 of [283] or Section 12.4 of [220] for details.

Hermite normal form


When working over a ring the Hermite normal form (HNF) is an important tool for solving
or simplifying systems of equations. Some properties of the Hermite normal form are
mentioned in Section A.11.
Algorithms to compute the HNF of a matrix are given in Section 2.4.2 of Cohen [127],
Hafner and McCurley [247], Section 3.3.3 of Joux [283], Algorithm 16.26 of von zur
2.8 Modular exponentiation 33

Gathen and Gerhard [220], Section 5.3 of Schrijver [478], Kannan and Bachem [297],
Storjohann and Labahn [533] and Micciancio and Warinschi [381]. Naive algorithms to
compute the HNF suffer from coefficient explosion, so computing the HNF efficiently in
practice, and determining the complexity of the algorithm, is non-trivial. One solution is
to work modulo the determinant (or a subdeterminant) of the matrix A (see Section 2.4.2
of [127], [247] or [533] for further details). Let A = (Ai,j ) be an n × m matrix over Z and
define A∞ = maxi,j {|Ai,j |}. The complexity of the HNF algorithm of Storjohann and
Labahn on A (using naive integer and matrix multiplication) is O(nm4 log(A∞ )2 ) bit
operations.
One can also use lattice reduction to compute the HNF of a matrix. For details see
page 74 of [478], Havas, Majewski and Matthews [254], or van der Kallen [294].

2.8 Modular exponentiation


Exponentiation modulo n can be performed in polynomial-time by the “square-and-
multiply” method. This method is presented in Algorithm 2; it is called a “left-to-right”
algorithm as it processes the bits of the exponent m starting with the most significant bits.
Algorithm 2 can be applied in any group, in which case the complexity is O(log(m)) times
the complexity of the group operation. In this section we give some basic techniques to
speed-up the algorithm; further tricks are described in Chapter 11.

Algorithm 2 Square-and-multiply algorithm for modular exponentiation


Input: g, n, m ∈ N
Output: b ≡ g m (mod n)
1: i = log2 (m) − 1
2: Write m in binary as (1mi . . . m1 m0 )2
3: b = g
4: while (i ≥ 0) do
5: b = b2 (mod n)
6: if mi = 1 then
7: b = bg (mod n)
8: end if
9: i =i−1
10: end while
11: return b

Lemma 2.8.1 The complexity of Algorithm 2 using naive modular arithmetic is


O(log(m) log(n)2 ) bit operations.

Exercise 2.8.2 Prove Lemma 2.8.1.

Lemma 2.8.3 If Montgomery multiplication (see Section 2.5) is used then the complexity
of Algorithm 2.5 is O(log(n)2 + log(m)M(log(n))).
34 Basic algorithmic number theory

Proof Convert g to Montgomery representation g in O(log(n)2 ) bit operations. Algo-


rithm 2 then proceeds using Montgomery multiplication in lines 5 and 7, which requires
O(log(m)M(log(n))) bit operations. Finally, Montgomery reduction is used to convert the
output to standard form. 

The algorithm using Montgomery multiplication is usually better than the naive version,
especially when fast multiplication is available. An application of the above algorithm,
where Karatsuba multiplication would be appropriate, is RSA decryption (either the stan-
dard method, or using the CRT). Since log(m) = (log(n)) in this case, decryption requires
O(log(n)2.585 ) bit operations.

Corollary 2.8.4 One can compute the Legendre symbol ( pa ) using Euler’s criterion in
O(log(p)M(log(p))) bit operations.

When storage for precomputed group elements is available there are many ways to speed
up exponentiation. These methods are particularly appropriate when many exponentiations
of a fixed element g are required. The methods fall naturally into two types: those that reduce
the number of squarings in Algorithm 2 and those that reduce the number of multiplications.
i
An extreme example of the first type is to precompute and store ui = g 2 (mod n) for 2 ≤
i ≤ log(n). Given 2l ≤ m < 2l+1 with binary expansion (1ml−1 . . . m1 m0 )2 one computes
l
i=0:mi =1 ui (mod n). Obviously, this method is not more efficient than Algorithm 2 if g
varies. An example of the second type is sliding window methods that we now briefly
describe. Note that there is a simpler but less efficient “non-sliding” window method, also
called the 2k -ary method, which can be found in many books. Sliding window methods can
be useful even in the case where g varies (e.g., Algorithm 3 below).
Given a window length w one precomputes ui = g i (mod n) for all odd integers 1 ≤
i < 2w . Then one runs a variant of Algorithm 2 where w (or more) squarings are performed
followed by one multiplication corresponding to a w-bit substring of the binary expansion
of m that corresponds to an odd integer. One subtlety is that algorithms based on the “square-
and-multiply” idea and which use precomputation must parse the exponent starting with
the most significant bits (i.e., from left to right), whereas to work out sliding windows one
needs to parse the exponent from the least significant bits (i.e., right to left).

Example 2.8.5 Let w = 2 so that one precomputes u1 = g and u3 = g 3 . Suppose m has


binary expansion (10011011)2 . By parsing the binary expansion starting with the least
significant bits, one obtains the representation 10003003 (we stress that this is still a
representation in base 2). One then performs the usual square-and-multiply algorithm by
parsing the exponent from left to right; the steps of the sliding window algorithm are
(omitting the (mod n) notation)

b = u1 , b = b2 ; b = b2 , b = b2 , b = b2 , b = bu3 , b = b2 , b = b2 , b = b2 , b = bu3 .

Exercise 2.8.6 Write pseudocode for the sliding window method. Show that the precom-
putation stage requires one squaring and 2w−1 − 1 multiplications.
Another Random Document on
Scribd Without Any Related Topics
– Biz az furcsa, János gazda.
– Már ha én vitézlő uramnak volnék, én meg nem állhatnám,
hogy félre ne térjek egy kicsinyt Majosfalvára; nem sok időre, csak
úgy egy órára, vagy mi.
– De hisz az elébb mondtad magad, hogy a fejedelem meg talál
haragudni érte.
(Még akkor nem tudtam, gondolá magában János, hogy olasz
inas került a házhoz.)
– Hiszen nem fogja azt megtudni. Majd olyan szépen letérünk az
útról, hogy senki sem veszi észre, s mégis elébb ott leszünk, mint a
fejedelem várna.
– Majd meglássuk.
Ez órától fogva János sokkal nyugtalanabb volt, mint gazdája,
elhagyta álom és étvágy.
Hetednapra érkezett vissza a székely futár, kinek a fejedelmet
Radnóthon kellett fölkeresni, s mint Paskó előre látta, vele együtt jött
a fejedelemnek is egy hadnagya, parancsul adva a vesztegzár-
őröknek, hogy követét kivételképen bocsássák szabadon, a mi
legottan meg is történt.
Pihenés nélkül hajtatott a megszabadult Paskó előre. A mellé
adott hadnagy nem birt vele érni, s még fele úton kidűlt. Csupán
János gazda győzte ki az éjen-napon keresztül folytatott sietséget, s
úgy segített a váltott lovakat befogni, s az ostort elnyűni rajtok,
mintha neki még több oka volna a sietségre, mint urának.
VIII. MEGLEPETÉSEK.
Úgy történt.
A mint az országútról a jegenyékkel beszegett út túl Szebenen
letér, a Paskót vivő szekér egyszerre elhagyta a főútat, s mire
Paskónak eszébe jutott volna tiltakozni, már közelebb jártak
Majosfalvához, mint az országúthoz, s azután nem volt kedve
visszatérni.
János gazda az első hírhallásra jobbnak hitte, hogy ura ne
érkezzék hamarább haza, mint megérkeztének híre; de az olasz
lokajróli hallomás egyszerre kiölt minden keresztyéni és felebaráti
érzelmet szivében, most már azt kivánta, hogy bár minél nagyobb
iszonyatra jutnának haza s lenne ölés, gyilkolás a házban.
A mint a falu alá értek, hegedűszó kezdé fülelő érzékeit ütögetni,
melyre meg nem állhatta, hogy vissza ne forduljon a bakról, urához
szólva:
– Hallja csak, vitézlő uram, hogy megbúsulnak rajtunk itthon!
Paskó mosolygott.
– Hát csak nem kivánod, hogy az egész világ minket gyászoljon,
s még a korcsmákban is megtiltsák a hegedülést, mint a
nagyszebeniek tették, mikor a küldöttségöket Apafi Mihály uram
megnádpálczázta?
– Kocsmákban? kérdé János, nagy szemeket meresztve.
– Igen, igen. Mert hisz itt a faluvégi csapszékben hegedülnek.
– Igaz biz az; monda János, most az egyszer nagyon felsülve.
Néhány percz mulva a kastély udvarára robogott a hintó. János
minden ablakon egy megriasztott lovagot várt kiugrófélben látni s
minden ajtóból egy tarkabarka olasz lokajt lesett; mindezek helyett
az úrnő maga állt az erkélyen egyedül, s férjét meglátva, lefutott
eléje, úgy, a hogy őt Paskó képzelé magának: frissen, kedvesen,
kedélyesen nyakába borult az érkezőnek s csókjaival halmozta el,
ezer örvendetes kérdést intéze hozzá, s magánkivül volt örömében.
János gazda megszégyenülve csókolt neki kezet.
A boldog férj, szép nejét átölelve, termeibe távozott.
Csak egy órát igért magának az otthonlételre, s ez alatt mennyi
mondani valója volt neki, s mennyi érezni valója szivének!
választhat-e az ajk csók és beszéd között, midőn hosszú távollét
után egy rövid órára van bizva minden boldogsága?
A nő nyakában csüggött, mellette ülve a kereveten s szerelmes
tekintettel nézett szemeibe. Sohasem volt oly szép, mint most.
– Szólj és ne kérdezz; miért maradtál oly sokáig távol? miért nem
izentél? álmodni, nyugtalankodni hagytál magad miatt, egy szóval
sem tudósítva jó vagy balsorsod felől.
– Oh, kedves nőm, borzalmas útakon jártam én. Ha Isten keze
nem ótalmaz, százszor is ott lehetett volna vesznem. Igazad volt,
midőn nem akartál velem jőni. Hányszor gondoltam a
szorongattatások óráiban borzalommal arra, ha te is velem volnál! s
vigasztalt az a gondolat, hogy te ekkor nyugodtan alszol csendes
hajlékunkban s nem tudsz semmit azon rémekből, a mik engemet
környeznek.
– Rosszul gondolád. Én minden éjjel vérpaddal, viharral,
tengervészszel álmodtam, ott látva téged. Tengeri kalózok üldöztek,
s te futottál előlök idegen partok felé.
– Lám, minő csodák vannak a természetben: míg te vérpadon,
viharos tengeren láttál engem, én valóban ott voltam. Stambulba
érve, le akartak fejezni rögtön, s csupán Kucsuk basa közbenjárása
mentett meg a haláltól; a nagyvezér, kinek pártfogására
számítottam, épen akkor Candia szigetének ostromán volt a
velenczések ellen; utána kellett mennem, hogy az ország szomorú
ügyeit elintézzem vele. Tudod, hogy soha sem voltam még tengeren,
s a mint ekkor életemben először hajóra szálltam, hogy Candiába
vitorlázzak, valami kimondhatlan szorongás fogta el érzékeimet;
testem, lelkem tehetetlenné vált, s oly oktalan halálos aggodalom
fogott el, mintha soha sem kellene többet a szárazföldet látnom. Alig
tünt el szemeim elől a part, mielőtt a másikat megláthattam volna,
egyszerre nagy vitorlák tünnek elő a láthatáron s egyenesen felénk
tartanak; a török gálya hajósai, mely engem szállított, erre rémülten
kezdtek kiáltozni: «a velenczések, a velenczei hajók!» s felhúzva
minden vitorláikat, hanyatthomlok kezdtek előlök rohanni, mint a kit
veszteni visznek. Amazok üldözőbe vettek bennünket s a mi gályánk,
bár mint erőtettük is, mindig közelebb kezde jutni az üldözőkéhez,
kik szüntelen ott czirkáltak Candia körül, s minden török hajót
elfogtak, a mi arrafelé tartott, s számot sem véve a rajtok levő
emberekről, rendesen el szokták azokat sülyeszteni. Nekünk is így
kellett volna járnunk, mert miután hat óra hosszat futottunk előlük,
dél felé szélcsend kezde lenni, úgy hogy mind mi, mind üldözőink
megálltunk a tenger közepén, csak olyankor tehetve egy-egy ugrást,
midőn egy elsikamló szellő vitorláinkba kapott. A török nép ordítva
hányta magát arczra, szelekért könyörögve Istenéhez; este felé
megsokallta a próféta hívei rimánkodását, s küld ránk egy olyan
zivatart, hogy egy pillanatban a tenger fenekére vetett, másikban a
felhők közé hajított bennünket a hullám. Árboczaink, vitorláink
összetörtek, hajónk minden eresztékeiben recsegett-ropogott, hogy
azt hittem, szerteszét fog menni. A hullám keresztül csapkodott
rajtunk, kioltva minden tüzet a hajón s facsaróvá áztatva
mindnyájunkat. Hajh, mennyiszer áldottam magamban a mi jó sáros
országútainkat, nem repül azokon a szekér! Három napig hányt-
vetett bennünket a zivatar, mennykőhullás, felhőszakadás közt, nem
világította a nap az eget, csak a villám; hallottuk sokszor a hullám
ordítását, a mint a tengerből kiálló fekete sziklához csapódott s Isten
őrzött, hogy ott nem vesztünk mi is. Negyednapra tisztult fel csak az
ég felettünk; üldözőink hajóhadát is szétszórta ugyan a vihar, de
minket is egész az egyiptomi partokig elvert. Ott kénytelenek voltunk
hátrahagyni megroncsolt gályánkat s tizenkét napig bujdostunk
ellenkező szelekkel küzdve egy korhadt dereglyén, míg Chous és
Cyprus szigeteket érintve, Candiába eljutottunk.
– Szegény, szegény férjem… szólt Berta, síma kezeivel hizelgőleg
czirógatva végig férje arczát, s lecsókolva homlokáról a barázdákat,
miket a viszontagságok emléke arra vont. De úgy hiszem, nem jártál
hiába, s ezen utad reménylem utolsó volt Törökországba?
– Jó gyermekem, utolsó utam az lesz, a mikor ott marasztanak, s
mind e küzdéssel nem nyertem egyebet, mint egy rövid hónapot a
készülésre, egy hónap mulva ismét ott lesz az ország, a hol elébb.
– Hogy érted ezt?
– Országos gondok, gyermekem, mik csak untatni fognak.
– De ha én szeretném azokat ismerni.
– A szultánt arra kértük, hogy vagy engedjen el az adóból annyit,
mennyit Haly basa falvainkból beszed, vagy tiltsa el azt attól. Erre ily
különös választ nyertünk a divántól: hogy ám szedjük be mi is az
adót azon falvakból, mik a váradi basa keze ügyébe esnek, a többit
pedig engedjük a török basáktól beszedetni Erdélyben, azután ne
legyen többet gondunk az adófizetésre.13)
– Nos? hisz ez nagyon jól van. Így leráztátok a gondot
vállaitokról.
– Látod, hogy nem érted! Mi, Erdélyország rendei, mi, szabad
egyesült hármas nemzet, megengedjük, hogy török-tatár hajtsa
végre határozatait országunkban! Inkább fizetünk két annyit! Fejünk
meghajol hatalma előtt, de orczánk meg nem pirul, uraljuk, de nem
szolgáljuk!
A szelid ember egészen tűzbe, indulatba jött, ezeket mondva.

É
– Hisz azért ne légy haragos, csitítá őt mosolyogva a hölgy. Én nő
vagyok, nem látok oly mélyen ez ügyekbe. Mit fog tehát tenni a
fejedelem?
– Ki fogja fizetni az adót egy hónap alatt az utolsó fillérig, s
többet meg nem alázza magát, hogy kérjen ott, a hol kigúnyolják
kérelmét. Adtunk török uramnak kardcsapásokat is, a maga
idejében, tudunk adni pénzt is s nem halunk bele.
A csendesvérű embert ez egyetlen gondolat volt képes hőssé
varázsolni. Ilyenkor ő bátor, lelkesült, vakmerő volt – még
feleségével szemben is. Azt gondolta, most is a török szultán előtt
áll.
– Igen, kedvesem, de ha a fejedelem nem szedheti be a falvakból
az adót, honnan kerül elő annyi tömérdek pénz?
– A föld alól, ha nincsen másutt! De lesz. Fizetni fognak a
szabadalmas városok. Fizetni fog a nemesség, a főurak, én is, más
is. A becsület több, mint néhány ezer tallér… Most jut eszembe: nem
izent valamit Thúri László, míg oda voltam?
– De igen. Azt izené, hogy felmondott tőkepénzedből ötezer
arany mindenkor rendelkezésedre áll. Képzelheted, minő örömem
volt rajta. Rég fáj a szívem egy oly függő hintóért, minő Bánfi
Dénesnének van, s a multkor Teleki Mihály ötvöse gyönyörű ezüst
tálakat aranyozott, mik nekem úgy megtetszettek.
– Édesem, szólt Paskó, ki lelkének azon egyetlen gondolatjában
volt erős, mely a közügyeket érdeklé; tégy le örömeidről, mert a
felmondott ötezer aranyból nem fog telni sem függő hintóra, sem
ezüst tálakra. Az másra van szánva.
– Talán épen az adófizetésre? Monda Berta kegyetlen
ajkpittyesztéssel.
– Úgy van, szólt szárazon Paskó, s azzal felkölt neje mellől s
indult kifelé.
– Hová készülsz? kérdé a nő, visszatartva férjét kezénél fogva.
Egy órája hogy megjöttél s már elhagysz. No maradj. Nem fogok
országos dolgokról kérdezősködni többé. Látom, hogy olyankor
kedvetlen vagy.
Paskó erre elővonta zsebéből nagy gömbölyű, zafirokkal kirakott
óráját s megnézve rajta az időt, aggódva mondá:
– Sietnem kell Fehérvárra, a fejedelem tudja, hogy útban vagyok
s neheztelni fog, ha itthon töltöm az időt.
– Ne siess oly nagyon, maradj legalább ebéden itthon, hisz a
fejedelem sem kivánja, hogy az útban ne ebédelj; ha most elindulsz,
őt is épen asztalnál kapod s tudod, hogy olyankor mint haragszik, ha
háborítják. Ne készülj hát, a rossz hír úgyis elég jókor jön, ha nem
siet is.
Paskó mentegetőzni akart.
– Nem csupán e végett van a sietségem, hanem egy különös ügy
van lelkemre kötve a szultántól, melynél a legkisebb halogatás nagy
bajt okozhat.
– Minő ügy az? kérdé Berta, úgy belekapcsolva magát férje
nyakába, hogy az nem mozdulhatott tőle.
– Lásd: az imént fogadtad, hogy nem fogsz kérdezősködni tőlem.
– Nem országos titokról, de te magad mondád, hogy ez
magányos ügy.
– De rám bízott titok, a mit senkinek sem szabad
megmondanom.
– Hát idegen vagyok-e én? Hát van nekem titkom te előtted? Te
engem megvetsz, lenézesz; oh ezt nem érdemeltem.
Paskó, látván, hogy neje elszomorodott, – egészen ellágyult.
– Minő bohó vagy te! pedig oly érdektelennek fogod találni az
egész esetet, ha megmondom.
– Mindegy; engemet nyugtalanít az, hogy te titkolózol.
– Az egész dolog annyiból áll, hogy egy magyar nemes, kit a
tatárok elfogtak, a fogságból egy rabtársát haza küldte, hogy az
vagyonait eladva, őt váltsa ki, s azon ember nemhogy kiváltotta
volna jóltevőjét, hanem gyermekeit elűzte jószágukból s azt, mint
megürültet, elkérte a fejedelemtől. Most azonban a fogságában
nyomorultul eléktelenített férfi Kucsuk basa által kiszabadíttatva,
ugyane török úr közbenjártára a divánhoz folyamodott, hogy őt
igazaiba visszasegítse s erre adott nekem a szultán titkos utasítást a
fejedelemhez, hogy azon embert rögtön vasraverve, küldje fel
Stambulba a nagyúr elé.
– Hogy hívják azon férfit?
– De hát mi szükség azt tudnod?
– Csak, hogy ismerem-e?
– Biztosítlak, hogy hírét sem hallottad soha: Pozsgai Ferencz.
Ha Paskó e pillanatban felesége arczára tekintett volna, látandá,
mint elváltozott annak színe; de a másik pillanatban újra mosolygóvá
lett az, a hölgy elővette minden bűbájos hatalmát a női csábnak,
hizelgés, rábeszélés által annyira birta férjét, hogy még egy kis órát
engedve magának, otthon maradt családi körében, átengedve magát
rég nem élvezett örömeinek.
De ez óra alatt sem az ízletes étel, sem a gondűző bor, sem a
mosolygó hölgy csókja nem esett jól neki, valami titkos gondolat
megmérgezte minden örömét, szüntelen azt súgva lelkébe, hogy
nem jól cselekszik, a midőn hivatalos kötelességét meglopja, hogy
otthon egyék, igyék s feleségét ölelgesse!…
János gazda ez idő alatt össze-vissza járt minden szobát,
tornáczot, pitvart, mint az ordító oroszlán, keresve, hogy kit egyen
meg?
Csak egy akkora olasz lokajt talált volna, mint a kis ujjam, vagy
csak legalább egy czipőt, egy harisnyát belőle! Sehol semmi nyoma.
A cselédségtől nem akart kérdezősködni, nehogy azt gondolják,
mintha őt ez az ember érdekelné; azok pedig úgy látszott, azért nem
szólnak neki, hogy el ne rontsák a meglepetést.
A mint ekként bujdosnék szobából konyhába, konyhából pitvarba,
egyszerre felpattan egy ajtó, melyet ő is akkor készült kinyitni, s
szinte orron üté a jó János gazdát.
– Che bestia! kiáltá a szemközt jövő, még neki állván feljebb,
hogy az ajtóval megütötte collegáját. János gazda is pedig nem vala
rest, hanem mintha tévedésből tenné, olyat hágott a sarkantyús
csizmájával az ellenség tyúkszemére, hogy ez majd a padlásig ugrott
kínjában, s azzal bevágta rá az ajtót, s csak úgy szidták egymást zárt
ajtón keresztül, egyik olaszul, másik magyarul.
Ez volt az első összeütközés a két érdemes férfiu között.
Innen dúlfúlva haragjában, lement János a konyhába, a hol a
cselédek számára szoktak főzni, elkülönítve az úri konyhától, s
szokása szerint odament a tűzhelyhez, melyben lánczra akasztva
fortyogott egy nagy réz üstben valami; azt a bennlevő kanállal
megkeveré, s nem ismerve rá sem színéről, sem szagáról,
kérdezősködve fordult az egybegyűlt kukta, béres és szolgáló
néphez:
– Mi ez?
– Hát hal, meg hús, meg gyömbér, sárgarépa, tatárka,
földimogyoró, aprószőlő, kenyérmorzsa, meg paradicsomalma.
– Üm. Jó lehet ez. Ettem én ennél furcsábbakat is
Törökországban. Hát ki tanított benneteket erre?
– Nem látta még kend? nem találkozott vele?
– Nem én, fiaim, senkivel ezen a földön. Felelt János farizeus
pofával.
A cselédek összenevettek s integettek egymásnak, hogy senki se
szóljon.
– Hát aztán ebből esztek ti valamennyien?
– Igen ám; még akkor is csak az kap belőle, a ki a nevét ki tudja
mondani.
– Hát hogy híják?
– Olla potrida.
– Olla potrida? Könnyű azt megtanulni, hát miért ne tanulnók
meg?
Ezzel a szóval kivéve a főzőkanalat az üstből, műértő képpel
néhány cseppet meríte rá a kérdéses főzeményből, s megkóstolá
szakértő arczfintorgatással.
– Valamit kifelejtettek ebből… A bizony… Nincs megadva a sava
borsa… Tudom már… Hozzatok egy kis paprikát.
S azzal belerántott két tele kanál jó piros török borsot az olla
potridába János, s befedve azt a fedővel, hagyta főni és leült maga
egy szegletbe, mint a ki semmit sem vétett.
A cselédek lakatot vetettek a szájukra, nem akarván elrontani a
mulatságot, melyet János és Gondolfo (így hítták a legényt) legelső
találkozása okozni fog nekik. Azt János arcza el nem árulá, hogy már
a találkozás megtörtént.
Nemsokára ebédre csengettek. Begyülekezett az egész
cselédség, körülülték a hosszú keresztlábú asztalt, tudtára adván
Jánosnak, hogy az első hely, mely máskor őt szokta illetni, most
magasabb rangú egyéniség számára van felhagyva.
– Elülök én akárhol, szólt jámborul János, s mindenki bámulatára,
csendes vérrel húzta meg magát a pad végén, saját maga faragta
karosszékét, melynek támasza annyi idő óta az ő dolmányától volt
fényes, átengedve másnak.
Végre belépett a várt egyéniség, feltett sipkával s felsőbbséget
éreztető tekintettel leült az asztalhoz, s míg a többiek ájtatosan
felkelve, leszedett süveggel mondták el az asztaláldást János gazda
után, az alatt ő egy szép marsot dobolt el a czintányérján egy késsel
és egy villával.
Ezzel leemelték az üstöt a lánczról s feltették az asztal közepére.
Gondolfo levevé róla a fedőt s gyanúsan szaglálta a kiszabadult
párát, mely között idegen elemeket kezde sejteni; csak miután a
nagy merőkanállal megforgatta annak tartalmát egynéhányszor s
meggyőződött róla, hogy minden benne van és semmi azon kívül,
kezdett magának kimerni egy jó tele tányérral, gyönyörködve annak
czinoberszínű levében s tulajdonítva azt egyedül a
paradicsomalmának.
De mégis pihenteté addig étvágyát, a míg a többiek is szedtek
maguknak, mert ilyenkor azon különös gyönyörűsége jutott, hogy
elébb jól kimulatta magát a cselédség arczfintorgatásain, kik nyögve
nyelték az ő kedvencz eledelét, s szidni szokták miatta, de a mit ő
mind nem értett.
Most az egyszer azonban nagy meglepetéssel tapasztalá, hogy a
cselédség rendkívül vidáman fogyasztja az ételt, s a mire legjobban
számolt, János gazda nem piszkolja az ebédet, sőt inkább igen is
mohón fogyasztja azt, dicsérve szemhunyorgatással szomszédjai
előtt. Igaz ugyan, hogy csak a húsát válogatta.
– Hozzá szoktak a jóhoz, a pimaszok; gondolá magában
Gondolfo, kinek asszonya szabadságot adott azt főzetni az egész
cselédségnek, a mi neki ízlik; s azzal ő is megmeríté kanalát az
aranyos lében s beönté szájába.
Hah! hogy ugrott fel székéről egyszerre düh és rémület miatt,
hogy csapta a földhöz a kanalat és ordított, mint a kit égetnek, és
beszélt idegen nyelvű szavakat, kezével hadonázva, a sipkáját
összetépve mérgében.
János gazda azt gondolá, hogy a sok szóra felelni kell valamit, s
látva, hogy az ember mindnyájokhoz beszél s valamit kérdezni
látszik, azt gondolá bölcsen, hogy a lokaj nem kérdezhet egyebet,
mint hogy ki tette a paprikát és vereshagymát a poutpourri közé? ő
tehát nyugodt lélekkel magára mutatott és monda szép csendesen:
«magam la».
Erre Gondolfo felkapta a tányérját s levesestől úgy vágta
Jánoshoz, hogy a hátán csorgott végig a leve.
De Jánosnak sem kellett több! nosza felugrott a lóczáról s
megragadva a lokaj tarkóját, lenyomta annak fejét az asztalra, bele
egyenesen a leveses tálba s beleverte annak orrát, száját emberül.
– Nesze! főzted; – egyed!
E csetepaté közepett megnyílik az ajtó, s maga Berta asszony lép
be a cselédházba.
– Mi történik itt? kérdé, meglátva a tusakodást.
János elereszté erre Gondolfót, s letörölgetve magáról a levest,
nagy nyugodtan felelt:
– Főzni tanítjuk egymást.
– Kend vén iszákos semmirevaló, még ma elhagyja a kastélyt!
kiálta rá hevesen az asszony.
– Tudom, a gazdámmal megyek.
– És többet a kastély küszöbét át nem fogja lépni.
– Az is megeshetik, nagyasszonyom; felelt János.
Berta erre hevesen kezde Gondolfóhoz olaszul beszélni, melyből
János bárhogy mereszté rájok szemeit, egy szót sem birt kitalálni,
csupán annyit hallott, hogy «Principé»-t sokat emlegették s annyit
már tudott, hogy princeps-nek Erdélyben Apafi Mihályt hívják.
«Már hiszen, gondolta magában, ha a fejedelemnek adnak fel, én
ott sem leszek más, mint a ki vagyok.»
Gondolfo, megértve asszonya szavait, rögtön paripát hozatott elő,
s felülve rá, elnyargalt; még pedig nem a főkapun, hanem az angol
kerten keresztül. Berta asszony férjéhez sietett vissza.
***
Fél óra mulva útban volt Paskó. Valami nyugtalanságot vitt
magával szívében. Oly különös megmagyarázhatlan érzelem lopózott
lelkébe. Alig várta, hogy Fehérvártt legyen s gondjai egy részét
lerakhassa.
Már késő éjszaka volt, midőn megérkezék. Mégis rögtön sietett a
fejedelmi palotába, gondolva, hogy tán Teleki Mihályt még ébren
találja, ki néha reggelig szokott dolgozni szobájában.
A kapuőrök azonban nem akarták bebocsátani a késői órában,
mire ő megmondva nevét az udvarnoknak, kérte, hogy menjen fel
Telekihez, és jelentse be, ha elfogadja-e?
Az udvarnok nemsokára visszajött két alabárdossal s felvezeté a
követ urat, kit János gazda nyomban kisért, utána hordva a nagy
nyaláb írást, melyre szüksége volt.
Bebocsáták a kihallgatási terembe; ott szemközt jött rájok Naláczi
István uram, hat alabárdos és a várporkoláb kiséretében, ki nagy
lánczokat hozott magával.
– Adja át kardját, Paskó Kristóf uram… szólt Naláczi.
A megszólított azt hivé, álmodik.
– Én? miért? mit vétettem én?
– Azt én nem tudom. Parancsom van a fejedelem ő nagyságától,
kegyelmedet, a mint megérkezik, vasra veretni. Holnap kihallgatást
nyerend.
Paskó felemelte méltóságteljesen szép nemes arczát, s meg nem
gyalázta magát azzal, hogy egy szót szóljon tovább. Szótlanul nyujtá
kezét a porkolábnak; az fellakatolta rá a nehéz bilincset.
János csak hallgatott eddig; de a mint meglátta, hogy urát vinni
akarják, földhöz csapta írásait s odaállt a porkoláb elé.
– Én is itt vagyok, hallja!
– Kend mehet Isten hírével, szólt hozzá Naláczi. Kend nincs az
árulásba keverve. Kend csak szolga.
– Áruló, a ki mondja! Kiáltá vakmerően a vén szolga. S ha szolga
vagyok is, de hűséges szolga.
– Örüljön kend, hogy semmi baja.
– Én akarom, hogy bajom legyen! Én vagyok olyan bűnös, mint a
gazdám, s ha az ilyen embereket a pokolba küldik, én is oda akarok
menni.
– Épen mondani akartam kendnek, hogy menjen oda.
– Ősz vagyok uram, fehér a szakállam, azért engem ne csúfoljon;
hanem vagy csukasson be a gazdám mellé s veressen engem is
vasra, vagy dobassanak ki innen erőhatalommal, mert én ugyan
magam jószántából el nem megyek.
Naláczi mosolyogva intett az alabárdosoknak, kik az ajtón a
lánczokkal terhelt Paskót elvezették, a másikon pedig kidobták
Jánost, ki addig meg nem nyugodott, míg a lépcsőkön le nem
ránczigálták, s azután sem ment el a palota elől, hanem letette a
fejét annak egyik szegletkövére, s ott aludt egész éjjel; fölkelve az
első kakasszóra s már hajnalban tudakozódva, ha nem lehet-e még a
fejedelemhez fölmenni?
IX. A TANU.
János ott várt sokáig a palota kapujában, minden kivagy
bemenőtől megtudakozva, mikor lehet már a fejedelemmel beszélni.
Természetesen kinevették.
– Kend a fejedelemmel akar beszélni? Tán biz a fogarasi
várnagyságot akarja elkapni? monda az egyik.
– Nem az, szegény, csak a czinkotai itczét kivánja behozatni
Erdélybe, kötekedék vele más.
– Tréfálkozzatok csak, monda magában az öreg; azért én mégis
fogok beszélni a fejedelemmel.
S ott várt étlen, szomjan késő délutánig, mikor a fejedelem
hintaja a kapu alá gördült s jól látta, mint ül fel Apafi Mihály bele,
nagy örömére egyesegyedül, senki által nem kisérve.
János nem sokat törte a fejét az ékesszóláson, hanem egyszerre
oda állt a fejedelem fogata elé, s hangos szóval felkiálta:
– Én uram, nagyságos fejedelem! hallgassa meg kegyelmed egy
szegény szolgájának könyörgését.
A kocsis a lovak közé vágott, s azok elkezdtek ágaskodni, mire
János elszántan odaveté magát a lovak elé s belekapaszkodva
azoknak zabláiba, indulatosan felordíta:
– Gázoljatok hát rajtam keresztül, ha nem engeditek, hogy a
fejedelem meghallgassa a könyörgő szavát! tiporjatok el, de csak
holttestemen át fogtok odább mehetni, mert én nem mozdulok
innen!
A fejedelem meg volt lepetve a vén szolga merészsége által, s
inte csatlósainak, hogy engedjék őt hozzájárulni. Az öreg letérdelt a
hintó hágcsójára.
– Mi kell? Miért állítád meg kocsimat?
– Mert szobáid, nagyságos uram, zárva vannak oly rongyos ősz
szolgák előtt, mint én vagyok, pedig ha megőszített a gond, az
ország gondja volt az, s a váradi és nagyszőllősi csatákból több
sebhelyet viselek testemen, mint ezek az urak itten paszomántot
köntöseikre varrva.
– Jól van, fiam. Mi kell? kihallgatlak.
– Nem jutalomért esengek hozzád, oh uram! Azt azok szokták
kérni, a kik meg nem érdemelték. Nem magamért szólok, az egész
életem nem ér már egy kiáltást, hanem uramért könyörgök, kit
elfogattál, tömlöczre vetettél, a szegény szerencsétlen Paskó
Kristófért.
– Öreg, egy szót se szólj érte!
– Nem, nem uram, el nem bocsátlak, kiálta a vén szolga,
megragadva Apafi köntösét; egy ember, ki százszor szembe nézett a
halállal, érted és a hazáért, ki a közügyekért nem kimélte fáradságát,
vagyonát, házi boldogságát, – ki nem beszélt egyébről, nem
álmodott másról, mint hona jóvoltáról, – ki a vérpad lépcsőire ment
fel s bakó zsinegével a nyakán beszélt mi érettünk, – ki tizenhat
napig hányatta magát a szélvészes tengeren, hogy az ország
balsorsán könnyebbítsen, – megérdemli, hogy midőn a hazájába
érve, tömlöczre vettetik, ha meghallgatád azokat, a kik vádolták,
hallgasd meg azt is, a ki mentségére szól; mert ártatlan ő, mint az
angyalok, s oly tiszta még a legtitkosabb gondolatja is, mint az
arany. Én ismerem őt, mert kezemen hordoztam, mint gyermeket.
Az öreg szemeit egészen ellepte a köny; a fejedelem
elérzékenyülve szóla hozzá:
– Keljen fel kend. Kend derék szolga. Kár, hogy jobb ura nincsen.
– Soha se szolgáljak jobb urat, oh fejedelem. Ne hozz itéletet rá,
mielőtt meghallgattad volna. Ezt az ősz fejemet teszem rá, ha csak
annyi vétke is van ellened, mint egy ma született gyermeknek; de ha
volna is valami vétke, – én ugyan nem tudom, mi lehetne az? – hisz
ő is ember, könnyen hibázhatott; de légy te is ember, oh fejedelem,
jusson eszedbe, mily hű volt ő hozzád és bocsáss meg neki…
Apafi felemelé a szolgát térdepeltéből.
– Kelj fel előttem, öreg szolga. Te ritka becsületes ember vagy.
Ime, ne mondja senki, hogy én előttem a szegény ember nem oly
kedves, mint a gazdag; holnap reggel jőjj fel palotámba,
parancsomra be fognak vezetni a kihallgatási terembe. A vád súlyos,
mely uradat terheli, s a tanú fontos, ki ellene föllép: rettenetes tanú!
Az ember szíve megáll, ha rágondol is, s borzadva száll Istenhez,
hogy hihesse-e, a mit alig szabad? De én megbecsüllek azzal, hogy
szemközt állítalak e tanúval, annyi súlyt adok a te szavadnak, mint
az övének. Pedig mondom neked, hogy az ő szavai igen súlyosak.
Légy békével addig.
Az öreg szolga összecsókolá a fejedelem kezét s könyes
szemekkel távozott el a palota kapujából. Az emberek nem tréfáltak
többé vele.
***
Másnap korán reggel ott volt a vén szolga a tanácsteremben,
még a testőrökön kívül senki sem volt jelen.
Oly hosszú volt neki az idő, míg a tanácsurak mind egyenkint
felgyülekeztek, s helyet foglaltak a hosszú zöld asztalnál, s
beszélgettek közömbös tárgyakról, vagy elhallgattak egészen, s nem
hallatszott egyéb az unalmas időközben, mint Sárpataky itélőmester
írótollának szomorú perczegése a papiron.
Végre nagy zajjal kétfelé nyíltak a fejedelem szobáiból vezető
ajtók, s Naláczi István és Teleki Mihálytól kisérve, megjelent a
fejedelem.
Az urak fölkeltek előtte mind és meghajták magokat. A fejedelem
inte nekik, hogy üljenek le s maga elfoglalta az elnöki széket. Ott
voltak az országtanács legtekintélyesebb tagjai, ott Béldi Pál, Kornis
Gáspár, három Bethlen, Kapi, Haller, Lázár, Kendeffy, kiknek komoly
arczain remegve tekinte végig a vén szolga, elgondolta, hogy ezen
urak előtt ő máskor még köszönni is némán szokott s most beszédet
kell majd előttök tartania.
Apafi inte Naláczinak, mire az eltávozott s a feszült figyelem
közepett az ajtón kívül lánczcsörrenést lehete hallani.
Még a szivek is halkabban dobogtak.
Megnyílt az ajtó s két alabárdostól kisérve, belépett a vádlott,
lánczait kezével emelve, mintha nem akarna azok csörgésével
szánalmat gerjeszteni maga iránt.
Nyugodt, komoly tekintete végig járt az előtte ülők arczain, s
midőn legutóbb szolgája arczát megpillantá, szelid érzelgésre vált
rajta a szigor.
Az öreget senki sem gátolhatá, hogy oda ne járuljon urához s
annak bilincseit meg ne csókolja.
Paskó távozást inte neki s maga határozott léptekkel a tanácsurak
elé járult, s az asztaltól néhány lépésnyire megállt, úgy, hogy a
legszélrül ülők kezet szoríthattak volna vele, – ha akartak volna.
Néhány percznyi szünet után fölállt Teleki Mihály s éles szemeivel
keményen arczába nézve a vádlottnak, így kezdé:
– Uram, kegyelmed vitézlő Paskó Kristóf, kinek kezeit pár hónap
előtt hálateljesen szorongatók s kit most lánczokkal terhelten látván
magunk előtt, bámulva kérdezzük: ha kegyelmed-e az, vagy mi
vagyunk-e ugyanazok, a kik voltunk? kegyelmednek egykor mind
megannyi barátja, rokona, hon- és tiszti társa, jelenleg pedig szigorú
itélő birái…
Abból, hogy kegyelmed mindazokat itt látja, a kik kegyelmedet
szerették, becsülték, előmozdíták, gyaníthatja kegyelmed, mily
súlyos legyen az a vád, mely ellene emelve van, s ha arczaink
sápadtságát tekinti s a lesütött szemeket, melyek kegyelmedre
föltekinteni nem mernek, előre tudhatja, mily fájdalmas kötelesség
az, mely bennünket kényszerít kegyelmeddel ily hangon beszélni, s
mily öröm lenne reánk nézve, ha e vád eloszlanék kegyelmed fejéről
és ismét itt láthatnók soraink között ülni.
– Nyugodtan hallgatom vádamat, mondá Paskó; lelkem tiszta
minden bűntől.
– A vétek, melylyel kegyelmed vádoltatik, semmivel sem
kevesebb: mint – hazaárulás.
Paskó arcza felhevült e szóra.
– Engem vádolnak hazaárulással, ki hazámért, fejedelmemért
száz alakban láttam a halált, értök megaláztam fejemet az
ellenségek legnyomorultabbjai előtt, s bátran emeltem föl, ha ugyan
kellett, a legfélelmesebbel szemközt? Kinek csak egy intés kellett,
hogy elhagyjam jószágomat, nyugalmas lakhelyem, családi
boldogságom s menjek vészek, viharok közé, holott élhettem volna
nyugodtan a magam kapuin belől, mint a többiek itt
Erdélyországban. Nem, uraim, ne vádoljatok engem e bűnnel.
Mondjátok meg annak, ki ellenem tör, hogy találjon ki számomra
elhihetőbb vádat. Mondja, hogy apámat öltem meg, nevezzen
istenkáromlónak, szentségtelennek; távolabb van tőlem mindezeknél
ama bűn, melyet kimondani is irtózat nekem.
– A vád épen azért súlyos, mert ily külszín alól takarja fel a
vétket. Midőn kegyelmed kértünkre oly kész volt mindannyiszor a
portára menni, olyankor kegyelmed soha sem a mi általunk rábizott
ügyeket sürgetni járt, hanem saját magának alkudta a
fejedelemséget; ha a vezérekkel beszélt, azoktól soha sem az adó
leszállítását kérte, hanem még nagyobb adót igért, ha fejedelemmé
teszik; s az általunk ajándékul küldött összegeket mindig saját
nevében osztogatta ki. Mindezekről pedig oly személy tesz
tanúbizonyságot, a ki kegyelmed körül mindeneket tud!
Paskó szédülni érzé agyát e vádakra. Lelke nem birt elég erővel
ennyi képtelen ellentétnek megfelelhetni. Mint a hermelin, mely
meghagyja magát inkább fogatni, mint hogy a sárba bele menjen.
– Az csak az Isten, szólt rebegve, a ki mindeneket tud.
– De tudok én is, kiálta közbe, nem tartóztathatva gerjedelmét a
vén szolga; s rágalomnak, ocsmány hazugságnak mondok mindent
és azt kivánom, hogy a ki közülünk hamisat mondott, azt az Isten
vágja ketté!
Nagy bajba került a testőröknek a tűzbejött öreget elhalgattatni,
de e buzgósága szolgájának új erőt látszott Paskónak kölcsönözni.
– Ennyi vád között, uraim, monda nemes büszkeséggel, semmi
sem sérti annyira lelkemet, mint az, hogy én reám bizott
országkincsét osztogattam ki magamé gyanánt, a vád többi része
csak vért hoz fejemre, de ez gyalázatot! Épen azon nap, talán
ugyanazon órában, melyben ez irtózatos vád ellenem elmondatott,
én családi boldogságomat keserítém meg azzal, hogy ötezer aranyat
felmondva adósomnak, abból egyetlen fillért megtagadtam nőm
örömeitől, az egészet az ország által fizetendő adó kipótlására
szánva.
Apafi és Teleki bámulva néztek Paskóra; a főtanácsos úr szájában
megakadt a szó.
– Bizonyára, folytatá Paskó, ha méltóságtok elfogadnák a nő
bizonyságtételét férje mellett ily esetekben, nőm legjobban
megmondhatná, ha egy szóval eltér-e ez állításom az igazságtól?
– Szencsétlen ember! sóhajta Apafi s félrefordítá arczát.
Maga Teleki is oly megzavarodottnak látszott, hogy egy szót sem
talált, a mit erre mondjon.

É
– Uraim, méltóságtok! szólt Paskó mindig bátrabb hangon. Én
követelem, hogy azon ember, vagy ördög, ki engem oly pokoli
bűnnel vádol, velem szembesíttessék; hadd nézzek arczába, midőn e
vádat szemembe mondja, hadd lássam, lesz-e elég bátorsága
engemet látni és ellenem szólani?
– Kegyelmed követeli? kérdé Teleki mind jobban elhülve.
– Jogom van ezt kérni.
– Boldogtalan, sóhajta a főtanácsos úr s inte, hogy nyissák meg
az ajtót.
Mindenki feszülten nézett oda, düh és harag tekintetével Paskó
és az öreg szolga.
Az ajtó megnyilt s a tanú, ki belépett rajta, – Berta volt, – Paskó
neje…
– Itt áll a tanú kegyelmed ellen… szólt reszketeg hangon
Teleki.14)
Paskó eltántorult állóhelyéből; fejéhez, szivéhez kapva
támaszkodék a mellette álló alabárdos vállaira; a világ elfordult vele,
arczán halálos sápadtság terült el; vigyetek vissza börtönömbe,
hebegé, s összerogyott, mint egy hulla. Élettelenül hurczolták el a
teremből. Többen a tanácsurak közől eltakarták arczaikat, nem
nézhettek oda; maga a fejedelem fehér volt, mint a fal.
És bizonyára a tanú sem mert maga elől föltekinteni e jelenet
alatt, s úgy adta Isten, hogy még a szépség is elmult arczáról e
pillanatban, oly visszataszítónak látszék, képe megnyúlt s friss színe
helyén szederjes foltok ültek; ajkai szép metszését úgy eltorzítá a
dacz és nőietlen merészség, s szemeit erős ónszín karikák fogták
körül.
Ott állt a terem közepén, szemeit lesütve, inkább bűnöshöz, mint
vádlóhoz hasonló, s bármint erősíté magát, meglátszott tagjain a
reszketés, s csaknem visszarettent, midőn a legelső hangban, mely
megszólalt, ismerősre talált.
Jánosé volt az, ki, míg az általános levertség mindenkire látszott
hatni, egy maga emelkedék fel, s a tanácsurak elé járulva, bátor
hangon megszólalt:
– Méltóságos uraim, nagyságos fejedelem! Ámbátor felfordult
világ az, a midőn a legutolsó szolgájának kell védelmezni urát
tulajdon felesége ellen, mindazáltal az én uramnak, a nagyságos
fejedelem kegyelme, nekem, alázatos jobbágyának megengedvén,
hogy uram mellett szívem szerint szólhassak, cselekszem azt; és
hogy ha nem tudok is ékesen szólani, miként mások, de tudok
mondani igazat s tudom jól, hogy méltóságos uraim ott is
megértenek engem, a hol szavam elhal, csak zokogásom beszél.
Mert égre kiáltó és Istent kisértő cselekedet az, a midőn asszony
támad tulajdon férje ellen, hogy azt elveszítse, kinek ha még
volnának is bűnei, azokat fedezni, rejtegetni volna kötelessége; és
nem is cselekedhetik senki így más, mint a ki azon kötelességeit
régen elfeledte, melyekkel Isten előtt esküdt férjének tartozik, ki
bűnnel takarja el a bűnt, hazugsággal fedezi a csalást, hamis
esküvéssel mossa az árulást!
– Méltóságos uraim! kiálta közbe a nő. Ne engedjenek
kegyelmetek engemet e szolga által így meggyalázni. Azért, hogy én
többre becsültem az ország nyugalmát, mint saját szívemét,
megérdemlem talán, hogy én gyönge nő egy cseléd ronda beszédjei
ellen itt méltóságtok színe előtt védelemre találjak, s ha feláldoztam
fejedelmemért férjemet, kit mint embert szerettem, de mint árulót
elvetek magamtól, úgy hiszem, jogom van követelni, hogy ez
áldozatért ne piruljon orczám.
Erre Sárpataky uram kapott az alkalmon, s neki fordult Jánosnak
dorgáló szóval.
– Hallja kend, ez nem csárda, nem pitvar, a hol mocskolódni
szokás, ha kegyelmednek megengedtetett szólni vétkes ura mellett,
szóljon a dolog érdemére és ne térjen félre oly dolgokra, a mik ide
nem tartoznak.
– Kérem, szólt Teleki, Sárpatakyhoz fordulva. Nem szükség a
tanút rendre igazítanunk, mert ha kifogásai vannak az ellentanú
irányában, azokat elmondani igen de tartozó dolog. Mi nem bűnt
keresünk, hanem igazságot.
– Köszönöm alássan, méltóságos uram; szólt az öreg,
kegyelmedről azt mondják, hogy szigorú ember, de én azt mondom,
hogy igazságos is.
– Attól függ, hogy be tudja-e kegyelmed bizonyítani, hogy urának
neje bármi tekintetben okokkal bir férjének személyes ellensége
lenni. Mert ha ezt bebizonyíthatja, akkor világosan álland, hogy a
borzasztó vád csak borzasztó költemény s visszahull az okozó fejére.
János nehány pillanatig gondolkozék.
– Méltóságos uraim. Én most jöttem messzeföldről haza. Mindent
sejtek, de semmit sem tudok. De engedjenek nekem csak egy
hónapi határidőt, hogy azalatt amaz asszony lépteit szemmel
kisérhessem és én bizonyára mondom, hogy napnál fényesebben be
fogom mutatni, hogy ő a bűnös, nem ura.
– Ah, nagyságos fejedelem! kiálta közbe Berta. E megalázó
őrködést nem fogja nagyságod rajtam megtörténni hagyni, egy
nyomorult szolga puszta vádja miatt, mely vádnak még csak alakja
sincs, s ki csak azért gyűlöl engem, mert minden részegest,
verekedőt elűztem házamtól, s azért költ ellenem vakmerő vádakat.
– Szóljak, nagyságos uraim? Elmondjam-e, hogy e derék
asszonyság, midőn férje magával akarta vinni, oly beteg volt, alig
birt mozdulni, s a mint férje eltávozott, elkezdte a dinomdánomot, s
addig el nem hagyta, míg ismét vissza nem tért? elmondjam-e, hogy
idegen nyelvű lokajt tart a háznál, hogy senki se érthesse, mikor vele
beszél?
Egy pár a tanácsurak közől nevetni kezdett e szóra.
– Nem oly nevetni való dolog ez, uraim! feddőzék a fejedelem. Ki
kell hallgatni, a mit mond.
– Engedelmet kérek, méltóságos uraim, szólt Berta, hogy
eltávozhassam.
– Maradjon kegyelmed, szólt ekkor Béldi Pál felállva; azon vádra
a mit kegyelmed férje ellen tett, nagyon természetesen következik
az a másik, a mit szolgája tett kegyelmed ellen, ezt kegyelmednek
előre kellett volna tudni. Mi tehát, hogy az igazságnak végére
járjunk, kénytelenek leszünk a vádlónak hatalmat adni a kegyelmed
fölötti őrködésre, oly módon, hogy kastélyának kulcsait kezébe adva,
annak kapuján az ő tudta nélkül senki be nem mehet és ki nem
jöhet az ő tudta nélkül.
– Uraim! kiálta fel megrettenve a nő. Ez ember képes lenne
engemet meggyilkolni, vagy a házat rám gyújtani, ha udvaromba
bocsáttatik.
– Egy szót kérek, monda János, ki nagyon meg volt elégedve a
határozattal, s azzal, úgy hiszem, mind a ketten meg vagyunk
nyugtatva. Uram kastélya széles mély árokkal van körülkerítve,
melyen át csak egy hídon keresztül lehet a várkapuhoz jutni, és a
hídnak szinte kapuja van. Adassék át tehát nekem a hídkapu kulcsa s
legyen a várkapu kulcsa a nagyasszony kezében; ilyen formán sem
én nem juthatok a várba az ő akarata ellen, sem pedig más az én
tudtom nélkül. Magam a hídon túl egy kis góréban majd ellakom.
– Legyen úgy, hagyá helyben a fejedelem.
– Ah, ez megalázó! kiálta fel a nő magán kívül.
– Kegyelmed kastélyába fog visszatérni. Szólt Apafi, s abban egy
évig felügyelet alatt marad. Addig férjének ügye felfüggesztetik.
A tanácsurak többsége helyeslé a határozatot, János kezet
csókolt a fejedelemnek, csak Berta asszony sápadt és kékült el bele;
oly rút volt e pillanatban, nem lehete rá nézni. A fejedelem elé akart
borulni, hogy megmásíttassa határozatát, de az kikerült előle, s
szobáiba távozott.
Apafi nagy pártolója volt a puritán tanoknak, s ha első bűn volt
előtte, a mit legkönnyebben hitt s legsúlyosabban büntetett, a
fejedelemkeresés, de a második volt a házasságtörés.
X. AZ ŐR.
A majosfalvi kastély épen a legnagyobb tatárjárásnak útjában
esvén, aként volt épülve eredetileg, hogy kisebb rablótámadások
ellen azt belülről védeni lehessen. Köröskörül egy mély s több ölnyi
széles árok övedzé, s ez árkon túl ismét mintegy száz lépésnyire
nagy szorgalommal ápolt angol, vagyis helyesebben franczia kert
foglalta körül a kastélyt, azon XIII. Lajos korában támadt
csodakertészet mintájára, mely egyenesre faragta a fákat s merev
falakat és zsinórral kimért szűk folyosókat épített megcsonkított
cserjékből.
A kastély is úgy volt épülve, hogy mintegy négy öl magasságnyira
ablakai nem voltak egyebek lőréseknél, csak a középről felmeredő
magas donjonnak voltak nagy góth ívezetű ónkarikákba foglalt
ablakai s a négy szegleten látszottak kiálló belvedérek, mikről a
szabadba lehete látni.
A palotának két oldalán volt kapuja, mik közől az egyik a
majorsági szekerek, másik az urasági hintók számára szolgált
bejárásul, az árkon pedig egyetlen híd vezetett keresztül, melyet
erős kőből épített portálé őrzött, s előtte egy toronyszerű épület volt
rakva, melyet valaha azon czélra építének, hogy benne valaki lakjék,
a ki a hídkapura vigyáz; de ez már annyira kiment a szokásból, hogy
tán félszázad óta sem lakott benne senki; tetejéről nagyobbára
lekopott a zsindely, s a denevérek egészen magokévá tették, a mi
még lakható volt rajta. Mind a négy oldalán volt egy-egy gömbölyű
ablaka, melyen egy közönséges emberi fő kidughatta magát, s
bejárását erős vaspántos ajtó őrzé, de melynek szegletét nagyon
kirágták a legutolsó toronyőr kutyái, mikor éjszakánkint be voltak
zárva, míg gazdájok a faluban mulatott.
Ezt a szép tanyát választá János gazda a fejedelem határozata
folytán magának lakásul, a mi valóban nem volt irigylésre méltó
állapot, de annál czélszerűbb az ő szándokára nézve.
Mikor beköltözködött, nyár volt; de azt mérsékelt emberi
tehetség mellett is el lehete előre gondolni, hogy majd egyszer tél is
lesz, és akkor hideg fog lenni, s az öreg majd megunja a maga
választotta hivatalt.
Az alvilág őrei nem voltak szigorúbbak, mint ő. A ki csak a
kastélyba akart jutni, előtte kellett elmennie, s ha gyanús arczra
talált, azt oly keresztül-kasul kikérdezte, hogy azt sem tudta, melyik
lábán álljon. Este pedig, a mint besötétedett s János gazda
elgondolá, hogy immár ideje lesz az alvásnak, megvárta, míg a
kastélyban elsötétültek az ablakok; akkor fogott egy darab viaszt, s
az urának reá bizott kardját magához véve, a kardmarkolatra vésett
czímerrel lepecsételte a ház kapuit, melynek kulcsai az úrnő kezében
voltak, s a híd kapuját, melynek kulcsát ő maga bírta. Ilyenformán
minden éjjel szigorú sequestrum alá zárva aludt az egész háznép, s
János gazda már hajnal előtt fenn volt, a pecséteket levenni, nehogy
okot adjon azoknak erőszakos felszakítására.
A mily boszantó volt e felvigyázat a ház asszonyára, ép oly
terhesnek hivé ő azt magára az őrre nézve, s várta szentül, hogy
majd ha a tél bekövetkezik, felhagy ő kegyelme a strázsálással s
ugyanezért ez időköz alatt oly szigorú életmódot viselt, mint az
apácza; még az olasz lokajnak sem volt szabad a kastélyba lépni, s
János gazda minden kutatásának sem sikerült kitudni, hogy hol lakik
ez antagonistája.
Azonban a tél is eljött, csikorgó hideg napok kezdődtek,
meghosszultak az unalmas éjszakák, s az ember még az ablakán
kinézni is fázott; csak Jánost nem zavarta mindez. Kifogott még a
fagyon is. Az árokból annyi nádat vágott, a mennyi elég volt neki
tüzelni, s ha nem volt teteje a lakásának, legalább kimehetett rajta a
füst kémény nélkül s ha nyirkos volt palotájának fala és földje,
legalább nem kellett féltenie, hogy a láng belekap. Évek óta
megtakargatott fizetése elég volt neki élelemre itéletnapig, s ha egy
kenyeret megvett, az tovább tartott neki, mint egy akó bor.
Ilyenformán mult el a deczember, száraz, szeles, fagyos napok
mellett, hó nem esett ez ideig. János gazda akkor is rendesen
egyedül virrasztgatott odujában, mert látogatót nem tűrt magánál,
mindenkiben kémet, árulót gyanítva. Épen esztendő utolsó előtti
éjszakája volt, a várban sokáig fenn voltak, mert sütöttek, főztek az
új évre, s Jánosnak meg kelle várni, míg lefeküsznek, mely után
lepecsételte az ajtókat s hazatérve, bezárta nehéz ajtaját, nagy tüzet
rakván a tornya közepén, leteríté mellé subáját és neki heveredett, a
midőn egyszerre kopogtatást hall az ajtaján, elébb lassan, azután
mindig erősebben, s mintha valaki nevéről szólongatná.
Sokáig hallatlanná tevé a zajt; végre, hogy nem állhatta tovább,
fogá a hágcsóját, mely épen arra való volt, hogy a harmadfél öl
magasban levő ablakig felérjen, s azon felmászva, kidugá fejét az
ablakon, hogy megnézze, ki zörget.
Ismeretlen embernek találta. Bő szürke köpenybe volt burkolva,
csákós kalpaggal; nagy kipödrött bajusza volt, hogy éjszaka is észre
lehete venni.
Még ott is elnézte egy darabig, hogy dörömböz az ember ajtaján
s majd a kulcslyukon, majd a hasadékon kukucskál be s szabódik
erősen, hogy nyissák ki neki.
– Hát mit akarsz odalenn, öcsém? szólalt meg elvégre az öreg.
– Ah! ott van kegyelmed? kiáltá örvendő hangon az ember. Adjon
Isten jó estét kendnek, János bátya! hát nem ismer kend rám? Én
vagyok kendnek az öcscse, az édes testvéröcscse. Están! A bizony.
– Elhiszem, ha mondod. Hát mi kell?
– Csak ereszszen be kend, mert megfagyok ide kinn.
– Hát minek jöttél ide?
– Ejnye de házsártos kend ma, János bátya. Hogy megigazgat!
Sz’ nem így kellene kendnek engemet fogadni, az édes
testvéröcscsét.
– Biz öcsém, szólt János gazda, meggondolva, hogy mit
mondjon, nem azért mondom, hogy elbizd magadat rajta, mert azt
tudod, hogy nekem hizelkedni nem szokásom; nem is azt tekintve,
hogy édes testvérem vagy, de annyi bizonyos, hogy mindazon
emberek között, a kiket becsületben tartok, te vagy a legeslegutolsó;
hanem hát mi dolgod velem?
– Ej na. Hát csak ezen járok, s rég nem láttam kendet. Csak nem
tagad meg kend magától? ha akarná sem tehetné, mert úgy
hasonlítunk egymáshoz, mint két makk; csakhogy a kend bajusza
ősz, az enyim pedig még fekete.
– Hát magad vagy-e? kérdé János gyanúsan szélylyel kémlelve.
– No bizony, csak nem fél kend tán tőlem?
– Én félni? Az volna még csak hátra! s hogy épen tőled féljek!
Már erre a szóra csakugyan leszállt János gazda s kinyitá az ajtót
Estánnak, s beengedte azt lépni a tűz mellé s mondá neki, hogy
akaszsza fel a köpönyegét a szegre.
Ott pedig nem volt több egy szegnél, a melyen a kard lógott.
– Ejnye be szép kardja van kendnek, János bátya.
– Hagyd el azt a kardot, öcsém, beszélj egyébről. Szedd le
magadat s ha ehetnél, hát alugyál; mert én nem adhatok egyebet,
mint egy veder bort.
– Az is jó lesz, mondá Están, félszemmel mindig a kardot lesve, s
míg János az átalagot előhozta valamelyik szegletből, az alatt ő a
kard markolatát vizsgálgatta nagy gondosan.
János gazda előhozá a kérdéses edényt, mely is tele volt
legújabban kiforrt új borral, azon minőségűvel, melyből egy pár kupa
úgy letesz holmi vékony pénzű legényt, hogy egyik szélitől a másikig
méri az utczát, s minden házat a magáénak néz; azt tehát lehelyezve
a tűz mellé, oda adott egy fakupát az öcscse kezébe, a másikkal
pedig maga merített.
– Hát mit csinál Kökényesdi uram? kérdé az első kupa után
öcscsétől.
(Ez a Kökényesdi volt a leghíresebb haramiavezér azon időben.)
– Nem tudom, felelt Están. Mert már régen eljöttem tőle, s most
más úrnál szolgálok.
– No ezt már szeretem hallani. Kivált ha hinném.
– Elhiheti azt kend. Itt szolgálok, hogy is híják uramnál.
– Soha se törd rajta a fejedet. Az én kedvemért egyszer se
hazudj. Jobb, ha iszol; zsivány korodban ugyan jobb borokat is láttál,
hanem ezt úgy idd, mint a minek meg van adva az ára.
E párbeszédből annyit gyaníthatunk, hogy Están úr nem a
legjobb hírben állt urabátyja előtt.
– No de igyék hát kegyelmed is; különben azt hiszem, méreg van
a borában.
– Üm. Monda magában János gazda. Ez a ficzkó azt hiszi, hogy le
fog itatni engem. No iszen majd moresre tanítom mindjárt. Jól van
öcsém, hát lássunk hozzá.
Ezzel fogta az egyik kupát, öcscse a másikat s kezdtek fenekére
törekedni az átalagnak.
Egy óra mulva üresen állt előttük a veder. A két hős ült mellette
tántorítlanul s csodálta egymást. Még csak danolni sem kezdtek tőle.
Están megcsóválta a fejét, mintha azt gondolná, hogy nem várta
volna ilyen kemény legénynek az öreget s azzal fölkelt, előkeresett a
köpenye alól egy csikóbőrös kulacsot s bátyjára köszöntve monda:
– A magunk egészségére, bátya! Kóstoljuk meg most ezt is.
János látva, hogy Están is iszik, meggyőződött felőle, hogy nincs
benne bolondító s elfogadá a kulacsot.
Tele volt az a legkegyetlenebb lengyel pálinkával, a mitől, ha a
kozák tele iszsza magát, elfekszik három nap, három éjjel félholtan, s
egy hétig ki nem józanul. A kulacs tartalma pedig elég lett volna
négy kozáknak.
– Nem rossz, monda János gazda s elkezde a kulacs vándorolni, s
a mint az óra lefolyt, egyszer csak üres lett a kulacs is. A két bajnok
meg sem rezzent helyében.
– Már most próbáljunk mást is; szólt ekkor János, fölkelve
helyéről s egy magas polczról levett valami kobakot. Ezt én
Törökországból hoztam. Tatárital. Nem bánod meg, ha belőle iszol.
Fertelmes gonosz nedv vala az. Lótejből készült erős szesz, mely
végig karmolja az ember torkát s beégeti magát a beleibe; tatárok
szokták inni, mikor megunták a józanságot s a ki lerészegszik tőle,
lánczra kell kötni, hogy senkit meg ne marjon.
– Az én bátyám le akar engem itatni, gondolá magában Están, a
mint megkóstolta a könyfacsaró italt; de helyt állt neki. Egy kicsit
meglódult az agyveleje tőle, de azért birta magát tartani.
– Egyet mondok, bátya, szólt erre, látva, hogy János ennyi
rohamot kiállt; tud-e már kend dohányozni? Itt senki sem lát
bennünket.15) Ne gyujtsunk rá?
– Későn keltél fel engem leejteni lábamról, gondolá magában
János, s valami homályos meggyőződés mindinkább gyökeret kezde
verni lelkében, hogy az öcscse aligha legjobb szándékkal van iránta.
Nemsokára füstölt mindkettőjök szájában a csibuk, megrakva a
legfelségesebb basadohánynyal, minővel valaha méheket szédítettek,
s rövid idő alatt oly füst támadt körülök, hogy a mi denevér ez ideig
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about books and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!

ebookball.com

You might also like