# Guide to Pairing Based Cryptography book - selected code

### Abstract

The following site was created as a central repository for the SAGE and MAGMA code written in the development of the Hashing to Curves, Final Exponentiation, and Software Implementation Chapters of the Guide to Pairing Based Cryptography book.

Some of the code here shown may not be included in the final version of the book; nevertheless, all of the code is presented to the reader as a help in the understanding of those chapters.

**Keywords:** pairing-based cryptography, hashing to curves, final exponentiation, software implementation, SAGE, Magma

### Download:

**Final Exponentiation Chapter**

**Software Implementation chapter**

### Requirements

### Typical run

For SAGE: load('file.sage')

For Magma: load "file.magma";

### Final Exponentiation

**Sage code**: (from SAGE console)

- load ('BNcurves.sage')
- load ('BW12curves.sage')

**Magma code**: (from Magma)

- load "KSSk18curves.magma";
- load "BLSk24curves.magma";

### Hash function

**Sage code**: (from SAGE console)

- load ('Hash_to_BN_curves.sage')
- load ('Hash_to_KSS18_curves.sage')
- load ('Hash_to_BN_curves_Like_C.sage')
- load ('Hash_to_KSS18_curves_Like_C.sage')

### Software Implementation (BN curves, SAGE)

**Full arithmetic**:

- load ('TestFp.sage')
- load ('TestG1.sage')
- load ('TestG2.sage')
- load ('TestPairing.sage')

### Authors

#### Final Exponentiation chapter

*Jean-Luc Beuchat*. ELCA Informatik AG.
*Luis J. Dominguez Perez*. CONACyT/CIMAT-Zacatecas.
*Laura Fuentes Castañeda*. Intel Mexico.
*Francisco Rodríguez-Henríquez*. Computing Department, CINVESTAV-IPN.

#### Hashing into curves

*Mehdi Tibouchi*. NTT Secure Platform Laboratories.
*José Eduardo Ochoa Jiménez*. Computing Department, CINVESTAV-IPN.
*Francisco Rodríguez-Henríquez*. Computing Department, CINVESTAV-IPN.

#### Software Implementation

*Diego F. Aranha*. Institute of Computing. University of Campinas.
*Luis J. Dominguez Perez*. CIMAT-Zacatecas. CONACyT.
*Amine Mrabet*. Department of Secure Architectures and Systems. Center of Microelectronics in Provence.
*Peter Schwabe*. Digital Security group. Radboud University

### Contact

- Francisco Rodríguez-Henríquez (francisco @ this-subdomain)