src/java.base/share/classes/com/sun/crypto/provider/SunJCE.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -55,10 +55,12 @@
  *
  * - RC2
  *
  * - ARCFOUR (RC4 compatible)
  *
+ * - ChaCha20 (Stream cipher only and in AEAD mode with Poly1305)
+ *
  * - Cipher modes ECB, CBC, CFB, OFB, PCBC, CTR, and CTS for all block ciphers
  *   and mode GCM for AES cipher
  *
  * - Cipher padding ISO10126Padding for non-PKCS#5 block ciphers and
  *   NoPadding and PKCS5Padding for all block ciphers

@@ -332,10 +334,19 @@
                     put("Alg.Alias.Cipher.RC4", "ARCFOUR");
                     put("Cipher.ARCFOUR SupportedModes", "ECB");
                     put("Cipher.ARCFOUR SupportedPaddings", "NOPADDING");
                     put("Cipher.ARCFOUR SupportedKeyFormats", "RAW");
 
+                    put("Cipher.ChaCha20",
+                        "com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Only");
+                    put("Cipher.ChaCha20 SupportedKeyFormats", "RAW");
+                    put("Cipher.ChaCha20-Poly1305",
+                        "com.sun.crypto.provider.ChaCha20Cipher$ChaCha20Poly1305");
+                    put("Cipher.ChaCha20-Poly1305 SupportedKeyFormats", "RAW");
+                    put("Alg.Alias.Cipher.1.2.840.113549.1.9.16.3.18", "ChaCha20-Poly1305");
+                    put("Alg.Alias.Cipher.OID.1.2.840.113549.1.9.16.3.18", "ChaCha20-Poly1305");
+
                     /*
                      * Key(pair) Generator engines
                      */
                     put("KeyGenerator.DES",
                         "com.sun.crypto.provider.DESKeyGenerator");

@@ -357,10 +368,14 @@
                     put("KeyGenerator.ARCFOUR",
                         "com.sun.crypto.provider.KeyGeneratorCore$" +
                         "ARCFOURKeyGenerator");
                     put("Alg.Alias.KeyGenerator.RC4", "ARCFOUR");
 
+                    put("KeyGenerator.ChaCha20",
+                        "com.sun.crypto.provider.KeyGeneratorCore$" +
+                        "ChaCha20KeyGenerator");
+
                     put("KeyGenerator.HmacMD5",
                         "com.sun.crypto.provider.HmacMD5KeyGenerator");
 
                     put("KeyGenerator.HmacSHA1",
                         "com.sun.crypto.provider.HmacSHA1KeyGenerator");

@@ -537,10 +552,13 @@
                         "com.sun.crypto.provider.RC2Parameters");
 
                     put("AlgorithmParameters.OAEP",
                         "com.sun.crypto.provider.OAEPParameters");
 
+                    put("AlgorithmParameters.ChaCha20-Poly1305",
+                        "com.sun.crypto.provider.ChaCha20Poly1305Parameters");
+
                     /*
                      * Key factories
                      */
                     put("KeyFactory.DiffieHellman",
                         "com.sun.crypto.provider.DHKeyFactory");