ChaCha20 and Poly1305 for IETF Protocols
draft-nir-cfrg-rfc7539bis-02

Document Type Active Internet-Draft (cfrg RG)
Last updated 2017-09-16
Stream IRTF
Intended RFC status Informational
Formats plain text xml pdf html bibtex
Stream IRTF state In IRSG Poll (wg milestone: Jul 2017 - Send "ChaCha20 and P... )
Consensus Boilerplate Yes
RFC Editor Note (None)
IESG IESG state I-D Exists
Telechat date
Responsible AD (None)
Send notices to irsg@irtf.org
Crypto Forum                                                      Y. Nir
Internet-Draft                                                  Dell EMC
Obsoletes: 7539 (if approved)                                 A. Langley
Intended status: Informational                              Google, Inc.
Expires: March 20, 2018                               September 16, 2017

                ChaCha20 and Poly1305 for IETF Protocols
                      draft-nir-cfrg-rfc7539bis-02

Abstract

   This document defines the ChaCha20 stream cipher as well as the use
   of the Poly1305 authenticator, both as stand-alone algorithms and as
   a "combined mode", or Authenticated Encryption with Associated Data
   (AEAD) algorithm.

   RFC 7539, the predecessor of this document, was meant to serve as a
   stable reference and an implementation guide.  It was a product of
   the Crypto Forum Research Group (CFRG).  This document merges the
   errata filed against RFC 7539 and adds a little text to the Security
   Considerations section.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at https://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on March 20, 2018.

Copyright Notice

   Copyright (c) 2017 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (https://trustee.ietf.org/license-info) in effect on the date of

Nir & Langley            Expires March 20, 2018                 [Page 1]
Internet-Draft             ChaCha20 & Poly1305            September 2017

   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Conventions Used in This Document . . . . . . . . . . . .   4
   2.  The Algorithms  . . . . . . . . . . . . . . . . . . . . . . .   4
     2.1.  The ChaCha Quarter Round  . . . . . . . . . . . . . . . .   4
       2.1.1.  Test Vector for the ChaCha Quarter Round  . . . . . .   5
     2.2.  A Quarter Round on the ChaCha State . . . . . . . . . . .   5
       2.2.1.  Test Vector for the Quarter Round on the ChaCha State   6
     2.3.  The ChaCha20 Block Function . . . . . . . . . . . . . . .   6
       2.3.1.  The ChaCha20 Block Function in Pseudocode . . . . . .   8
       2.3.2.  Test Vector for the ChaCha20 Block Function . . . . .   8
     2.4.  The ChaCha20 Encryption Algorithm . . . . . . . . . . . .  10
       2.4.1.  The ChaCha20 Encryption Algorithm in Pseudocode . . .  10
       2.4.2.  Example and Test Vector for the ChaCha20 Cipher . . .  11
     2.5.  The Poly1305 Algorithm  . . . . . . . . . . . . . . . . .  13
       2.5.1.  The Poly1305 Algorithms in Pseudocode . . . . . . . .  15
       2.5.2.  Poly1305 Example and Test Vector  . . . . . . . . . .  15
     2.6.  Generating the Poly1305 Key Using ChaCha20  . . . . . . .  17
       2.6.1.  Poly1305 Key Generation in Pseudocode . . . . . . . .  18
       2.6.2.  Poly1305 Key Generation Test Vector . . . . . . . . .  18
     2.7.  A Pseudorandom Function for Crypto Suites based on
           ChaCha/Poly1305 . . . . . . . . . . . . . . . . . . . . .  18
     2.8.  AEAD Construction . . . . . . . . . . . . . . . . . . . .  19
       2.8.1.  Pseudocode for the AEAD Construction  . . . . . . . .  21
       2.8.2.  Example and Test Vector for AEAD_CHACHA20_POLY1305  .  22
   3.  Implementation Advice . . . . . . . . . . . . . . . . . . . .  24
   4.  Security Considerations . . . . . . . . . . . . . . . . . . .  24
   5.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .  26
   6.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  26
     6.1.  Normative References  . . . . . . . . . . . . . . . . . .  26
     6.2.  Informative References  . . . . . . . . . . . . . . . . .  26
   Appendix A.  Additional Test Vectors  . . . . . . . . . . . . . .  29
     A.1.  The ChaCha20 Block Functions  . . . . . . . . . . . . . .  29
     A.2.  ChaCha20 Encryption . . . . . . . . . . . . . . . . . . .  32
Show full document text