Download and Install tinyec

This section describes how to install tinyec, which can be done by running the 'pip install tinyec' command.

Installing tinyec is easy. All you need to do is to run this command:

herong> pip install tinyec
Collecting tinyec
  Downloading https://files.pythonhosted.org/packages
     /c2/00/977e7339ae19b42ae10e
1219e5b13c0f54ef703e019be5d3e0b6bf5b90fe/tinyec-0.3.1.tar.gz
Installing collected packages: tinyec
  Running setup.py install for tinyec ... done
Successfully installed tinyec-0.3.1

Let's verify the installation with the following Python script:

herong> python

>>> import tinyec.ec as ec
>>> import tinyec.registry as reg
>>> c = reg.get_curve("secp192r1")
>>> print(c)
"secp192r1" => y^2 = x^3
   + 6277101735386680763835789423207666416083908700390324961276x
   + 2455155546008943817740293915197451784769108058161191238065
   (mod 6277101735386680763835789423207666416083908700390324961279)

>>> s = c.field
>>> print(s)
Subgroup => generator
   (602046282375688656758213480587526111916698976636884684818,
    174050332293622031404857552280219410364023488927386650641),
   order: 6277101735386680763835789423176059013767194773182842284081,
   cofactor: 1 on Field =>
   prime 6277101735386680763835789423207666416083908700390324961279

Ok. tinyec is installed correctly. It supports the named curve of "secp192r1" with a single predefined subgroup.

Table of Contents

 About This Book

 Running Python Code Online

 Python on macOS Computers

 Python on Linux Computers

 Built-in Data Types

 Variables, Operations and Expressions

 Statements - Execution Units

 Function Statement and Function Call

 Iterators and Generators

 List, Set and Dictionary Comprehensions

 Classes and Instances

 Modules and Module Files

 Packages and Package Directories

 "sys" and "os" Modules

 "pathlib" - Object-Oriented Filesystem Paths

 "pip" - Package Installer for Python

 SciPy.org - Python Libraries for Science

 pandas - Data Analysis and Manipulation

 Communicating with HTTPS Servers

tinyec - Tiny Library for ECC

 What Is tinyec

Download and Install tinyec

 Build New Curves with tinyec

 Perform Point Addition with tinyec

 Find Subgroup with Point Addition

 Set Subgroup Order to Higher Value

 Generating EC Public-Private Keys

 Anaconda - Python Environment Manager

 Jupyter Notebook and JupyterLab

 References

 Full Version in PDF/EPUB