diff --git a/LoongArch64.patch b/LoongArch64.patch index b58c8fbca08c040b23393b3111554298c0b35f46..e4f87aa10b7d23fe677d1454675f8a0dc13302c3 100644 --- a/LoongArch64.patch +++ b/LoongArch64.patch @@ -1,5 +1,11 @@ +commit 571d0113d119bd358d0cf4172960514d45db25a0 +Author: panxuefeng +Date: Thu Nov 14 20:16:04 2024 +0800 + + update LoongArch64 port to 8u432b06 + diff --git a/THIRD_PARTY_README b/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 +index 10fa4cee..97fc700d 100644 --- a/THIRD_PARTY_README +++ b/THIRD_PARTY_README @@ -7,7 +7,7 @@ OpenJDK 8. @@ -20,7 +26,7 @@ index 64bb0ff9..d19de8ae 100644 Ecma International Rue du Rhone 114 CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. +@@ -2580,16 +2580,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. Unicode Terms of Use For the general privacy policy governing access to this site, see the Unicode @@ -40,7 +46,7 @@ index 64bb0ff9..d19de8ae 100644 Conditions herein. 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for +@@ -2655,14 +2655,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for E.Trademarks & Logos. 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, @@ -59,7 +65,7 @@ index 64bb0ff9..d19de8ae 100644 the provisions of the Trademark Policy, which may be changed from time to time in the sole discretion of Unicode, Inc. -@@ -2632,12 +2632,12 @@ Miscellaneous. +@@ -2685,12 +2685,12 @@ Miscellaneous. 2. Modification by Unicode. Unicode shall have the right to modify this Agreement at any time by posting it to this site. The user may not @@ -74,7 +80,7 @@ index 64bb0ff9..d19de8ae 100644 4. Severability. If any provision of this Agreement is declared invalid or unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. +@@ -2719,7 +2719,7 @@ SOFTWARE. COPYRIGHT AND PERMISSION NOTICE @@ -110,10 +116,10 @@ index 1aab2b30..bd910bdd 100644 | maxq | mb | microblaze | mcore | mep \ | mips | mipsbe | mipseb | mipsel | mipsle \ diff --git a/common/autoconf/build-aux/config.guess b/common/autoconf/build-aux/config.guess -index 355c91e4..d03d029c 100644 +index 288edb6e..13cd94bf 100644 --- a/common/autoconf/build-aux/config.guess +++ b/common/autoconf/build-aux/config.guess -@@ -86,4 +86,15 @@ if [ "x$OUT" = x ]; then +@@ -86,6 +86,17 @@ if [ "x$OUT" = x ]; then fi fi @@ -128,7 +134,9 @@ index 355c91e4..d03d029c 100644 + fi +fi + - echo $OUT + # Test and fix LoongArch64. + if [ "x$OUT" = x ]; then + if [ `uname -s` = Linux ]; then diff --git a/common/autoconf/configure.ac b/common/autoconf/configure.ac index 151e5a10..5072409d 100644 --- a/common/autoconf/configure.ac @@ -155,10 +163,10 @@ index 151e5a10..5072409d 100644 # Configure flags for the tools FLAGS_SETUP_COMPILER_FLAGS_FOR_LIBS diff --git a/common/autoconf/generated-configure.sh b/common/autoconf/generated-configure.sh -index b0b30333..1de12e3b 100644 +index ad3f7f23..27f1b016 100644 --- a/common/autoconf/generated-configure.sh +++ b/common/autoconf/generated-configure.sh -@@ -716,6 +716,9 @@ SET_EXECUTABLE_ORIGIN +@@ -720,6 +720,9 @@ SET_EXECUTABLE_ORIGIN SHARED_LIBRARY_FLAGS CXX_FLAG_REORDER C_FLAG_REORDER @@ -168,7 +176,7 @@ index b0b30333..1de12e3b 100644 SYSROOT_LDFLAGS SYSROOT_CFLAGS RC_FLAGS -@@ -4078,6 +4081,12 @@ fi +@@ -4073,6 +4076,12 @@ fi # questions. # @@ -181,7 +189,7 @@ index b0b30333..1de12e3b 100644 # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. -@@ -13726,6 +13735,18 @@ test -n "$target_alias" && +@@ -13922,6 +13931,12 @@ test -n "$target_alias" && VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -191,16 +199,10 @@ index b0b30333..1de12e3b 100644 + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; -+ loongarch64) -+ VAR_CPU=loongarch64 -+ VAR_CPU_ARCH=loongarch -+ VAR_CPU_BITS=64 -+ VAR_CPU_ENDIAN=little -+ ;; - *) - as_fn_error $? "unsupported cpu $build_cpu" "$LINENO" 5 - ;; -@@ -13864,6 +13885,18 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } + loongarch64) + VAR_CPU=loongarch64 + VAR_CPU_ARCH=loongarch +@@ -14066,6 +14081,12 @@ $as_echo "$OPENJDK_BUILD_OS-$OPENJDK_BUILD_CPU" >&6; } VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -210,16 +212,10 @@ index b0b30333..1de12e3b 100644 + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; -+ loongarch64) -+ VAR_CPU=loongarch64 -+ VAR_CPU_ARCH=loongarch -+ VAR_CPU_BITS=64 -+ VAR_CPU_ENDIAN=little -+ ;; - *) - as_fn_error $? "unsupported cpu $host_cpu" "$LINENO" 5 - ;; -@@ -13986,6 +14019,8 @@ $as_echo "$COMPILE_TYPE" >&6; } + loongarch64) + VAR_CPU=loongarch64 + VAR_CPU_ARCH=loongarch +@@ -14194,6 +14215,8 @@ $as_echo "$COMPILE_TYPE" >&6; } OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" @@ -228,7 +224,7 @@ index b0b30333..1de12e3b 100644 fi -@@ -14019,6 +14054,9 @@ $as_echo "$COMPILE_TYPE" >&6; } +@@ -14227,6 +14250,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" @@ -238,7 +234,7 @@ index b0b30333..1de12e3b 100644 fi -@@ -14028,6 +14066,8 @@ $as_echo "$COMPILE_TYPE" >&6; } +@@ -14236,6 +14262,8 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" @@ -247,7 +243,7 @@ index b0b30333..1de12e3b 100644 fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" -@@ -14040,6 +14080,9 @@ $as_echo "$COMPILE_TYPE" >&6; } +@@ -14248,6 +14276,9 @@ $as_echo "$COMPILE_TYPE" >&6; } elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi @@ -257,7 +253,7 @@ index b0b30333..1de12e3b 100644 # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. -@@ -42220,6 +42263,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; } +@@ -42422,6 +42453,47 @@ $as_echo "$ac_cv_c_bigendian" >&6; } fi @@ -306,7 +302,7 @@ index b0b30333..1de12e3b 100644 ############################################################################### diff --git a/common/autoconf/platform.m4 b/common/autoconf/platform.m4 -index 51df988f..51cc28c3 100644 +index f54942ac..51cc28c3 100644 --- a/common/autoconf/platform.m4 +++ b/common/autoconf/platform.m4 @@ -23,6 +23,12 @@ @@ -322,7 +318,7 @@ index 51df988f..51cc28c3 100644 # Support macro for PLATFORM_EXTRACT_TARGET_AND_BUILD. # Converts autoconf style CPU name to OpenJDK style, into # VAR_CPU, VAR_CPU_ARCH, VAR_CPU_BITS and VAR_CPU_ENDIAN. -@@ -96,6 +102,18 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], +@@ -96,6 +102,12 @@ AC_DEFUN([PLATFORM_EXTRACT_VARS_FROM_CPU], VAR_CPU_BITS=64 VAR_CPU_ENDIAN=big ;; @@ -332,16 +328,10 @@ index 51df988f..51cc28c3 100644 + VAR_CPU_BITS=64 + VAR_CPU_ENDIAN=little + ;; -+ loongarch64) -+ VAR_CPU=loongarch64 -+ VAR_CPU_ARCH=loongarch -+ VAR_CPU_BITS=64 -+ VAR_CPU_ENDIAN=little -+ ;; - *) - AC_MSG_ERROR([unsupported cpu $1]) - ;; -@@ -283,6 +301,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], + loongarch64) + VAR_CPU=loongarch64 + VAR_CPU_ARCH=loongarch +@@ -289,6 +301,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], OPENJDK_TARGET_CPU_LEGACY_LIB="i386" elif test "x$OPENJDK_TARGET_CPU" = xx86_64; then OPENJDK_TARGET_CPU_LEGACY_LIB="amd64" @@ -350,7 +340,7 @@ index 51df988f..51cc28c3 100644 fi AC_SUBST(OPENJDK_TARGET_CPU_LEGACY_LIB) -@@ -316,6 +336,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], +@@ -322,6 +336,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_OSARCH="amd64" @@ -360,7 +350,7 @@ index 51df988f..51cc28c3 100644 fi AC_SUBST(OPENJDK_TARGET_CPU_OSARCH) -@@ -325,6 +348,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], +@@ -331,6 +348,8 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" != xmacosx && test "x$OPENJDK_TARGET_CPU" = xx86_64; then # On all platforms except macosx, we replace x86_64 with amd64. OPENJDK_TARGET_CPU_JLI="amd64" @@ -369,7 +359,7 @@ index 51df988f..51cc28c3 100644 fi # Now setup the -D flags for building libjli. OPENJDK_TARGET_CPU_JLI_CFLAGS="-DLIBARCHNAME='\"$OPENJDK_TARGET_CPU_JLI\"'" -@@ -337,6 +362,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], +@@ -343,6 +362,9 @@ AC_DEFUN([PLATFORM_SETUP_LEGACY_VARS], elif test "x$OPENJDK_TARGET_OS" = xmacosx && test "x$TOOLCHAIN_TYPE" = xclang ; then OPENJDK_TARGET_CPU_JLI_CFLAGS="$OPENJDK_TARGET_CPU_JLI_CFLAGS -stdlib=libc++ -mmacosx-version-min=\$(MACOSX_VERSION_MIN)" fi @@ -379,7 +369,7 @@ index 51df988f..51cc28c3 100644 AC_SUBST(OPENJDK_TARGET_CPU_JLI_CFLAGS) # Setup OPENJDK_TARGET_OS_API_DIR, used in source paths. -@@ -550,3 +578,46 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], +@@ -556,3 +578,46 @@ AC_DEFUN_ONCE([PLATFORM_SETUP_OPENJDK_TARGET_ENDIANNESS], AC_MSG_ERROR([The tested endian in the target ($ENDIAN) differs from the endian expected to be found in the target ($OPENJDK_TARGET_CPU_ENDIAN)]) fi ]) @@ -427,7 +417,7 @@ index 51df988f..51cc28c3 100644 +AC_SUBST(HOST_NAME) +]) diff --git a/common/autoconf/spec.gmk.in b/common/autoconf/spec.gmk.in -index 461ec597..97ac5b48 100644 +index 9573bb2c..a0540633 100644 --- a/common/autoconf/spec.gmk.in +++ b/common/autoconf/spec.gmk.in @@ -23,6 +23,12 @@ @@ -435,8 +425,8 @@ index 461ec597..97ac5b48 100644 # +# -+# This file has been modified by Loongson Technology in 2023. These -+# modifications are Copyright (c) 2018, 2023, Loongson Technology, and are made ++# This file has been modified by Loongson Technology in 2024. These ++# modifications are Copyright (c) 2018, 2024, Loongson Technology, and are made +# available on the same license terms set forth above. +# + @@ -453,7 +443,7 @@ index 461ec597..97ac5b48 100644 +HOST_NAME:=@HOST_NAME@ + +# Loongson OpenJDK Version info -+VER=8.1.15 ++VER=8.1.21 +ifeq ($(HOST_NAME), ) + HOST_NAME=unknown +endif @@ -467,176 +457,6 @@ index 461ec597..97ac5b48 100644 # How to compile the code: release, fastdebug or slowdebug DEBUG_LEVEL:=@DEBUG_LEVEL@ -diff --git a/corba/THIRD_PARTY_README b/corba/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 ---- a/corba/THIRD_PARTY_README -+++ b/corba/THIRD_PARTY_README -@@ -7,7 +7,7 @@ OpenJDK 8. - - --- begin of LICENSE --- - --Copyright (c) 2000-2011 France Télécom -+Copyright (c) 2000-2011 France T??l??com - All rights reserved. - - Redistribution and use in source and binary forms, with or without -@@ -1035,7 +1035,7 @@ JRE 8, JDK 8, and OpenJDK 8. - --- begin of LICENSE --- - - Copyright notice --Copyright © 2011 Ecma International -+Copyright ?? 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. - Unicode Terms of Use - - For the general privacy policy governing access to this site, see the Unicode --Privacy Policy. For trademark usage, see the Unicode® Consortium Name and -+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and - Trademark Usage Policy. - - A. Unicode Copyright. -- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. -+ 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. - - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative -- works conforming to the Unicode® Standard, subject to Terms and -+ works conforming to the Unicode?? Standard, subject to Terms and - Conditions herein. - - 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, -- Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of -+ Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of - Unicode, Inc. Use of the information and materials found on this -- website indicates your acknowledgement of Unicode, Inc.’s exclusive -+ website indicates your acknowledgement of Unicode, Inc.???s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - -- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark -- Policy”) are incorporated herein by reference and you agree to abide by -+ 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark -+ Policy???) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - -@@ -2632,12 +2632,12 @@ Miscellaneous. - - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not -- assign any part of this Agreement without Unicode’s prior written -+ assign any part of this Agreement without Unicode???s prior written - consent. - - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on -- Unicode’s net income. -+ Unicode???s net income. - - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - --Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the -+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy -diff --git a/hotspot/THIRD_PARTY_README b/hotspot/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 ---- a/hotspot/THIRD_PARTY_README -+++ b/hotspot/THIRD_PARTY_README -@@ -7,7 +7,7 @@ OpenJDK 8. - - --- begin of LICENSE --- - --Copyright (c) 2000-2011 France Télécom -+Copyright (c) 2000-2011 France T??l??com - All rights reserved. - - Redistribution and use in source and binary forms, with or without -@@ -1035,7 +1035,7 @@ JRE 8, JDK 8, and OpenJDK 8. - --- begin of LICENSE --- - - Copyright notice --Copyright © 2011 Ecma International -+Copyright ?? 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. - Unicode Terms of Use - - For the general privacy policy governing access to this site, see the Unicode --Privacy Policy. For trademark usage, see the Unicode® Consortium Name and -+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and - Trademark Usage Policy. - - A. Unicode Copyright. -- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. -+ 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. - - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative -- works conforming to the Unicode® Standard, subject to Terms and -+ works conforming to the Unicode?? Standard, subject to Terms and - Conditions herein. - - 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, -- Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of -+ Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of - Unicode, Inc. Use of the information and materials found on this -- website indicates your acknowledgement of Unicode, Inc.’s exclusive -+ website indicates your acknowledgement of Unicode, Inc.???s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - -- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark -- Policy”) are incorporated herein by reference and you agree to abide by -+ 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark -+ Policy???) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - -@@ -2632,12 +2632,12 @@ Miscellaneous. - - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not -- assign any part of this Agreement without Unicode’s prior written -+ assign any part of this Agreement without Unicode???s prior written - consent. - - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on -- Unicode’s net income. -+ Unicode???s net income. - - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - --Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the -+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/hotspot/agent/make/saenv.sh b/hotspot/agent/make/saenv.sh index ab9a0a43..a2de3fc3 100644 --- a/hotspot/agent/make/saenv.sh @@ -5193,7 +5013,7 @@ index ec414639..9ade73ab 100644 endif endif diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make -index 152fe260..94c6d1d0 100644 +index 9aeda9f8..41f523db 100644 --- a/hotspot/make/linux/makefiles/gcc.make +++ b/hotspot/make/linux/makefiles/gcc.make @@ -22,6 +22,12 @@ @@ -5652,7 +5472,7 @@ index 5449d866..09799824 100644 # shared is already in BASE_PATHS. Should add vm/memory but that one is also in BASE_PATHS. if [ -d "${ALTSRC}/share/vm/gc_implementation" ]; then diff --git a/hotspot/make/windows/makefiles/vm.make b/hotspot/make/windows/makefiles/vm.make -index 907fcda3..a3938c69 100644 +index ab2e8604..b04afec1 100644 --- a/hotspot/make/windows/makefiles/vm.make +++ b/hotspot/make/windows/makefiles/vm.make @@ -153,11 +153,6 @@ VM_PATH=$(VM_PATH);$(WorkSpace)/src/share/vm/gc_implementation/shared @@ -6119,7 +5939,7 @@ index 7ccdb35b..3b8cf4a1 100644 } diff --git a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp -index 27022fa6..6a328902 100644 +index 7234dbea..c0520983 100644 --- a/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp +++ b/hotspot/src/cpu/aarch64/vm/c1_LIRGenerator_aarch64.cpp @@ -39,10 +39,6 @@ @@ -6133,7 +5953,7 @@ index 27022fa6..6a328902 100644 #ifdef ASSERT #define __ gen()->lir(__FILE__, __LINE__)-> #else -@@ -281,18 +277,29 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { +@@ -283,18 +279,29 @@ void LIRGenerator::increment_counter(LIR_Address* addr, int step) { __ store(reg, addr); } @@ -6167,7 +5987,7 @@ index 27022fa6..6a328902 100644 bool LIRGenerator::strength_reduce_multiply(LIR_Opr left, int c, LIR_Opr result, LIR_Opr tmp) { -@@ -834,18 +841,19 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { +@@ -836,18 +843,19 @@ void LIRGenerator::do_CompareAndSwap(Intrinsic* x, ValueType* type) { LIR_Opr result = rlock_result(x); LIR_Opr ill = LIR_OprFact::illegalOpr; // for convenience @@ -6192,7 +6012,7 @@ index 27022fa6..6a328902 100644 if (type == objectType) { // Write-barrier needed for Object fields. // Seems to be precise post_barrier(addr, val.result()); -@@ -1440,12 +1448,6 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { +@@ -1442,12 +1450,6 @@ void LIRGenerator::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) { true /* do_load */, false /* patch */, NULL); } __ xchg(LIR_OprFact::address(addr), data, dst, tmp); @@ -15851,13 +15671,13 @@ index 00000000..ee48326b +#undef __ diff --git a/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp new file mode 100644 -index 00000000..7cb15f68 +index 00000000..e170bee5 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/c1_LIRGenerator_loongarch_64.cpp -@@ -0,0 +1,1442 @@ +@@ -0,0 +1,1444 @@ +/* + * Copyright (c) 2005, 2021, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2021, Loongson Technology. All rights reserved. ++ * Copyright (c) 2021, 2024, Loongson Technology. 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 @@ -16012,8 +15832,10 @@ index 00000000..7cb15f68 + if (index->is_register()) { + // apply the shift and accumulate the displacement + if (shift > 0) { -+ LIR_Opr tmp = new_pointer_register(); -+ __ shift_left(index, shift, tmp); ++ // Use long register to avoid overflow when shifting large index values left. ++ LIR_Opr tmp = new_register(T_LONG); ++ __ convert(Bytecodes::_i2l, index, tmp); ++ __ shift_left(tmp, shift, tmp); + index = tmp; + } + if (large_disp != 0) { @@ -19564,90 +19386,108 @@ index 00000000..70a47fc7 +#endif // !PRODUCT diff --git a/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp new file mode 100644 -index 00000000..1b40eab9 +index 00000000..cb655401 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/copy_loongarch.hpp -@@ -0,0 +1,72 @@ +@@ -0,0 +1,90 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2020, Loongson Technology. 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. -+ * -+ * This code is distributed in the hope that it will be useful, but WITHOUT -+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -+ * version 2 for more details (a copy is included in the LICENSE file that -+ * accompanied this code). -+ * -+ * You should have received a copy of the GNU General Public License version -+ * 2 along with this work; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ * -+ */ -+ -+#ifndef CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP -+#define CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP -+ -+// Inline functions for memory copy and fill. -+ -+// Contains inline asm implementations -+#ifdef TARGET_OS_ARCH_linux_loongarch -+# include "copy_linux_loongarch.inline.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_solaris_loongarch -+# include "copy_solaris_loongarch.inline.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_windows_loongarch -+# include "copy_windows_loongarch.inline.hpp" -+#endif -+#ifdef TARGET_OS_ARCH_bsd_loongarch -+# include "copy_bsd_loongarch.inline.hpp" -+#endif -+// Inline functions for memory copy and fill. -+ -+// Contains inline asm implementations -+ -+static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) { -+ julong* to = (julong*) tohw; -+ julong v = ((julong) value << 32) | value; -+ while (count-- > 0) { -+ *to++ = v; -+ } -+} -+ -+static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) { -+ pd_fill_to_words(tohw, count, value); -+} -+ -+static void pd_fill_to_bytes(void* to, size_t count, jubyte value) { -+ (void)memset(to, value, count); -+} -+ -+static void pd_zero_to_words(HeapWord* tohw, size_t count) { -+ pd_fill_to_words(tohw, count, 0); -+} -+ -+static void pd_zero_to_bytes(void* to, size_t count) { -+ (void)memset(to, 0, count); -+} -+ -+#endif //CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP -diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp -new file mode 100644 -index 00000000..45d86f5b ---- /dev/null -+++ b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp -@@ -0,0 +1,53 @@ -+/* -+ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. ++ * Copyright (c) 2015, 2023, Loongson Technology. 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. ++ * ++ * This code is distributed in the hope that it will be useful, but WITHOUT ++ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ++ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ++ * version 2 for more details (a copy is included in the LICENSE file that ++ * accompanied this code). ++ * ++ * You should have received a copy of the GNU General Public License version ++ * 2 along with this work; if not, write to the Free Software Foundation, ++ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ++ * ++ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ++ * or visit www.oracle.com if you need additional information or have any ++ * questions. ++ * ++ */ ++ ++#ifndef CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP ++#define CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP ++ ++// Inline functions for memory copy and fill. ++ ++// Contains inline asm implementations ++#ifdef TARGET_OS_ARCH_linux_loongarch ++# include "copy_linux_loongarch.inline.hpp" ++#endif ++#ifdef TARGET_OS_ARCH_solaris_loongarch ++# include "copy_solaris_loongarch.inline.hpp" ++#endif ++#ifdef TARGET_OS_ARCH_windows_loongarch ++# include "copy_windows_loongarch.inline.hpp" ++#endif ++#ifdef TARGET_OS_ARCH_bsd_loongarch ++# include "copy_bsd_loongarch.inline.hpp" ++#endif ++// Inline functions for memory copy and fill. ++ ++// Contains inline asm implementations ++ ++// Template for atomic, element-wise copy. ++template ++static void copy_conjoint_atomic(const T* from, T* to, size_t count) { ++ if (from > to) { ++ while (count-- > 0) { ++ // Copy forwards ++ *to++ = *from++; ++ } ++ } else { ++ from += count - 1; ++ to += count - 1; ++ while (count-- > 0) { ++ // Copy backwards ++ *to-- = *from--; ++ } ++ } ++} ++ ++static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) { ++ julong* to = (julong*) tohw; ++ julong v = ((julong) value << 32) | value; ++ while (count-- > 0) { ++ *to++ = v; ++ } ++} ++ ++static void pd_fill_to_aligned_words(HeapWord* tohw, size_t count, juint value) { ++ pd_fill_to_words(tohw, count, value); ++} ++ ++static void pd_fill_to_bytes(void* to, size_t count, jubyte value) { ++ (void)memset(to, value, count); ++} ++ ++static void pd_zero_to_words(HeapWord* tohw, size_t count) { ++ pd_fill_to_words(tohw, count, 0); ++} ++ ++static void pd_zero_to_bytes(void* to, size_t count) { ++ (void)memset(to, 0, count); ++} ++ ++#endif //CPU_LOONGARCH_VM_COPY_LOONGARCH_HPP +diff --git a/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp +new file mode 100644 +index 00000000..45d86f5b +--- /dev/null ++++ b/hotspot/src/cpu/loongarch/vm/cppInterpreterGenerator_loongarch.hpp +@@ -0,0 +1,53 @@ ++/* ++ * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2020, Loongson Technology. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * @@ -25216,10 +25056,10 @@ index 00000000..48c44779 +// diff --git a/hotspot/src/cpu/loongarch/vm/loongarch_64.ad b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad new file mode 100644 -index 00000000..c3514373 +index 00000000..fa4bf6e1 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/loongarch_64.ad -@@ -0,0 +1,12851 @@ +@@ -0,0 +1,12861 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. @@ -33435,9 +33275,8 @@ index 00000000..c3514373 + + // Now the shorter length is in cnt1 and cnt2 can be used as a tmp register + __ bind(Loop); // Loop begin -+ __ ld_hu(AT, str1, 0); + __ beq(cnt1, R0, done); -+ ++ __ ld_hu(AT, str1, 0); + // compare current character + __ ld_hu(cnt2, str2, 0); + __ addi_d(str1, str1, 2); @@ -35853,14 +35692,25 @@ index 00000000..c3514373 +%} + +// Store CMS card-mark Immediate 0 ++instruct storeImmCM_order(memory mem, immI_0 zero) %{ ++ match(Set mem (StoreCM mem zero)); ++ predicate(UseConcMarkSweepGC && !UseCondCardMark); ++ ins_cost(100); ++ format %{ "StoreCM MEMBAR storestore\n\t" ++ "st_b $mem, zero\t! card-mark imm0" %} ++ ins_encode %{ ++ __ membar(__ StoreStore); ++ __ loadstore_enc(R0, $mem$$base, $mem$$index, $mem$$scale, $mem$$disp, MacroAssembler::STORE_BYTE); ++ %} ++ ins_pipe( ialu_storeI ); ++%} ++ +instruct storeImmCM(memory mem, immI_0 zero) %{ + match(Set mem (StoreCM mem zero)); + + ins_cost(150); -+ format %{ "StoreCM MEMBAR loadstore\n\t" -+ "st_b $mem, zero\t! CMS card-mark imm0" %} ++ format %{ "st_b $mem, zero\t! card-mark imm0" %} + ins_encode %{ -+ __ membar(__ StoreStore); + __ loadstore_enc(R0, $mem$$base, $mem$$index, $mem$$scale, $mem$$disp, MacroAssembler::STORE_BYTE); + %} + ins_pipe( ialu_storeI ); @@ -45625,7 +45475,7 @@ index 00000000..e6ee65f3 +} diff --git a/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp new file mode 100644 -index 00000000..9efcd2ce +index 00000000..36786b53 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/sharedRuntime_loongarch_64.cpp @@ -0,0 +1,3453 @@ @@ -45949,9 +45799,9 @@ index 00000000..9efcd2ce +} + +// Is vector's size (in bytes) bigger than a size saved by default? -+// 16 bytes XMM registers are saved by default using fxsave/fxrstor instructions. ++// 8 bytes registers are saved by default using fld/fst instructions. +bool SharedRuntime::is_wide_vector(int size) { -+ return size > 16; ++ return size > 8; +} + +// The java_calling_convention describes stack locations as ideal slots on @@ -49084,7 +48934,7 @@ index 00000000..9efcd2ce +extern "C" int SpinPause() {return 0;} diff --git a/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp new file mode 100644 -index 00000000..b54857d4 +index 00000000..361b7751 --- /dev/null +++ b/hotspot/src/cpu/loongarch/vm/stubGenerator_loongarch_64.cpp @@ -0,0 +1,3445 @@ @@ -49893,7 +49743,7 @@ index 00000000..b54857d4 + const Register end = count; + + if (UseConcMarkSweepGC) { -+ __ membar(__ StoreLoad); ++ __ membar(__ StoreStore); + } + + int64_t disp = (int64_t) ct->byte_map_base; @@ -59809,7 +59659,7 @@ index 00000000..81ea3b23 + + if (supports_lsx()) { + if (FLAG_IS_DEFAULT(UseLSX)) { -+ //FLAG_SET_DEFAULT(UseLSX, true); ++ FLAG_SET_DEFAULT(UseLSX, true); + } + } else if (UseLSX) { + warning("LSX instructions are not available on this CPU"); @@ -59818,7 +59668,7 @@ index 00000000..81ea3b23 + + if (supports_lasx()) { + if (FLAG_IS_DEFAULT(UseLASX)) { -+ //FLAG_SET_DEFAULT(UseLASX, true); ++ FLAG_SET_DEFAULT(UseLASX, true); + } + } else if (UseLASX) { + warning("LASX instructions are not available on this CPU"); @@ -64559,13 +64409,13 @@ index 00000000..8ffaaaf8 +#endif // !PRODUCT diff --git a/hotspot/src/cpu/mips/vm/copy_mips.hpp b/hotspot/src/cpu/mips/vm/copy_mips.hpp new file mode 100644 -index 00000000..49fde179 +index 00000000..4442e1dc --- /dev/null +++ b/hotspot/src/cpu/mips/vm/copy_mips.hpp -@@ -0,0 +1,72 @@ +@@ -0,0 +1,90 @@ +/* + * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. -+ * Copyright (c) 2015, 2016, Loongson Technology. All rights reserved. ++ * Copyright (c) 2015, 2023, Loongson Technology. 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 @@ -64610,6 +64460,24 @@ index 00000000..49fde179 + +// Contains inline asm implementations + ++// Template for atomic, element-wise copy. ++template ++static void copy_conjoint_atomic(const T* from, T* to, size_t count) { ++ if (from > to) { ++ while (count-- > 0) { ++ // Copy forwards ++ *to++ = *from++; ++ } ++ } else { ++ from += count - 1; ++ to += count - 1; ++ while (count-- > 0) { ++ // Copy backwards ++ *to-- = *from--; ++ } ++ } ++} ++ +static void pd_fill_to_words(HeapWord* tohw, size_t count, juint value) { + julong* to = (julong*) tohw; + julong v = ((julong) value << 32) | value; @@ -76242,10 +76110,10 @@ index 00000000..3563bbe0 + diff --git a/hotspot/src/cpu/mips/vm/mips_64.ad b/hotspot/src/cpu/mips/vm/mips_64.ad new file mode 100644 -index 00000000..2d714c8b +index 00000000..29125913 --- /dev/null +++ b/hotspot/src/cpu/mips/vm/mips_64.ad -@@ -0,0 +1,14035 @@ +@@ -0,0 +1,14036 @@ +// +// Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2015, 2022, Loongson Technology. All rights reserved. @@ -86075,7 +85943,8 @@ index 00000000..2d714c8b + // Now the shorter length is in cnt1 and cnt2 can be used as a tmp register + __ bind(Loop); // Loop begin + __ beq(cnt1, R0, done); -+ __ delayed()->lhu(AT, str1, 0);; ++ __ delayed()->nop(); ++ __ lhu(AT, str1, 0); + + // compare current character + __ lhu(cnt2, str2, 0); @@ -110774,7 +110643,7 @@ index 51190d1a..e36604fa 100644 // Min Instructions diff --git a/hotspot/src/os/linux/vm/os_linux.cpp b/hotspot/src/os/linux/vm/os_linux.cpp -index ba1bce42..42a73ea5 100644 +index 5629a640..68d5f514 100644 --- a/hotspot/src/os/linux/vm/os_linux.cpp +++ b/hotspot/src/os/linux/vm/os_linux.cpp @@ -22,6 +22,12 @@ @@ -110790,19 +110659,15 @@ index ba1bce42..42a73ea5 100644 // no precompiled headers #include "classfile/classLoader.hpp" #include "classfile/systemDictionary.hpp" -@@ -1969,7 +1975,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) +@@ -1972,6 +1978,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {EM_ALPHA, EM_ALPHA, ELFCLASS64, ELFDATA2LSB, (char*)"Alpha"}, {EM_MIPS_RS3_LE, EM_MIPS_RS3_LE, ELFCLASS32, ELFDATA2LSB, (char*)"MIPSel"}, {EM_MIPS, EM_MIPS, ELFCLASS32, ELFDATA2MSB, (char*)"MIPS"}, + {EM_MIPS, EM_MIPS, ELFCLASS64, ELFDATA2LSB, (char*)"MIPS64 LE"}, {EM_PARISC, EM_PARISC, ELFCLASS32, ELFDATA2MSB, (char*)"PARISC"}, -+#if defined (LOONGARCH64) -+ {EM_LOONGARCH, EM_LOONGARCH, ELFCLASS64, ELFDATA2LSB, (char*)"LOONGARCH64"}, -+#endif {EM_68K, EM_68K, ELFCLASS32, ELFDATA2MSB, (char*)"M68k"}, {EM_AARCH64, EM_AARCH64, ELFCLASS64, ELFDATA2LSB, (char*)"AARCH64"}, - }; -@@ -1984,6 +1994,8 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) +@@ -1988,6 +1995,8 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) static Elf32_Half running_arch_code=EM_SPARCV9; #elif (defined __sparc) && (!defined _LP64) static Elf32_Half running_arch_code=EM_SPARC; @@ -110811,20 +110676,16 @@ index ba1bce42..42a73ea5 100644 #elif (defined __powerpc64__) static Elf32_Half running_arch_code=EM_PPC64; #elif (defined __powerpc__) -@@ -2004,9 +2016,11 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) - static Elf32_Half running_arch_code=EM_68K; - #elif (defined AARCH64) - static Elf32_Half running_arch_code=EM_AARCH64; -+ #elif (defined LOONGARCH64) -+ static Elf32_Half running_arch_code=EM_LOONGARCH; +@@ -2012,7 +2021,7 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) + static Elf32_Half running_arch_code=EM_LOONGARCH; #else #error Method os::dll_load requires that one of following is defined:\ -- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64 -+ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, __mips64, PARISC, M68K, AARCH64 +- IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, PARISC, M68K, AARCH64, LOONGARCH64 ++ IA32, AMD64, IA64, __sparc, __powerpc__, ARM, S390, ALPHA, MIPS, MIPSEL, __mips64, PARISC, M68K, AARCH64, LOONGARCH64 #endif // Identify compatability class for VM's architecture and library's architecture -@@ -3513,7 +3527,7 @@ size_t os::Linux::find_large_page_size() { +@@ -3519,7 +3528,7 @@ size_t os::Linux::find_large_page_size() { #ifndef ZERO large_page_size = IA32_ONLY(4 * M) AMD64_ONLY(2 * M) IA64_ONLY(256 * M) SPARC_ONLY(4 * M) @@ -110833,7 +110694,7 @@ index ba1bce42..42a73ea5 100644 #endif // ZERO FILE *fp = fopen("/proc/meminfo", "r"); -@@ -5120,7 +5134,12 @@ jint os::init_2(void) +@@ -5126,7 +5135,12 @@ jint os::init_2(void) Linux::fast_thread_clock_init(); // Allocate a single page and mark it as readable for safepoint polling @@ -110846,7 +110707,7 @@ index ba1bce42..42a73ea5 100644 guarantee( polling_page != MAP_FAILED, "os::init_2: failed to allocate polling page" ); os::set_polling_page( polling_page ); -@@ -5155,13 +5174,20 @@ jint os::init_2(void) +@@ -5161,13 +5175,20 @@ jint os::init_2(void) // size. Add a page for compiler2 recursion in main thread. // Add in 2*BytesPerWord times page size to account for VM stack during // class initialization depending on 32 or 64 bit VM. @@ -115546,10 +115407,10 @@ index 52044f12..50c58587 100644 AD.addInclude(AD._CPP_file, "assembler_aarch64.inline.hpp"); AD.addInclude(AD._CPP_file, "nativeInst_aarch64.hpp"); diff --git a/hotspot/src/share/vm/adlc/output_c.cpp b/hotspot/src/share/vm/adlc/output_c.cpp -index 088f4f80..19916904 100644 +index 20f60eb8..b85123b4 100644 --- a/hotspot/src/share/vm/adlc/output_c.cpp +++ b/hotspot/src/share/vm/adlc/output_c.cpp -@@ -3246,6 +3246,10 @@ void ArchDesc::defineClasses(FILE *fp) { +@@ -3248,6 +3248,10 @@ void ArchDesc::defineClasses(FILE *fp) { // Analyze machine instructions that either USE or DEF memory. int memory_operand = instr->memory_operand(_globalNames); @@ -116780,7 +116641,7 @@ index effa6a83..ac0f4e7a 100644 # include "c1_LIRAssembler_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp -index 55c51bed..c66f3102 100644 +index 65206f5c..d1a987c6 100644 --- a/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp +++ b/hotspot/src/share/vm/c1/c1_LIRGenerator.cpp @@ -22,6 +22,12 @@ @@ -116805,7 +116666,7 @@ index 55c51bed..c66f3102 100644 #include "runtime/sharedRuntime.hpp" #include "runtime/stubRoutines.hpp" #include "utilities/bitMap.inline.hpp" -@@ -484,13 +488,11 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, +@@ -485,13 +489,11 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, CodeEmitInfo* null_check_info, CodeEmitInfo* range_check_info) { CodeStub* stub = new RangeCheckStub(range_check_info, index); if (index->is_constant()) { @@ -116823,7 +116684,7 @@ index 55c51bed..c66f3102 100644 } } -@@ -498,12 +500,10 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, +@@ -499,12 +501,10 @@ void LIRGenerator::array_range_check(LIR_Opr array, LIR_Opr index, void LIRGenerator::nio_range_check(LIR_Opr buffer, LIR_Opr index, LIR_Opr result, CodeEmitInfo* info) { CodeStub* stub = new RangeCheckStub(info, index, true); if (index->is_constant()) { @@ -116839,7 +116700,7 @@ index 55c51bed..c66f3102 100644 } __ move(index, result); } -@@ -936,7 +936,7 @@ LIR_Opr LIRGenerator::force_to_spill(LIR_Opr value, BasicType t) { +@@ -937,7 +937,7 @@ LIR_Opr LIRGenerator::force_to_spill(LIR_Opr value, BasicType t) { return tmp; } @@ -116848,7 +116709,7 @@ index 55c51bed..c66f3102 100644 if (if_instr->should_profile()) { ciMethod* method = if_instr->profiled_method(); assert(method != NULL, "method should be set if branch is profiled"); -@@ -957,10 +957,17 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { +@@ -958,10 +958,17 @@ void LIRGenerator::profile_branch(If* if_instr, If::Condition cond) { __ metadata2reg(md->constant_encoding(), md_reg); LIR_Opr data_offset_reg = new_pointer_register(); @@ -116870,7 +116731,7 @@ index 55c51bed..c66f3102 100644 // MDO cells are intptr_t, so the data_reg width is arch-dependent. LIR_Opr data_reg = new_pointer_register(); -@@ -1231,15 +1238,6 @@ void LIRGenerator::do_Reference_get(Intrinsic* x) { +@@ -1232,15 +1239,6 @@ void LIRGenerator::do_Reference_get(Intrinsic* x) { LIR_Opr result = rlock_result(x); @@ -116886,7 +116747,7 @@ index 55c51bed..c66f3102 100644 __ load(referent_field_adr, result, info); // Register the value in the referent field with the pre-barrier -@@ -1316,8 +1314,8 @@ void LIRGenerator::do_isPrimitive(Intrinsic* x) { +@@ -1317,8 +1315,8 @@ void LIRGenerator::do_isPrimitive(Intrinsic* x) { } __ move(new LIR_Address(rcvr.result(), java_lang_Class::klass_offset_in_bytes(), T_ADDRESS), temp, info); @@ -116897,7 +116758,7 @@ index 55c51bed..c66f3102 100644 } // Example: Thread.currentThread() -@@ -1451,11 +1449,6 @@ void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, +@@ -1452,11 +1450,6 @@ void LIRGenerator::pre_barrier(LIR_Opr addr_opr, LIR_Opr pre_val, case BarrierSet::G1SATBCTLogging: G1SATBCardTableModRef_pre_barrier(addr_opr, pre_val, do_load, patch, info); break; @@ -116909,7 +116770,7 @@ index 55c51bed..c66f3102 100644 #endif // INCLUDE_ALL_GCS case BarrierSet::CardTableModRef: case BarrierSet::CardTableExtension: -@@ -1478,9 +1471,6 @@ void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) { +@@ -1479,9 +1472,6 @@ void LIRGenerator::post_barrier(LIR_OprDesc* addr, LIR_OprDesc* new_val) { case BarrierSet::G1SATBCTLogging: G1SATBCardTableModRef_post_barrier(addr, new_val); break; @@ -116919,7 +116780,7 @@ index 55c51bed..c66f3102 100644 #endif // INCLUDE_ALL_GCS case BarrierSet::CardTableModRef: case BarrierSet::CardTableExtension: -@@ -1518,7 +1508,6 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p +@@ -1519,7 +1509,6 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p // Read the marking-in-progress flag. LIR_Opr flag_val = new_register(T_INT); __ load(mark_active_flag_addr, flag_val); @@ -116927,7 +116788,7 @@ index 55c51bed..c66f3102 100644 LIR_PatchCode pre_val_patch_code = lir_patch_none; -@@ -1547,7 +1536,7 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p +@@ -1548,7 +1537,7 @@ void LIRGenerator::G1SATBCardTableModRef_pre_barrier(LIR_Opr addr_opr, LIR_Opr p slow = new G1PreBarrierStub(pre_val); } @@ -116936,7 +116797,7 @@ index 55c51bed..c66f3102 100644 __ branch_destination(slow->continuation()); } -@@ -1605,10 +1594,8 @@ void LIRGenerator::G1SATBCardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_Opr +@@ -1606,10 +1595,8 @@ void LIRGenerator::G1SATBCardTableModRef_post_barrier(LIR_OprDesc* addr, LIR_Opr } assert(new_val->is_register(), "must be a register at this point"); @@ -116948,7 +116809,7 @@ index 55c51bed..c66f3102 100644 __ branch_destination(slow->continuation()); } -@@ -1847,33 +1834,16 @@ void LIRGenerator::do_LoadField(LoadField* x) { +@@ -1848,33 +1835,16 @@ void LIRGenerator::do_LoadField(LoadField* x) { address = generate_address(object.result(), x->offset(), field_type); } @@ -116983,7 +116844,7 @@ index 55c51bed..c66f3102 100644 } -@@ -1895,12 +1865,10 @@ void LIRGenerator::do_NIOCheckIndex(Intrinsic* x) { +@@ -1896,12 +1866,10 @@ void LIRGenerator::do_NIOCheckIndex(Intrinsic* x) { CodeEmitInfo* info = state_for(x); CodeStub* stub = new RangeCheckStub(info, index.result(), true); if (index.result()->is_constant()) { @@ -116999,7 +116860,7 @@ index 55c51bed..c66f3102 100644 } __ move(index.result(), result); } else { -@@ -1981,8 +1949,8 @@ void LIRGenerator::do_LoadIndexed(LoadIndexed* x) { +@@ -1982,8 +1950,8 @@ void LIRGenerator::do_LoadIndexed(LoadIndexed* x) { } else if (use_length) { // TODO: use a (modified) version of array_range_check that does not require a // constant length to be loaded to a register @@ -117010,7 +116871,7 @@ index 55c51bed..c66f3102 100644 } else { array_range_check(array.result(), index.result(), null_check_info, range_check_info); // The range check performs the null check, so clear it out for the load -@@ -1990,19 +1958,7 @@ void LIRGenerator::do_LoadIndexed(LoadIndexed* x) { +@@ -1991,19 +1959,7 @@ void LIRGenerator::do_LoadIndexed(LoadIndexed* x) { } } @@ -117031,7 +116892,7 @@ index 55c51bed..c66f3102 100644 } -@@ -2176,7 +2132,7 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) { +@@ -2177,7 +2133,7 @@ void LIRGenerator::do_UnsafeGetRaw(UnsafeGetRaw* x) { assert(index_op->type() == T_INT, "only int constants supported"); addr = new LIR_Address(base_op, index_op->as_jint(), dst_type); } else { @@ -117040,7 +116901,7 @@ index 55c51bed..c66f3102 100644 addr = new LIR_Address(base_op, index_op, LIR_Address::Scale(log2_scale), 0, dst_type); #elif defined(GENERATE_ADDRESS_IS_PREFERRED) addr = generate_address(base_op, index_op, log2_scale, 0, dst_type); -@@ -2291,14 +2247,6 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { +@@ -2292,14 +2248,6 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { LIR_Opr value = rlock_result(x, x->basic_type()); @@ -117055,7 +116916,7 @@ index 55c51bed..c66f3102 100644 get_Object_unsafe(value, src.result(), off.result(), type, x->is_volatile()); #if INCLUDE_ALL_GCS -@@ -2317,7 +2265,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { +@@ -2318,7 +2266,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { // } // } @@ -117064,7 +116925,7 @@ index 55c51bed..c66f3102 100644 bool gen_pre_barrier = true; // Assume we need to generate pre_barrier. bool gen_offset_check = true; // Assume we need to generate the offset guard. bool gen_source_check = true; // Assume we need to check the src object for null. -@@ -2399,19 +2347,18 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { +@@ -2400,19 +2348,18 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { if (off.type()->is_int()) { referent_off = LIR_OprFact::intConst(java_lang_ref_Reference::referent_offset); @@ -117087,7 +116948,7 @@ index 55c51bed..c66f3102 100644 } LIR_Opr src_klass = new_register(T_METADATA); if (gen_type_check) { -@@ -2421,8 +2368,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { +@@ -2422,8 +2369,7 @@ void LIRGenerator::do_UnsafeGetObject(UnsafeGetObject* x) { LIR_Address* reference_type_addr = new LIR_Address(src_klass, in_bytes(InstanceKlass::reference_type_offset()), T_BYTE); LIR_Opr reference_type = new_register(T_INT); __ move(reference_type_addr, reference_type); @@ -117097,7 +116958,7 @@ index 55c51bed..c66f3102 100644 } { // We have determined that src->_klass->_reference_type != REF_NONE -@@ -2502,19 +2448,14 @@ void LIRGenerator::do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegi +@@ -2503,19 +2449,14 @@ void LIRGenerator::do_SwitchRanges(SwitchRangeArray* x, LIR_Opr value, BlockBegi int high_key = one_range->high_key(); BlockBegin* dest = one_range->sux(); if (low_key == high_key) { @@ -117122,7 +116983,7 @@ index 55c51bed..c66f3102 100644 __ branch_destination(L->label()); } } -@@ -2601,8 +2542,7 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) { +@@ -2602,8 +2543,7 @@ void LIRGenerator::do_TableSwitch(TableSwitch* x) { do_SwitchRanges(create_lookup_ranges(x), value, x->default_sux()); } else { for (int i = 0; i < len; i++) { @@ -117132,7 +116993,7 @@ index 55c51bed..c66f3102 100644 } __ jump(x->default_sux()); } -@@ -2627,8 +2567,7 @@ void LIRGenerator::do_LookupSwitch(LookupSwitch* x) { +@@ -2628,8 +2568,7 @@ void LIRGenerator::do_LookupSwitch(LookupSwitch* x) { } else { int len = x->length(); for (int i = 0; i < len; i++) { @@ -117142,7 +117003,7 @@ index 55c51bed..c66f3102 100644 } __ jump(x->default_sux()); } -@@ -2680,7 +2619,6 @@ void LIRGenerator::do_Goto(Goto* x) { +@@ -2681,7 +2620,6 @@ void LIRGenerator::do_Goto(Goto* x) { } LIR_Opr md_reg = new_register(T_METADATA); __ metadata2reg(md->constant_encoding(), md_reg); @@ -117150,7 +117011,7 @@ index 55c51bed..c66f3102 100644 increment_counter(new LIR_Address(md_reg, offset, NOT_LP64(T_INT) LP64_ONLY(T_LONG)), DataLayout::counter_increment); } -@@ -3134,8 +3072,8 @@ void LIRGenerator::do_IfOp(IfOp* x) { +@@ -3135,8 +3073,8 @@ void LIRGenerator::do_IfOp(IfOp* x) { f_val.dont_load_item(); LIR_Opr reg = rlock_result(x); @@ -117161,7 +117022,7 @@ index 55c51bed..c66f3102 100644 } #ifdef JFR_HAVE_INTRINSICS -@@ -3175,8 +3113,7 @@ void LIRGenerator::do_getEventWriter(Intrinsic* x) { +@@ -3176,8 +3114,7 @@ void LIRGenerator::do_getEventWriter(Intrinsic* x) { T_OBJECT); LIR_Opr result = rlock_result(x); __ move_wide(jobj_addr, result); @@ -117171,7 +117032,7 @@ index 55c51bed..c66f3102 100644 __ move_wide(new LIR_Address(result, T_OBJECT), result); __ branch_destination(L_end->label()); -@@ -3540,10 +3477,9 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, +@@ -3541,10 +3478,9 @@ void LIRGenerator::increment_event_counter_impl(CodeEmitInfo* info, LIR_Opr meth = new_register(T_METADATA); __ metadata2reg(method->constant_encoding(), meth); __ logical_and(result, mask, result); @@ -117183,7 +117044,7 @@ index 55c51bed..c66f3102 100644 __ branch_destination(overflow->continuation()); } } -@@ -3655,8 +3591,7 @@ void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) { +@@ -3656,8 +3592,7 @@ void LIRGenerator::do_RangeCheckPredicate(RangeCheckPredicate *x) { CodeEmitInfo *info = state_for(x, x->state()); CodeStub* stub = new PredicateFailedStub(info); @@ -117193,7 +117054,7 @@ index 55c51bed..c66f3102 100644 } } -@@ -3804,8 +3739,7 @@ LIR_Opr LIRGenerator::maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr +@@ -3805,8 +3740,7 @@ LIR_Opr LIRGenerator::maybe_mask_boolean(StoreIndexed* x, LIR_Opr array, LIR_Opr __ move(new LIR_Address(klass, in_bytes(Klass::layout_helper_offset()), T_INT), layout); int diffbit = Klass::layout_helper_boolean_diffbit(); __ logical_and(layout, LIR_OprFact::intConst(diffbit), layout); @@ -117464,7 +117325,7 @@ index 7e22bbaa..12aca7bf 100644 # include "c1_MacroAssembler_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/c1/c1_Runtime1.cpp b/hotspot/src/share/vm/c1/c1_Runtime1.cpp -index b8137e7c..f1253506 100644 +index 1b29fb19..cfcdb43d 100644 --- a/hotspot/src/share/vm/c1/c1_Runtime1.cpp +++ b/hotspot/src/share/vm/c1/c1_Runtime1.cpp @@ -22,6 +22,12 @@ @@ -117480,19 +117341,18 @@ index b8137e7c..f1253506 100644 #include "precompiled.hpp" #include "asm/codeBuffer.hpp" #include "c1/c1_CodeStubs.hpp" -@@ -58,10 +64,7 @@ - #include "runtime/vframeArray.hpp" +@@ -59,10 +65,6 @@ #include "utilities/copy.hpp" #include "utilities/events.hpp" + #include "utilities/exceptions.hpp" -#include "utilities/macros.hpp" -#if INCLUDE_ALL_GCS -#include "gc_implementation/shenandoah/shenandoahBarrierSet.inline.hpp" -#endif -+ - // Implementation of StubAssembler -@@ -202,7 +205,6 @@ void Runtime1::generate_blob_for(BufferBlob* buffer_blob, StubID id) { + // Implementation of StubAssembler +@@ -204,7 +206,6 @@ void Runtime1::generate_blob_for(BufferBlob* buffer_blob, StubID id) { case dtrace_object_alloc_id: case g1_pre_barrier_slow_id: case g1_post_barrier_slow_id: @@ -117500,7 +117360,7 @@ index b8137e7c..f1253506 100644 case slow_subtype_check_id: case fpu2long_stub_id: case unwind_exception_id: -@@ -714,6 +716,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread)) +@@ -717,6 +718,7 @@ JRT_ENTRY(void, Runtime1::deoptimize(JavaThread* thread)) // Return to the now deoptimized frame. JRT_END @@ -117508,7 +117368,7 @@ index b8137e7c..f1253506 100644 static Klass* resolve_field_return_klass(methodHandle caller, int bci, TRAPS) { Bytecode_field field_access(caller, bci); -@@ -1190,6 +1193,47 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i +@@ -1193,6 +1195,47 @@ JRT_ENTRY(void, Runtime1::patch_code(JavaThread* thread, Runtime1::StubID stub_i } JRT_END @@ -117556,7 +117416,7 @@ index b8137e7c..f1253506 100644 // // Entry point for compiled code. We want to patch a nmethod. // We don't do a normal VM transition here because we want to -@@ -1310,13 +1354,6 @@ template int obj_arraycopy_work(oopDesc* src, T* src_addr, +@@ -1313,13 +1356,6 @@ template int obj_arraycopy_work(oopDesc* src, T* src_addr, BarrierSet* bs = Universe::heap()->barrier_set(); assert(bs->has_write_ref_array_opt(), "Barrier set must have ref array opt"); assert(bs->has_write_ref_array_pre_opt(), "For pre-barrier as well."); @@ -117714,7 +117574,7 @@ index fb21c916..b9e0fc2c 100644 #include "runtime/vm_operations.hpp" #include "services/diagnosticCommand.hpp" diff --git a/hotspot/src/share/vm/classfile/javaClasses.cpp b/hotspot/src/share/vm/classfile/javaClasses.cpp -index 97a10ac0..fe3474ef 100644 +index 21af8108..ab9547c7 100644 --- a/hotspot/src/share/vm/classfile/javaClasses.cpp +++ b/hotspot/src/share/vm/classfile/javaClasses.cpp @@ -52,10 +52,6 @@ @@ -117749,7 +117609,7 @@ index 97a10ac0..fe3474ef 100644 } oop java_lang_Throwable::backtrace(oop throwable) { -@@ -2659,18 +2648,11 @@ HeapWord *java_lang_ref_Reference::pending_list_lock_addr() { +@@ -2658,18 +2647,11 @@ HeapWord *java_lang_ref_Reference::pending_list_lock_addr() { oop java_lang_ref_Reference::pending_list_lock() { InstanceKlass* ik = InstanceKlass::cast(SystemDictionary::Reference_klass()); address addr = ik->static_field_addr(static_lock_offset); @@ -117770,7 +117630,7 @@ index 97a10ac0..fe3474ef 100644 } HeapWord *java_lang_ref_Reference::pending_list_addr() { -@@ -2682,18 +2664,11 @@ HeapWord *java_lang_ref_Reference::pending_list_addr() { +@@ -2681,18 +2663,11 @@ HeapWord *java_lang_ref_Reference::pending_list_addr() { oop java_lang_ref_Reference::pending_list() { char *addr = (char *)pending_list_addr(); @@ -117822,10 +117682,10 @@ index a36a7ba3..d7c1f086 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp -index 8ab616ff..8dd4e6b2 100644 +index b7ae43e6..810945d2 100644 --- a/hotspot/src/share/vm/classfile/symbolTable.cpp +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp -@@ -721,7 +721,7 @@ static void ensure_string_alive(oop string) { +@@ -740,7 +740,7 @@ static void ensure_string_alive(oop string) { // considered dead. The SATB part of G1 needs to get notified about this // potential resurrection, otherwise the marking might not find the object. #if INCLUDE_ALL_GCS @@ -117834,7 +117694,7 @@ index 8ab616ff..8dd4e6b2 100644 G1SATBCardTableModRefBS::enqueue(string); } #endif -@@ -926,28 +926,6 @@ void StringTable::possibly_parallel_oops_do(OopClosure* f) { +@@ -945,28 +945,6 @@ void StringTable::possibly_parallel_oops_do(OopClosure* f) { } } @@ -117876,7 +117736,7 @@ index 2fbe5050..58fd2234 100644 // Hashing algorithm, used as the hash value used by the // StringTable for bucket selection and comparison (stored in the diff --git a/hotspot/src/share/vm/classfile/verifier.cpp b/hotspot/src/share/vm/classfile/verifier.cpp -index c653e2b5..1a6b7e8b 100644 +index 2dddd1fd..4a20d15f 100644 --- a/hotspot/src/share/vm/classfile/verifier.cpp +++ b/hotspot/src/share/vm/classfile/verifier.cpp @@ -22,6 +22,12 @@ @@ -148061,7 +147921,7 @@ index b814b88d..e1f24216 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodes.cpp b/hotspot/src/share/vm/interpreter/bytecodes.cpp -index fdb880a3..4f511107 100644 +index ce5632ea..7f8e8801 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.cpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.cpp @@ -22,6 +22,12 @@ @@ -148091,7 +147951,7 @@ index fdb880a3..4f511107 100644 # include "bytes_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/bytecodes.hpp b/hotspot/src/share/vm/interpreter/bytecodes.hpp -index c3463cd7..bdf4c487 100644 +index 3105fa28..9cfebdda 100644 --- a/hotspot/src/share/vm/interpreter/bytecodes.hpp +++ b/hotspot/src/share/vm/interpreter/bytecodes.hpp @@ -22,6 +22,12 @@ @@ -148241,7 +148101,7 @@ index 1dc7cb29..92bbe6b4 100644 # include "interpreterGenerator_aarch64.hpp" #endif diff --git a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp -index 5d284538..f48622f6 100644 +index 425ad7f4..c428b91f 100644 --- a/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp +++ b/hotspot/src/share/vm/interpreter/interpreterRuntime.cpp @@ -22,6 +22,12 @@ @@ -148257,7 +148117,7 @@ index 5d284538..f48622f6 100644 #include "precompiled.hpp" #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" -@@ -59,6 +65,12 @@ +@@ -60,6 +66,12 @@ #ifdef TARGET_ARCH_x86 # include "vm_version_x86.hpp" #endif @@ -148270,7 +148130,7 @@ index 5d284538..f48622f6 100644 #ifdef TARGET_ARCH_aarch64 # include "vm_version_aarch64.hpp" #endif -@@ -1290,7 +1302,7 @@ IRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* thread, Meth +@@ -1292,7 +1304,7 @@ IRT_ENTRY(void, InterpreterRuntime::prepare_native_call(JavaThread* thread, Meth // preparing the same method will be sure to see non-null entry & mirror. IRT_END @@ -149074,7 +148934,7 @@ index 0e4e322a..038550cc 100644 GenCollectorPolicy *gc_policy; diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp -index ec111df0..6c060710 100644 +index 635bf6d1..18822d9f 100644 --- a/hotspot/src/share/vm/oops/constantPool.hpp +++ b/hotspot/src/share/vm/oops/constantPool.hpp @@ -22,6 +22,12 @@ @@ -149421,7 +149281,7 @@ index 8a460394..b28bb991 100644 #endif // SHARE_VM_OOPS_OOP_PCGC_INLINE_HPP diff --git a/hotspot/src/share/vm/opto/addnode.cpp b/hotspot/src/share/vm/opto/addnode.cpp -index 61b376e9..e56cfa9b 100644 +index e6d90b43..22bfcfde 100644 --- a/hotspot/src/share/vm/opto/addnode.cpp +++ b/hotspot/src/share/vm/opto/addnode.cpp @@ -31,9 +31,6 @@ @@ -149874,10 +149734,10 @@ index ac0aca92..dadc7272 100644 // ---------------------------------------------------------------------------- // Build a table of virtual functions to map from Nodes to dense integer diff --git a/hotspot/src/share/vm/opto/classes.hpp b/hotspot/src/share/vm/opto/classes.hpp -index 8ffcd3d1..c4a964fd 100644 +index a7044394..7503d81b 100644 --- a/hotspot/src/share/vm/opto/classes.hpp +++ b/hotspot/src/share/vm/opto/classes.hpp -@@ -230,9 +230,6 @@ macro(RoundDouble) +@@ -232,9 +232,6 @@ macro(RoundDouble) macro(RoundFloat) macro(SafePoint) macro(SafePointScalarObject) @@ -150199,7 +150059,7 @@ index ca44306f..d263ee2f 100644 #endif // SHARE_VM_OPTO_COMPILE_HPP diff --git a/hotspot/src/share/vm/opto/connode.cpp b/hotspot/src/share/vm/opto/connode.cpp -index 45989642..ff56804d 100644 +index e6faec5c..6c0b68a8 100644 --- a/hotspot/src/share/vm/opto/connode.cpp +++ b/hotspot/src/share/vm/opto/connode.cpp @@ -543,6 +543,20 @@ void CastIINode::dump_spec(outputStream *st) const { @@ -150235,7 +150095,7 @@ index 45989642..ff56804d 100644 const Type *t = phase->type( in(1) ); if( t == Type::TOP ) return in(1); diff --git a/hotspot/src/share/vm/opto/connode.hpp b/hotspot/src/share/vm/opto/connode.hpp -index 810e8874..21c22762 100644 +index 57fead2a..a24c1359 100644 --- a/hotspot/src/share/vm/opto/connode.hpp +++ b/hotspot/src/share/vm/opto/connode.hpp @@ -281,6 +281,7 @@ public: @@ -150544,7 +150404,7 @@ index 41a067ce..0cd6d686 100644 if (UseImplicitStableValues) { load = cast_array_to_stable(load, value_type); diff --git a/hotspot/src/share/vm/opto/ifnode.cpp b/hotspot/src/share/vm/opto/ifnode.cpp -index d21b1ade..68f068d0 100644 +index e955ff77..51579032 100644 --- a/hotspot/src/share/vm/opto/ifnode.cpp +++ b/hotspot/src/share/vm/opto/ifnode.cpp @@ -23,7 +23,6 @@ @@ -150797,7 +150657,7 @@ index df0fecdd..c54f1035 100644 Node *u_ctrl = _phase->ctrl_or_self(use); // self if use is a CFG if (_phase->is_dominator(n_ctrl, u_ctrl)) { diff --git a/hotspot/src/share/vm/opto/loopnode.cpp b/hotspot/src/share/vm/opto/loopnode.cpp -index aec7e8e9..957929e5 100644 +index 2e1a2e4c..8c92ffff 100644 --- a/hotspot/src/share/vm/opto/loopnode.cpp +++ b/hotspot/src/share/vm/opto/loopnode.cpp @@ -37,10 +37,6 @@ @@ -150811,7 +150671,7 @@ index aec7e8e9..957929e5 100644 //============================================================================= //------------------------------is_loop_iv------------------------------------- // Determine if a node is Counted loop induction variable. -@@ -2360,12 +2356,6 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts) +@@ -2628,12 +2624,6 @@ void PhaseIdealLoop::build_and_optimize(bool do_split_ifs, bool skip_loop_opts) C->set_major_progress(); } @@ -150824,7 +150684,7 @@ index aec7e8e9..957929e5 100644 // Cleanup any modified bits _igvn.optimize(); -@@ -3357,10 +3347,7 @@ Node *PhaseIdealLoop::get_late_ctrl( Node *n, Node *early ) { +@@ -3625,10 +3615,7 @@ Node *PhaseIdealLoop::get_late_ctrl( Node *n, Node *early ) { } while(worklist.size() != 0 && LCA != early) { Node* s = worklist.pop(); @@ -150836,7 +150696,7 @@ index aec7e8e9..957929e5 100644 continue; } else if (s->is_MergeMem()) { for (DUIterator_Fast imax, i = s->fast_outs(imax); i < imax; i++) { -@@ -3592,9 +3579,6 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) { +@@ -3860,9 +3847,6 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) { case Op_AryEq: pinned = false; } @@ -150846,7 +150706,7 @@ index aec7e8e9..957929e5 100644 if( pinned ) { IdealLoopTree *chosen_loop = get_loop(n->is_CFG() ? n : get_ctrl(n)); if( !chosen_loop->_child ) // Inner loop? -@@ -3649,35 +3633,8 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) { +@@ -3917,35 +3901,8 @@ void PhaseIdealLoop::build_loop_late_post( Node *n ) { // which can inhibit range check elimination. if (least != early) { Node* ctrl_out = least->unique_ctrl_out(); @@ -150883,7 +150743,7 @@ index aec7e8e9..957929e5 100644 Node* least_dom = idom(least); if (get_loop(least_dom)->is_member(get_loop(least))) { least = least_dom; -@@ -3863,7 +3820,6 @@ void PhaseIdealLoop::dump( IdealLoopTree *loop, uint idx, Node_List &rpo_list ) +@@ -4131,7 +4088,6 @@ void PhaseIdealLoop::dump( IdealLoopTree *loop, uint idx, Node_List &rpo_list ) } } } @@ -150891,7 +150751,7 @@ index aec7e8e9..957929e5 100644 // Collect a R-P-O for the whole CFG. // Result list is in post-order (scan backwards for RPO) -@@ -3886,6 +3842,7 @@ void PhaseIdealLoop::rpo( Node *start, Node_Stack &stk, VectorSet &visited, Node +@@ -4154,6 +4110,7 @@ void PhaseIdealLoop::rpo( Node *start, Node_Stack &stk, VectorSet &visited, Node } } } @@ -150900,7 +150760,7 @@ index aec7e8e9..957929e5 100644 //============================================================================= diff --git a/hotspot/src/share/vm/opto/loopnode.hpp b/hotspot/src/share/vm/opto/loopnode.hpp -index e879288a..fa874a4c 100644 +index 64bc13a1..10f9694f 100644 --- a/hotspot/src/share/vm/opto/loopnode.hpp +++ b/hotspot/src/share/vm/opto/loopnode.hpp @@ -571,12 +571,10 @@ class PhaseIdealLoop : public PhaseTransform { @@ -150933,7 +150793,7 @@ index e879288a..fa874a4c 100644 // Locally compute IDOM using dom_lca call Node *compute_idom( Node *region ) const; // Recompute dom_depth -@@ -1050,7 +1045,6 @@ public: +@@ -1054,7 +1049,6 @@ public: Node *split_thru_region( Node *n, Node *region ); // Split Node 'n' through merge point if there is enough win. Node *split_thru_phi( Node *n, Node *region, int policy ); @@ -150941,7 +150801,7 @@ index e879288a..fa874a4c 100644 // Found an If getting its condition-code input from a Phi in the // same block. Split thru the Region. void do_split_if( Node *iff ); -@@ -1085,11 +1079,11 @@ public: +@@ -1089,11 +1083,11 @@ public: #ifdef ASSERT void dump_bad_graph(const char* msg, Node* n, Node* early, Node* LCA); #endif @@ -150954,7 +150814,7 @@ index e879288a..fa874a4c 100644 void verify() const; // Major slow :-) void verify_compare( Node *n, const PhaseIdealLoop *loop_verify, VectorSet &visited ) const; IdealLoopTree *get_loop_idx(Node* n) const { -@@ -1101,9 +1095,6 @@ public: +@@ -1105,9 +1099,6 @@ public: static int _loop_invokes; // Count of PhaseIdealLoop invokes static int _loop_work; // Sum of PhaseIdealLoop x _unique #endif @@ -151070,7 +150930,7 @@ index 76ddbdd5..5f8757c9 100644 //------------------------------MachTempNode----------------------------------- // Node used by the adlc to construct inputs to represent temporary registers diff --git a/hotspot/src/share/vm/opto/macro.cpp b/hotspot/src/share/vm/opto/macro.cpp -index b60e6775..737cbcb9 100644 +index 59acd822..ae3755c6 100644 --- a/hotspot/src/share/vm/opto/macro.cpp +++ b/hotspot/src/share/vm/opto/macro.cpp @@ -41,11 +41,6 @@ @@ -151141,7 +151001,7 @@ index b60e6775..737cbcb9 100644 eliminate_card_mark(use); } diff --git a/hotspot/src/share/vm/opto/matcher.cpp b/hotspot/src/share/vm/opto/matcher.cpp -index 695274c0..994de073 100644 +index dee429b7..dec46861 100644 --- a/hotspot/src/share/vm/opto/matcher.cpp +++ b/hotspot/src/share/vm/opto/matcher.cpp @@ -22,6 +22,12 @@ @@ -151856,7 +151716,7 @@ index a0d9acca..d6b9d157 100644 //------------------------------yank------------------------------------------- // Find and remove diff --git a/hotspot/src/share/vm/opto/node.hpp b/hotspot/src/share/vm/opto/node.hpp -index 97f155c5..270b9662 100644 +index a2a9a098..feb8ad3e 100644 --- a/hotspot/src/share/vm/opto/node.hpp +++ b/hotspot/src/share/vm/opto/node.hpp @@ -71,7 +71,6 @@ class EncodePKlassNode; @@ -151892,7 +151752,7 @@ index 97f155c5..270b9662 100644 // Find out of current node that matches opcode. Node* find_out_with(int opcode); -@@ -641,7 +636,6 @@ public: +@@ -642,7 +637,6 @@ public: DEFINE_CLASS_ID(MachConstantBase, Mach, 4) DEFINE_CLASS_ID(MachConstant, Mach, 5) DEFINE_CLASS_ID(MachMerge, Mach, 6) @@ -151900,7 +151760,7 @@ index 97f155c5..270b9662 100644 DEFINE_CLASS_ID(Type, Node, 2) DEFINE_CLASS_ID(Phi, Type, 0) -@@ -656,14 +650,12 @@ public: +@@ -657,14 +651,12 @@ public: DEFINE_CLASS_ID(EncodeNarrowPtr, Type, 6) DEFINE_CLASS_ID(EncodeP, EncodeNarrowPtr, 0) DEFINE_CLASS_ID(EncodePKlass, EncodeNarrowPtr, 1) @@ -151917,7 +151777,7 @@ index 97f155c5..270b9662 100644 DEFINE_CLASS_ID(Parm, Proj, 4) DEFINE_CLASS_ID(MachProj, Proj, 5) -@@ -789,7 +781,6 @@ public: +@@ -790,7 +782,6 @@ public: DEFINE_CLASS_QUERY(FastLock) DEFINE_CLASS_QUERY(FastUnlock) DEFINE_CLASS_QUERY(If) @@ -151925,7 +151785,7 @@ index 97f155c5..270b9662 100644 DEFINE_CLASS_QUERY(IfFalse) DEFINE_CLASS_QUERY(IfTrue) DEFINE_CLASS_QUERY(Initialize) -@@ -817,7 +808,6 @@ public: +@@ -818,7 +809,6 @@ public: DEFINE_CLASS_QUERY(MachSafePoint) DEFINE_CLASS_QUERY(MachSpillCopy) DEFINE_CLASS_QUERY(MachTemp) @@ -151933,7 +151793,7 @@ index 97f155c5..270b9662 100644 DEFINE_CLASS_QUERY(MachMerge) DEFINE_CLASS_QUERY(Mem) DEFINE_CLASS_QUERY(MemBar) -@@ -834,7 +824,6 @@ public: +@@ -835,7 +825,6 @@ public: DEFINE_CLASS_QUERY(Root) DEFINE_CLASS_QUERY(SafePoint) DEFINE_CLASS_QUERY(SafePointScalarObject) @@ -151941,7 +151801,7 @@ index 97f155c5..270b9662 100644 DEFINE_CLASS_QUERY(Start) DEFINE_CLASS_QUERY(Store) DEFINE_CLASS_QUERY(Sub) -@@ -933,14 +922,13 @@ public: +@@ -934,14 +923,13 @@ public: // Check if 'this' node dominates or equal to 'sub'. bool dominates(Node* sub, Node_List &nlist); @@ -151959,7 +151819,7 @@ index 97f155c5..270b9662 100644 // See if there is valid pipeline info static const Pipeline *pipeline_class(); virtual const Pipeline *pipeline() const; -@@ -974,9 +962,6 @@ public: +@@ -975,9 +963,6 @@ public: // Return the unique control out if only one. Null if none or more than one. Node* unique_ctrl_out(); @@ -151970,7 +151830,7 @@ index 97f155c5..270b9662 100644 // Ideal register class for Matching. Zero means unmatched instruction diff --git a/hotspot/src/share/vm/opto/output.cpp b/hotspot/src/share/vm/opto/output.cpp -index 5c9566e1..6579d81d 100644 +index 6032b72a..7fb4dea2 100644 --- a/hotspot/src/share/vm/opto/output.cpp +++ b/hotspot/src/share/vm/opto/output.cpp @@ -22,6 +22,12 @@ @@ -152131,7 +151991,7 @@ index 63fe2dbe..fc8476a8 100644 } } diff --git a/hotspot/src/share/vm/opto/phaseX.cpp b/hotspot/src/share/vm/opto/phaseX.cpp -index 31eab632..9c4a7056 100644 +index 22c1dc2b..0cd51708 100644 --- a/hotspot/src/share/vm/opto/phaseX.cpp +++ b/hotspot/src/share/vm/opto/phaseX.cpp @@ -35,9 +35,6 @@ @@ -152429,7 +152289,7 @@ index ac0615a0..858dda6e 100644 } } diff --git a/hotspot/src/share/vm/opto/superword.cpp b/hotspot/src/share/vm/opto/superword.cpp -index a14210ee..aeb52f05 100644 +index c5a4fd58..cf47f3a8 100644 --- a/hotspot/src/share/vm/opto/superword.cpp +++ b/hotspot/src/share/vm/opto/superword.cpp @@ -1688,7 +1688,7 @@ bool SuperWord::construct_bb() { @@ -152441,7 +152301,7 @@ index a14210ee..aeb52f05 100644 return false; // Bailout } _mem_slice_head.push(n); -@@ -2317,27 +2317,6 @@ SWPointer::SWPointer(MemNode* mem, SuperWord* slp) : +@@ -2340,27 +2340,6 @@ SWPointer::SWPointer(MemNode* mem, SuperWord* slp) : assert(!valid(), "unsafe access"); return; } @@ -152470,7 +152330,7 @@ index a14210ee..aeb52f05 100644 if (!scaled_iv_plus_offset(adr->in(AddPNode::Offset))) { assert(!valid(), "too complex"); diff --git a/hotspot/src/share/vm/opto/superword.hpp b/hotspot/src/share/vm/opto/superword.hpp -index 9f0f58cb..13fd2bf9 100644 +index 8f066020..056baad1 100644 --- a/hotspot/src/share/vm/opto/superword.hpp +++ b/hotspot/src/share/vm/opto/superword.hpp @@ -229,7 +229,6 @@ class OrderedPair VALUE_OBJ_CLASS_SPEC { @@ -152528,7 +152388,7 @@ index 047c7837..d7409fca 100644 #endif // !DONT_USE_PRECOMPILED_HEADER diff --git a/hotspot/src/share/vm/prims/jni.cpp b/hotspot/src/share/vm/prims/jni.cpp -index 071e33bd..ca37a087 100644 +index b9f280db..ac29c829 100644 --- a/hotspot/src/share/vm/prims/jni.cpp +++ b/hotspot/src/share/vm/prims/jni.cpp @@ -38,7 +38,6 @@ @@ -152539,7 +152399,7 @@ index 071e33bd..ca37a087 100644 #endif // INCLUDE_ALL_GCS #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" -@@ -2629,7 +2628,7 @@ JNI_ENTRY(jobject, jni_GetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID +@@ -2632,7 +2631,7 @@ JNI_ENTRY(jobject, jni_GetObjectField(JNIEnv *env, jobject obj, jfieldID fieldID // If G1 is enabled and we are accessing the value of the referent // field in a reference object then we need to register a non-null // referent with the SATB barrier. @@ -152548,7 +152408,7 @@ index 071e33bd..ca37a087 100644 bool needs_barrier = false; if (ret != NULL && -@@ -4250,24 +4249,6 @@ JNI_ENTRY(void, jni_GetStringUTFRegion(JNIEnv *env, jstring string, jsize start, +@@ -4253,24 +4252,6 @@ JNI_ENTRY(void, jni_GetStringUTFRegion(JNIEnv *env, jstring string, jsize start, } JNI_END @@ -152573,7 +152433,7 @@ index 071e33bd..ca37a087 100644 JNI_ENTRY(void*, jni_GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboolean *isCopy)) JNIWrapper("GetPrimitiveArrayCritical"); -@@ -4277,10 +4258,11 @@ JNI_ENTRY(void*, jni_GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboole +@@ -4280,10 +4261,11 @@ JNI_ENTRY(void*, jni_GetPrimitiveArrayCritical(JNIEnv *env, jarray array, jboole HOTSPOT_JNI_GETPRIMITIVEARRAYCRITICAL_ENTRY( env, array, (uintptr_t *) isCopy); #endif /* USDT2 */ @@ -152586,7 +152446,7 @@ index 071e33bd..ca37a087 100644 assert(a->is_array(), "just checking"); BasicType type; if (a->is_objArray()) { -@@ -4308,7 +4290,7 @@ JNI_ENTRY(void, jni_ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, voi +@@ -4311,7 +4293,7 @@ JNI_ENTRY(void, jni_ReleasePrimitiveArrayCritical(JNIEnv *env, jarray array, voi env, array, carray, mode); #endif /* USDT2 */ // The array, carray and mode arguments are ignored @@ -152595,7 +152455,7 @@ index 071e33bd..ca37a087 100644 #ifndef USDT2 DTRACE_PROBE(hotspot_jni, ReleasePrimitiveArrayCritical__return); #else /* USDT2 */ -@@ -4326,48 +4308,20 @@ JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jbool +@@ -4329,48 +4311,20 @@ JNI_ENTRY(const jchar*, jni_GetStringCritical(JNIEnv *env, jstring string, jbool HOTSPOT_JNI_GETSTRINGCRITICAL_ENTRY( env, string, (uintptr_t *) isCopy); #endif /* USDT2 */ @@ -152656,7 +152516,7 @@ index 071e33bd..ca37a087 100644 #ifndef USDT2 DTRACE_PROBE1(hotspot_jni, GetStringCritical__return, ret); #else /* USDT2 */ -@@ -4386,28 +4340,8 @@ JNI_ENTRY(void, jni_ReleaseStringCritical(JNIEnv *env, jstring str, const jchar +@@ -4389,28 +4343,8 @@ JNI_ENTRY(void, jni_ReleaseStringCritical(JNIEnv *env, jstring str, const jchar HOTSPOT_JNI_RELEASESTRINGCRITICAL_ENTRY( env, str, (uint16_t *) chars); #endif /* USDT2 */ @@ -153744,13 +153604,13 @@ index 3755a15d..be8438f2 100644 } #endif // INCLUDE_ALL_GCS diff --git a/hotspot/src/share/vm/runtime/mutexLocker.cpp b/hotspot/src/share/vm/runtime/mutexLocker.cpp -index 189f7246..2dcda097 100644 +index 648fa37a..8bb170b4 100644 --- a/hotspot/src/share/vm/runtime/mutexLocker.cpp +++ b/hotspot/src/share/vm/runtime/mutexLocker.cpp -@@ -209,11 +209,6 @@ void mutex_init() { - def(StringDedupQueue_lock , Monitor, leaf, true ); - def(StringDedupTable_lock , Mutex , leaf, true ); +@@ -212,11 +212,6 @@ void mutex_init() { } + def(MonitoringSupport_lock , Mutex , leaf, true ); // used for serviceability monitoring support + - if (UseShenandoahGC) { - def(SATB_Q_FL_lock , Mutex , special, true); - def(SATB_Q_CBL_mon , Monitor, nonleaf, true); @@ -154407,7 +154267,7 @@ index 3bf0b74e..3db678ff 100644 ALL_JAVA_THREADS(p) { if (p->claim_oops_do(is_par, cp)) { diff --git a/hotspot/src/share/vm/runtime/thread.hpp b/hotspot/src/share/vm/runtime/thread.hpp -index 6d16c461..98d195f7 100644 +index 1b22f060..aa69217e 100644 --- a/hotspot/src/share/vm/runtime/thread.hpp +++ b/hotspot/src/share/vm/runtime/thread.hpp @@ -22,6 +22,12 @@ @@ -154666,7 +154526,7 @@ index 66392b75..5ced38d8 100644 } else { base = os::reserve_memory(size, NULL, alignment); diff --git a/hotspot/src/share/vm/runtime/vmStructs.cpp b/hotspot/src/share/vm/runtime/vmStructs.cpp -index d55535f8..c6cc4c43 100644 +index 0ff3f744..3e4640e6 100644 --- a/hotspot/src/share/vm/runtime/vmStructs.cpp +++ b/hotspot/src/share/vm/runtime/vmStructs.cpp @@ -22,6 +22,12 @@ @@ -154727,7 +154587,7 @@ index d55535f8..c6cc4c43 100644 #endif #endif // COMPILER2 -@@ -2223,7 +2244,6 @@ typedef TwoOopHashtable SymbolTwoOopHashtable; +@@ -2225,7 +2246,6 @@ typedef TwoOopHashtable SymbolTwoOopHashtable; declare_constant(BarrierSet::CardTableExtension) \ declare_constant(BarrierSet::G1SATBCT) \ declare_constant(BarrierSet::G1SATBCTLogging) \ @@ -154735,7 +154595,7 @@ index d55535f8..c6cc4c43 100644 declare_constant(BarrierSet::Other) \ \ declare_constant(BlockOffsetSharedArray::LogN) \ -@@ -2247,7 +2267,6 @@ typedef TwoOopHashtable SymbolTwoOopHashtable; +@@ -2249,7 +2269,6 @@ typedef TwoOopHashtable SymbolTwoOopHashtable; declare_constant(CollectedHeap::Abstract) \ declare_constant(CollectedHeap::SharedHeap) \ declare_constant(CollectedHeap::GenCollectedHeap) \ @@ -154743,7 +154603,7 @@ index d55535f8..c6cc4c43 100644 \ declare_constant(GenCollectedHeap::max_gens) \ \ -@@ -2925,11 +2944,6 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = { +@@ -2927,11 +2946,6 @@ VMStructEntry VMStructs::localHotSpotVMStructs[] = { VM_STRUCTS_G1(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, GENERATE_STATIC_VM_STRUCT_ENTRY) @@ -154755,7 +154615,7 @@ index d55535f8..c6cc4c43 100644 #endif // INCLUDE_ALL_GCS VM_STRUCTS_CPU(GENERATE_NONSTATIC_VM_STRUCT_ENTRY, -@@ -2975,10 +2989,6 @@ VMTypeEntry VMStructs::localHotSpotVMTypes[] = { +@@ -2977,10 +2991,6 @@ VMTypeEntry VMStructs::localHotSpotVMTypes[] = { VM_TYPES_G1(GENERATE_VM_TYPE_ENTRY, GENERATE_TOPLEVEL_VM_TYPE_ENTRY) @@ -154766,7 +154626,7 @@ index d55535f8..c6cc4c43 100644 #endif // INCLUDE_ALL_GCS VM_TYPES_CPU(GENERATE_VM_TYPE_ENTRY, -@@ -3014,9 +3024,6 @@ VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = { +@@ -3016,9 +3026,6 @@ VMIntConstantEntry VMStructs::localHotSpotVMIntConstants[] = { VM_INT_CONSTANTS_CMS(GENERATE_VM_INT_CONSTANT_ENTRY) VM_INT_CONSTANTS_PARNEW(GENERATE_VM_INT_CONSTANT_ENTRY) @@ -154776,7 +154636,7 @@ index d55535f8..c6cc4c43 100644 #endif // INCLUDE_ALL_GCS VM_INT_CONSTANTS_CPU(GENERATE_VM_INT_CONSTANT_ENTRY, -@@ -3083,10 +3090,6 @@ VMStructs::init() { +@@ -3085,10 +3092,6 @@ VMStructs::init() { VM_STRUCTS_G1(CHECK_NONSTATIC_VM_STRUCT_ENTRY, CHECK_STATIC_VM_STRUCT_ENTRY); @@ -154787,7 +154647,7 @@ index d55535f8..c6cc4c43 100644 #endif // INCLUDE_ALL_GCS VM_STRUCTS_CPU(CHECK_NONSTATIC_VM_STRUCT_ENTRY, -@@ -3128,9 +3131,6 @@ VMStructs::init() { +@@ -3130,9 +3133,6 @@ VMStructs::init() { VM_TYPES_G1(CHECK_VM_TYPE_ENTRY, CHECK_SINGLE_ARG_VM_TYPE_NO_OP); @@ -154815,7 +154675,7 @@ index 9928a2f9..8c6795ac 100644 template(LinuxDllLoad) \ template(RotateGCLog) \ diff --git a/hotspot/src/share/vm/runtime/vm_version.cpp b/hotspot/src/share/vm/runtime/vm_version.cpp -index 66c383bf..9e643241 100644 +index 91f9c70f..d8dcfcfc 100644 --- a/hotspot/src/share/vm/runtime/vm_version.cpp +++ b/hotspot/src/share/vm/runtime/vm_version.cpp @@ -22,6 +22,12 @@ @@ -155126,7 +154986,7 @@ index feedc08e..00000000 - -#endif //SHARE_VM_SERVICES_SHENANDOAHMEMORYPOOL_HPP diff --git a/hotspot/src/share/vm/utilities/copy.hpp b/hotspot/src/share/vm/utilities/copy.hpp -index c1d82c70..1279319a 100644 +index c1d82c70..73b858b8 100644 --- a/hotspot/src/share/vm/utilities/copy.hpp +++ b/hotspot/src/share/vm/utilities/copy.hpp @@ -22,6 +22,12 @@ @@ -155134,43 +154994,15 @@ index c1d82c70..1279319a 100644 */ +/* -+ * This file has been modified by Loongson Technology in 2020. These -+ * modifications are Copyright (c) 2015, 2020, Loongson Technology, and are made ++ * This file has been modified by Loongson Technology in 2023. These ++ * modifications are Copyright (c) 2015, 2023, Loongson Technology, and are made + * available on the same license terms set forth above. + */ + #ifndef SHARE_VM_UTILITIES_COPY_HPP #define SHARE_VM_UTILITIES_COPY_HPP -@@ -331,6 +337,27 @@ class Copy : AllStatic { - #endif - } - -+ -+ // SAPJVM AS 2011-09-20. Template for atomic copy. -+ template static void copy_conjoint_atomic(T* from, T* to, size_t count) -+ { -+ if (from > to) { -+ while (count-- > 0) { -+ // Copy forwards -+ *to++ = *from++; -+ } -+ } else { -+ from += count - 1; -+ to += count - 1; -+ while (count-- > 0) { -+ // Copy backwards -+ *to-- = *from--; -+ } -+ } -+ } -+ -+ -+ - // Platform dependent implementations of the above methods. - #ifdef TARGET_ARCH_x86 - # include "copy_x86.hpp" -@@ -350,6 +377,13 @@ class Copy : AllStatic { +@@ -350,6 +356,13 @@ class Copy : AllStatic { #ifdef TARGET_ARCH_ppc # include "copy_ppc.hpp" #endif @@ -155197,7 +155029,7 @@ index 58a32a2b..1026585f 100644 tty->print_cr(" - in gdb do 'set overload-resolution off' before calling pns()"); tty->print_cr(" - in dbx do 'frame 1' before calling pns()"); diff --git a/hotspot/src/share/vm/utilities/globalDefinitions.hpp b/hotspot/src/share/vm/utilities/globalDefinitions.hpp -index a09f66fc..61fc0c48 100644 +index b5c00d53..3ae97b09 100644 --- a/hotspot/src/share/vm/utilities/globalDefinitions.hpp +++ b/hotspot/src/share/vm/utilities/globalDefinitions.hpp @@ -22,6 +22,12 @@ @@ -155241,7 +155073,7 @@ index a09f66fc..61fc0c48 100644 /* * If a platform does not support native stack walking -@@ -1438,7 +1444,6 @@ inline intptr_t p2i(const void * p) { +@@ -1474,7 +1480,6 @@ inline intptr_t p2i(const void * p) { #define UINT64_FORMAT_X "%" PRIx64 #define INT64_FORMAT_W(width) "%" #width PRId64 #define UINT64_FORMAT_W(width) "%" #width PRIu64 @@ -155589,10 +155421,10 @@ index fa7a3250..7098a98a 100644 Abstract_VM_Version::vm_name(), Abstract_VM_Version::vm_release(), diff --git a/hotspot/test/TEST.groups b/hotspot/test/TEST.groups -index 91f36d75..216e307c 100644 +index b0e6fdb9..c55ef8d1 100644 --- a/hotspot/test/TEST.groups +++ b/hotspot/test/TEST.groups -@@ -135,35 +135,6 @@ hotspot_gc = \ +@@ -134,35 +134,6 @@ hotspot_gc = \ sanity/ExecuteInternalVMTests.java \ -gc/g1/TestGreyReclaimedHumongousObjects.java @@ -155875,7 +155707,7 @@ index 70e46cf8..728a1280 100644 } diff --git a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java -index f2986cc1..a02f5b45 100644 +index 70cb8fe4..c8eb6c68 100644 --- a/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java +++ b/hotspot/test/gc/metaspace/TestMetaspacePerfCounters.java @@ -37,12 +37,10 @@ import static com.oracle.java.testlibrary.Asserts.*; @@ -155891,21 +155723,6 @@ index f2986cc1..a02f5b45 100644 */ public class TestMetaspacePerfCounters { public static Class fooClass = null; -diff --git a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java -index 50b32d70..4aaa8ac1 100644 ---- a/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java -+++ b/hotspot/test/gc/metaspace/TestPerfCountersAndMemoryPools.java -@@ -33,8 +33,8 @@ import static com.oracle.java.testlibrary.Asserts.*; - * @requires vm.gc=="Serial" | vm.gc=="null" - * @summary Tests that a MemoryPoolMXBeans and PerfCounters for metaspace - * report the same data. -- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData TestPerfCountersAndMemoryPools -- * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedClassPointers -XX:+UseSerialGC -XX:+UsePerfData TestPerfCountersAndMemoryPools -+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-UseCompressedOops -XX:-UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint TestPerfCountersAndMemoryPools -+ * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:+UseCompressedOops -XX:+UseCompressedKlassPointers -XX:+UseSerialGC -XX:+UsePerfData -Xint TestPerfCountersAndMemoryPools - */ - public class TestPerfCountersAndMemoryPools { - public static void main(String[] args) throws Exception { diff --git a/hotspot/test/gc/shenandoah/TestAllocHumongousFragment.java b/hotspot/test/gc/shenandoah/TestAllocHumongousFragment.java deleted file mode 100644 index 2fc1667c..00000000 @@ -166181,263 +165998,8 @@ index 7d56a4a3..41825e18 100644 BITNESS("is32bit", "is64bit"), OS("isAix", "isLinux", "isSolaris", "isWindows", "isOSX"), VM_TYPE("isClient", "isServer", "isGraal", "isMinimal"), -diff --git a/jaxp/THIRD_PARTY_README b/jaxp/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 ---- a/jaxp/THIRD_PARTY_README -+++ b/jaxp/THIRD_PARTY_README -@@ -7,7 +7,7 @@ OpenJDK 8. - - --- begin of LICENSE --- - --Copyright (c) 2000-2011 France Télécom -+Copyright (c) 2000-2011 France T??l??com - All rights reserved. - - Redistribution and use in source and binary forms, with or without -@@ -1035,7 +1035,7 @@ JRE 8, JDK 8, and OpenJDK 8. - --- begin of LICENSE --- - - Copyright notice --Copyright © 2011 Ecma International -+Copyright ?? 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. - Unicode Terms of Use - - For the general privacy policy governing access to this site, see the Unicode --Privacy Policy. For trademark usage, see the Unicode® Consortium Name and -+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and - Trademark Usage Policy. - - A. Unicode Copyright. -- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. -+ 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. - - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative -- works conforming to the Unicode® Standard, subject to Terms and -+ works conforming to the Unicode?? Standard, subject to Terms and - Conditions herein. - - 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, -- Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of -+ Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of - Unicode, Inc. Use of the information and materials found on this -- website indicates your acknowledgement of Unicode, Inc.’s exclusive -+ website indicates your acknowledgement of Unicode, Inc.???s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - -- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark -- Policy”) are incorporated herein by reference and you agree to abide by -+ 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark -+ Policy???) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - -@@ -2632,12 +2632,12 @@ Miscellaneous. - - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not -- assign any part of this Agreement without Unicode’s prior written -+ assign any part of this Agreement without Unicode???s prior written - consent. - - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on -- Unicode’s net income. -+ Unicode???s net income. - - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - --Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the -+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy -diff --git a/jaxws/THIRD_PARTY_README b/jaxws/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 ---- a/jaxws/THIRD_PARTY_README -+++ b/jaxws/THIRD_PARTY_README -@@ -7,7 +7,7 @@ OpenJDK 8. - - --- begin of LICENSE --- - --Copyright (c) 2000-2011 France Télécom -+Copyright (c) 2000-2011 France T??l??com - All rights reserved. - - Redistribution and use in source and binary forms, with or without -@@ -1035,7 +1035,7 @@ JRE 8, JDK 8, and OpenJDK 8. - --- begin of LICENSE --- - - Copyright notice --Copyright © 2011 Ecma International -+Copyright ?? 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. - Unicode Terms of Use - - For the general privacy policy governing access to this site, see the Unicode --Privacy Policy. For trademark usage, see the Unicode® Consortium Name and -+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and - Trademark Usage Policy. - - A. Unicode Copyright. -- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. -+ 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. - - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative -- works conforming to the Unicode® Standard, subject to Terms and -+ works conforming to the Unicode?? Standard, subject to Terms and - Conditions herein. - - 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, -- Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of -+ Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of - Unicode, Inc. Use of the information and materials found on this -- website indicates your acknowledgement of Unicode, Inc.’s exclusive -+ website indicates your acknowledgement of Unicode, Inc.???s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - -- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark -- Policy”) are incorporated herein by reference and you agree to abide by -+ 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark -+ Policy???) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - -@@ -2632,12 +2632,12 @@ Miscellaneous. - - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not -- assign any part of this Agreement without Unicode’s prior written -+ assign any part of this Agreement without Unicode???s prior written - consent. - - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on -- Unicode’s net income. -+ Unicode???s net income. - - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - --Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the -+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy -diff --git a/jdk/THIRD_PARTY_README b/jdk/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 ---- a/jdk/THIRD_PARTY_README -+++ b/jdk/THIRD_PARTY_README -@@ -7,7 +7,7 @@ OpenJDK 8. - - --- begin of LICENSE --- - --Copyright (c) 2000-2011 France Télécom -+Copyright (c) 2000-2011 France T??l??com - All rights reserved. - - Redistribution and use in source and binary forms, with or without -@@ -1035,7 +1035,7 @@ JRE 8, JDK 8, and OpenJDK 8. - --- begin of LICENSE --- - - Copyright notice --Copyright © 2011 Ecma International -+Copyright ?? 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. - Unicode Terms of Use - - For the general privacy policy governing access to this site, see the Unicode --Privacy Policy. For trademark usage, see the Unicode® Consortium Name and -+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and - Trademark Usage Policy. - - A. Unicode Copyright. -- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. -+ 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. - - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative -- works conforming to the Unicode® Standard, subject to Terms and -+ works conforming to the Unicode?? Standard, subject to Terms and - Conditions herein. - - 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, -- Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of -+ Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of - Unicode, Inc. Use of the information and materials found on this -- website indicates your acknowledgement of Unicode, Inc.’s exclusive -+ website indicates your acknowledgement of Unicode, Inc.???s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - -- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark -- Policy”) are incorporated herein by reference and you agree to abide by -+ 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark -+ Policy???) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - -@@ -2632,12 +2632,12 @@ Miscellaneous. - - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not -- assign any part of this Agreement without Unicode’s prior written -+ assign any part of this Agreement without Unicode???s prior written - consent. - - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on -- Unicode’s net income. -+ Unicode???s net income. - - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - --Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the -+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/jdk/make/Images.gmk b/jdk/make/Images.gmk -index 991c0af7..91716856 100644 +index 2e378c91..cf114e76 100644 --- a/jdk/make/Images.gmk +++ b/jdk/make/Images.gmk @@ -23,6 +23,12 @@ @@ -166513,19 +166075,6 @@ index 0e3dee5c..66f19f4d 100644 -e 's/@@java_runtime_name@@/$(RUNTIME_NAME)/g' \ -e 's/@@java_profile_name@@/$(call profile_version_name, $@)/g' \ $< > $@.tmp -diff --git a/jdk/make/lib/SecurityLibraries.gmk b/jdk/make/lib/SecurityLibraries.gmk -index 993c23c4..b0b85d80 100644 ---- a/jdk/make/lib/SecurityLibraries.gmk -+++ b/jdk/make/lib/SecurityLibraries.gmk -@@ -243,7 +243,7 @@ ifeq ($(ENABLE_INTREE_EC), yes) - OPTIMIZATION := LOW, \ - CFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CFLAGS_JDKLIB)) \ - $(BUILD_LIBSUNEC_FLAGS) \ -- -DMP_API_COMPATIBLE, \ -+ -DMP_API_COMPATIBLE -DNSS_ECC_MORE_THAN_SUITE_B, \ - CXXFLAGS := $(filter-out $(ECC_JNI_SOLSPARC_FILTER), $(CXXFLAGS_JDKLIB)) \ - $(BUILD_LIBSUNEC_FLAGS), \ - MAPFILE := $(JDK_TOPDIR)/make/mapfiles/libsunec/mapfile-vers, \ diff --git a/jdk/make/lib/SoundLibraries.gmk b/jdk/make/lib/SoundLibraries.gmk index b59a9462..8ce97dc8 100644 --- a/jdk/make/lib/SoundLibraries.gmk @@ -166558,570 +166107,6 @@ index b59a9462..8ce97dc8 100644 ifeq ($(OPENJDK_TARGET_CPU), ppc64) LIBJSOUND_CFLAGS += -DX_ARCH=X_PPC64 endif -diff --git a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java -index 87fb54b1..41a100ad 100644 ---- a/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java -+++ b/jdk/src/share/classes/com/sun/org/apache/xml/internal/security/algorithms/implementations/ECDSAUtils.java -@@ -159,6 +159,149 @@ public final class ECDSAUtils { - private static final List ecCurveDefinitions = new ArrayList<>(); - - static { -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp112r1", -+ "1.3.132.0.6", -+ "db7c2abf62e35e668076bead208b", -+ "db7c2abf62e35e668076bead2088", -+ "659ef8ba043916eede8911702b22", -+ "09487239995a5ee76b55f9c2f098", -+ "a89ce5af8724c0a23e0e0ff77500", -+ "db7c2abf62e35e7628dfac6561c5", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp112r2", -+ "1.3.132.0.7", -+ "db7c2abf62e35e668076bead208b", -+ "6127c24c05f38a0aaaf65c0ef02c", -+ "51def1815db5ed74fcc34c85d709", -+ "4ba30ab5e892b4e1649dd0928643", -+ "adcd46f5882e3747def36e956e97", -+ "36df0aafd8b8d7597ca10520d04b", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp128r1", -+ "1.3.132.0.28", -+ "fffffffdffffffffffffffffffffffff", -+ "fffffffdfffffffffffffffffffffffc", -+ "e87579c11079f43dd824993c2cee5ed3", -+ "161ff7528b899b2d0c28607ca52c5b86", -+ "cf5ac8395bafeb13c02da292dded7a83", -+ "fffffffe0000000075a30d1b9038a115", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp128r2", -+ "1.3.132.0.29", -+ "fffffffdffffffffffffffffffffffff", -+ "d6031998d1b3bbfebf59cc9bbff9aee1", -+ "5eeefca380d02919dc2c6558bb6d8a5d", -+ "7b6aa5d85e572983e6fb32a7cdebc140", -+ "27b6916a894d3aee7106fe805fc34b44", -+ "3fffffff7fffffffbe0024720613b5a3", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp160k1", -+ "1.3.132.0.9", -+ "fffffffffffffffffffffffffffffffeffffac73", -+ "0000000000000000000000000000000000000000", -+ "0000000000000000000000000000000000000007", -+ "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb", -+ "938cf935318fdced6bc28286531733c3f03c4fee", -+ "0100000000000000000001b8fa16dfab9aca16b6b3", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp160r1", -+ "1.3.132.0.8", -+ "ffffffffffffffffffffffffffffffff7fffffff", -+ "ffffffffffffffffffffffffffffffff7ffffffc", -+ "1c97befc54bd7a8b65acf89f81d4d4adc565fa45", -+ "4a96b5688ef573284664698968c38bb913cbfc82", -+ "23a628553168947d59dcc912042351377ac5fb32", -+ "0100000000000000000001f4c8f927aed3ca752257", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp160r2", -+ "1.3.132.0.30", -+ "fffffffffffffffffffffffffffffffeffffac73", -+ "fffffffffffffffffffffffffffffffeffffac70", -+ "b4e134d3fb59eb8bab57274904664d5af50388ba", -+ "52dcb034293a117e1f4ff11b30f7199d3144ce6d", -+ "feaffef2e331f296e071fa0df9982cfea7d43f2e", -+ "0100000000000000000000351ee786a818f3a1a16b", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp192k1", -+ "1.3.132.0.31", -+ "fffffffffffffffffffffffffffffffffffffffeffffee37", -+ "000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000003", -+ "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d", -+ "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d", -+ "fffffffffffffffffffffffe26f2fc170f69466a74defd8d", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp192r1 [NIST P-192, X9.62 prime192v1]", -+ "1.2.840.10045.3.1.1", -+ "fffffffffffffffffffffffffffffffeffffffffffffffff", -+ "fffffffffffffffffffffffffffffffefffffffffffffffc", -+ "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1", -+ "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012", -+ "07192b95ffc8da78631011ed6b24cdd573f977a11e794811", -+ "ffffffffffffffffffffffff99def836146bc9b1b4d22831", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp224k1", -+ "1.3.132.0.32", -+ "fffffffffffffffffffffffffffffffffffffffffffffffeffffe56d", -+ "00000000000000000000000000000000000000000000000000000000", -+ "00000000000000000000000000000000000000000000000000000005", -+ "a1455b334df099df30fc28a169a467e9e47075a90f7e650eb6b7a45c", -+ "7e089fed7fba344282cafbd6f7e319f7c0b0bd59e2ca4bdb556d61a5", -+ "010000000000000000000000000001dce8d2ec6184caf0a971769fb1f7", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "secp224r1 [NIST P-224]", -+ "1.3.132.0.33", -+ "ffffffffffffffffffffffffffffffff000000000000000000000001", -+ "fffffffffffffffffffffffffffffffefffffffffffffffffffffffe", -+ "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4", -+ "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21", -+ "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34", -+ "ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d", -+ 1) -+ ); -+ - ecCurveDefinitions.add( - new ECCurveDefinition( - "secp256k1", -@@ -210,6 +353,409 @@ public final class ECDSAUtils { - "01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409", - 1) - ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 prime192v2", -+ "1.2.840.10045.3.1.2", -+ "fffffffffffffffffffffffffffffffeffffffffffffffff", -+ "fffffffffffffffffffffffffffffffefffffffffffffffc", -+ "cc22d6dfb95c6b25e49c0d6364a4e5980c393aa21668d953", -+ "eea2bae7e1497842f2de7769cfe9c989c072ad696f48034a", -+ "6574d11d69b6ec7a672bb82a083df2f2b0847de970b2de15", -+ "fffffffffffffffffffffffe5fb1a724dc80418648d8dd31", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 prime192v3", -+ "1.2.840.10045.3.1.3", -+ "fffffffffffffffffffffffffffffffeffffffffffffffff", -+ "fffffffffffffffffffffffffffffffefffffffffffffffc", -+ "22123dc2395a05caa7423daeccc94760a7d462256bd56916", -+ "7d29778100c65a1da1783716588dce2b8b4aee8e228f1896", -+ "38a90f22637337334b49dcb66a6dc8f9978aca7648a943b0", -+ "ffffffffffffffffffffffff7a62d031c83f4294f640ec13", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 prime239v1", -+ "1.2.840.10045.3.1.4", -+ "7fffffffffffffffffffffff7fffffffffff8000000000007fffffffffff", -+ "7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", -+ "6b016c3bdcf18941d0d654921475ca71a9db2fb27d1d37796185c2942c0a", -+ "0ffa963cdca8816ccc33b8642bedf905c3d358573d3f27fbbd3b3cb9aaaf", -+ "7debe8e4e90a5dae6e4054ca530ba04654b36818ce226b39fccb7b02f1ae", -+ "7fffffffffffffffffffffff7fffff9e5e9a9f5d9071fbd1522688909d0b", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 prime239v2", -+ "1.2.840.10045.3.1.5", -+ "7fffffffffffffffffffffff7fffffffffff8000000000007fffffffffff", -+ "7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", -+ "617fab6832576cbbfed50d99f0249c3fee58b94ba0038c7ae84c8c832f2c", -+ "38af09d98727705120c921bb5e9e26296a3cdcf2f35757a0eafd87b830e7", -+ "5b0125e4dbea0ec7206da0fc01d9b081329fb555de6ef460237dff8be4ba", -+ "7fffffffffffffffffffffff800000cfa7e8594377d414c03821bc582063", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 prime239v3", -+ "1.2.840.10045.3.1.6", -+ "7fffffffffffffffffffffff7fffffffffff8000000000007fffffffffff", -+ "7fffffffffffffffffffffff7fffffffffff8000000000007ffffffffffc", -+ "255705fa2a306654b1f4cb03d6a750a30c250102d4988717d9ba15ab6d3e", -+ "6768ae8e18bb92cfcf005c949aa2c6d94853d0e660bbf854b1c9505fe95a", -+ "1607e6898f390c06bc1d552bad226f3b6fcfe48b6e818499af18e3ed6cf3", -+ "7fffffffffffffffffffffff7fffff975deb41b3a6057c3c432146526551", -+ 1) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect113r1", -+ "1.3.132.0.4", -+ "020000000000000000000000000201", -+ "003088250ca6e7c7fe649ce85820f7", -+ "00e8bee4d3e2260744188be0e9c723", -+ "009d73616f35f4ab1407d73562c10f", -+ "00a52830277958ee84d1315ed31886", -+ "0100000000000000d9ccec8a39e56f", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect113r2", -+ "1.3.132.0.5", -+ "020000000000000000000000000201", -+ "00689918dbec7e5a0dd6dfc0aa55c7", -+ "0095e9a9ec9b297bd4bf36e059184f", -+ "01a57a6a7b26ca5ef52fcdb8164797", -+ "00b3adc94ed1fe674c06e695baba1d", -+ "010000000000000108789b2496af93", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect131r1", -+ "1.3.132.0.22", -+ "080000000000000000000000000000010d", -+ "07a11b09a76b562144418ff3ff8c2570b8", -+ "0217c05610884b63b9c6c7291678f9d341", -+ "0081baf91fdf9833c40f9c181343638399", -+ "078c6e7ea38c001f73c8134b1b4ef9e150", -+ "0400000000000000023123953a9464b54d", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect131r2", -+ "1.3.132.0.23", -+ "080000000000000000000000000000010d", -+ "03e5a88919d7cafcbf415f07c2176573b2", -+ "04b8266a46c55657ac734ce38f018f2192", -+ "0356dcd8f2f95031ad652d23951bb366a8", -+ "0648f06d867940a5366d9e265de9eb240f", -+ "0400000000000000016954a233049ba98f", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect163k1 [NIST K-163]", -+ "1.3.132.0.1", -+ "0800000000000000000000000000000000000000c9", -+ "000000000000000000000000000000000000000001", -+ "000000000000000000000000000000000000000001", -+ "02fe13c0537bbc11acaa07d793de4e6d5e5c94eee8", -+ "0289070fb05d38ff58321f2e800536d538ccdaa3d9", -+ "04000000000000000000020108a2e0cc0d99f8a5ef", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect163r1", -+ "1.3.132.0.2", -+ "0800000000000000000000000000000000000000c9", -+ "07b6882caaefa84f9554ff8428bd88e246d2782ae2", -+ "0713612dcddcb40aab946bda29ca91f73af958afd9", -+ "0369979697ab43897789566789567f787a7876a654", -+ "00435edb42efafb2989d51fefce3c80988f41ff883", -+ "03ffffffffffffffffffff48aab689c29ca710279b", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect163r2 [NIST B-163]", -+ "1.3.132.0.15", -+ "0800000000000000000000000000000000000000c9", -+ "000000000000000000000000000000000000000001", -+ "020a601907b8c953ca1481eb10512f78744a3205fd", -+ "03f0eba16286a2d57ea0991168d4994637e8343e36", -+ "00d51fbc6c71a0094fa2cdd545b11c5c0c797324f1", -+ "040000000000000000000292fe77e70c12a4234c33", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect193r1", -+ "1.3.132.0.24", -+ "02000000000000000000000000000000000000000000008001", -+ "0017858feb7a98975169e171f77b4087de098ac8a911df7b01", -+ "00fdfb49bfe6c3a89facadaa7a1e5bbc7cc1c2e5d831478814", -+ "01f481bc5f0ff84a74ad6cdf6fdef4bf6179625372d8c0c5e1", -+ "0025e399f2903712ccf3ea9e3a1ad17fb0b3201b6af7ce1b05", -+ "01000000000000000000000000c7f34a778f443acc920eba49", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect193r2", -+ "1.3.132.0.25", -+ "02000000000000000000000000000000000000000000008001", -+ "0163f35a5137c2ce3ea6ed8667190b0bc43ecd69977702709b", -+ "00c9bb9e8927d4d64c377e2ab2856a5b16e3efb7f61d4316ae", -+ "00d9b67d192e0367c803f39e1a7e82ca14a651350aae617e8f", -+ "01ce94335607c304ac29e7defbd9ca01f596f927224cdecf6c", -+ "010000000000000000000000015aab561b005413ccd4ee99d5", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect233k1 [NIST K-233]", -+ "1.3.132.0.26", -+ "020000000000000000000000000000000000000004000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "017232ba853a7e731af129f22ff4149563a419c26bf50a4c9d6eefad6126", -+ "01db537dece819b7f70f555a67c427a8cd9bf18aeb9b56e0c11056fae6a3", -+ "008000000000000000000000000000069d5bb915bcd46efb1ad5f173abdf", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect233r1 [NIST B-233]", -+ "1.3.132.0.27", -+ "020000000000000000000000000000000000000004000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "0066647ede6c332c7f8c0923bb58213b333b20e9ce4281fe115f7d8f90ad", -+ "00fac9dfcbac8313bb2139f1bb755fef65bc391f8b36f8f8eb7371fd558b", -+ "01006a08a41903350678e58528bebf8a0beff867a7ca36716f7e01f81052", -+ "01000000000000000000000000000013e974e72f8a6922031d2603cfe0d7", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect239k1", -+ "1.3.132.0.3", -+ "800000000000000000004000000000000000000000000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "29a0b6a887a983e9730988a68727a8b2d126c44cc2cc7b2a6555193035dc", -+ "76310804f12e549bdb011c103089e73510acb275fc312a5dc6b76553f0ca", -+ "2000000000000000000000000000005a79fec67cb6e91f1c1da800e478a5", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect283k1 [NIST K-283]", -+ "1.3.132.0.16", -+ "0800000000000000000000000000000000000000000000000000000000000000000010a1", -+ "000000000000000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0503213f78ca44883f1a3b8162f188e553cd265f23c1567a16876913b0c2ac2458492836", -+ "01ccda380f1c9e318d90f95d07e5426fe87e45c0e8184698e45962364e34116177dd2259", -+ "01ffffffffffffffffffffffffffffffffffe9ae2ed07577265dff7f94451e061e163c61", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect283r1 [NIST B-283]", -+ "1.3.132.0.17", -+ "0800000000000000000000000000000000000000000000000000000000000000000010a1", -+ "000000000000000000000000000000000000000000000000000000000000000000000001", -+ "027b680ac8b8596da5a4af8a19a0303fca97fd7645309fa2a581485af6263e313b79a2f5", -+ "05f939258db7dd90e1934f8c70b0dfec2eed25b8557eac9c80e2e198f8cdbecd86b12053", -+ "03676854fe24141cb98fe6d4b20d02b4516ff702350eddb0826779c813f0df45be8112f4", -+ "03ffffffffffffffffffffffffffffffffffef90399660fc938a90165b042a7cefadb307", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect409k1 [NIST K-409]", -+ "1.3.132.0.36", -+ "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0060f05f658f49c1ad3ab1890f7184210efd0987e307c84c27accfb8f9f67cc2c460189eb5aaaa62ee222eb1b35540cfe9023746", -+ "01e369050b7c4e42acba1dacbf04299c3460782f918ea427e6325165e9ea10e3da5f6c42e9c55215aa9ca27a5863ec48d8e0286b", -+ "007ffffffffffffffffffffffffffffffffffffffffffffffffffe5f83b2d4ea20400ec4557d5ed3e3e7ca5b4b5c83b8e01e5fcf", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect409r1 [NIST B-409]", -+ "1.3.132.0.37", -+ "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0021a5c2c8ee9feb5c4b9a753b7b476b7fd6422ef1f3dd674761fa99d6ac27c8a9a197b272822f6cd57a55aa4f50ae317b13545f", -+ "015d4860d088ddb3496b0c6064756260441cde4af1771d4db01ffe5b34e59703dc255a868a1180515603aeab60794e54bb7996a7", -+ "0061b1cfab6be5f32bbfa78324ed106a7636b9c5a7bd198d0158aa4f5488d08f38514f1fdf4b4f40d2181b3681c364ba0273c706", -+ "010000000000000000000000000000000000000000000000000001e2aad6a612f33307be5fa47c3c9e052f838164cd37d9a21173", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect571k1 [NIST K-571]", -+ "1.3.132.0.38", -+ "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "026eb7a859923fbc82189631f8103fe4ac9ca2970012d5d46024804801841ca44370958493b205e647da304db4ceb08cbbd1ba39494776fb988b47174dca88c7e2945283a01c8972", -+ "0349dc807f4fbf374f4aeade3bca95314dd58cec9f307a54ffc61efc006d8a2c9d4979c0ac44aea74fbebbb9f772aedcb620b01a7ba7af1b320430c8591984f601cd4c143ef1c7a3", -+ "020000000000000000000000000000000000000000000000000000000000000000000000131850e1f19a63e4b391a8db917f4138b630d84be5d639381e91deb45cfe778f637c1001", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "sect571r1 [NIST B-571]", -+ "1.3.132.0.39", -+ "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "02f40e7e2221f295de297117b7f3d62f5c6a97ffcb8ceff1cd6ba8ce4a9a18ad84ffabbd8efa59332be7ad6756a66e294afd185a78ff12aa520e4de739baca0c7ffeff7f2955727a", -+ "0303001d34b856296c16c0d40d3cd7750a93d1d2955fa80aa5f40fc8db7b2abdbde53950f4c0d293cdd711a35b67fb1499ae60038614f1394abfa3b4c850d927e1e7769c8eec2d19", -+ "037bf27342da639b6dccfffeb73d69d78c6c27a6009cbbca1980f8533921e8a684423e43bab08a576291af8f461bb2a8b3531d2f0485c19b16e2f1516e23dd3c1a4827af1b8ac15b", -+ "03ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe661ce18ff55987308059b186823851ec7dd9ca1161de93d5174d66e8382e9bb2fe84e47", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb191v1", -+ "1.2.840.10045.3.0.5", -+ "800000000000000000000000000000000000000000000201", -+ "2866537b676752636a68f56554e12640276b649ef7526267", -+ "2e45ef571f00786f67b0081b9495a3d95462f5de0aa185ec", -+ "36b3daf8a23206f9c4f299d7b21a9c369137f2c84ae1aa0d", -+ "765be73433b3f95e332932e70ea245ca2418ea0ef98018fb", -+ "40000000000000000000000004a20e90c39067c893bbb9a5", -+ 2) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb191v2", -+ "1.2.840.10045.3.0.6", -+ "800000000000000000000000000000000000000000000201", -+ "401028774d7777c7b7666d1366ea432071274f89ff01e718", -+ "0620048d28bcbd03b6249c99182b7c8cd19700c362c46a01", -+ "3809b2b7cc1b28cc5a87926aad83fd28789e81e2c9e3bf10", -+ "17434386626d14f3dbf01760d9213a3e1cf37aec437d668a", -+ "20000000000000000000000050508cb89f652824e06b8173", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb191v3", -+ "1.2.840.10045.3.0.7", -+ "800000000000000000000000000000000000000000000201", -+ "6c01074756099122221056911c77d77e77a777e7e7e77fcb", -+ "71fe1af926cf847989efef8db459f66394d90f32ad3f15e8", -+ "375d4ce24fde434489de8746e71786015009e66e38a926dd", -+ "545a39176196575d985999366e6ad34ce0a77cd7127b06be", -+ "155555555555555555555555610c0b196812bfb6288a3ea3", -+ 6) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb239v1", -+ "1.2.840.10045.3.0.11", -+ "800000000000000000000000000000000000000000000000001000000001", -+ "32010857077c5431123a46b808906756f543423e8d27877578125778ac76", -+ "790408f2eedaf392b012edefb3392f30f4327c0ca3f31fc383c422aa8c16", -+ "57927098fa932e7c0a96d3fd5b706ef7e5f5c156e16b7e7c86038552e91d", -+ "61d8ee5077c33fecf6f1a16b268de469c3c7744ea9a971649fc7a9616305", -+ "2000000000000000000000000000000f4d42ffe1492a4993f1cad666e447", -+ 4) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb239v2", -+ "1.2.840.10045.3.0.12", -+ "800000000000000000000000000000000000000000000000001000000001", -+ "4230017757a767fae42398569b746325d45313af0766266479b75654e65f", -+ "5037ea654196cff0cd82b2c14a2fcf2e3ff8775285b545722f03eacdb74b", -+ "28f9d04e900069c8dc47a08534fe76d2b900b7d7ef31f5709f200c4ca205", -+ "5667334c45aff3b5a03bad9dd75e2c71a99362567d5453f7fa6e227ec833", -+ "1555555555555555555555555555553c6f2885259c31e3fcdf154624522d", -+ 6) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb239v3", -+ "1.2.840.10045.3.0.13", -+ "800000000000000000000000000000000000000000000000001000000001", -+ "01238774666a67766d6676f778e676b66999176666e687666d8766c66a9f", -+ "6a941977ba9f6a435199acfc51067ed587f519c5ecb541b8e44111de1d40", -+ "70f6e9d04d289c4e89913ce3530bfde903977d42b146d539bf1bde4e9c92", -+ "2e5a0eaf6e5e1305b9004dce5c0ed7fe59a35608f33837c816d80b79f461", -+ "0cccccccccccccccccccccccccccccac4912d2d9df903ef9888b8a0e4cff", -+ 0xA) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb359v1", -+ "1.2.840.10045.3.0.18", -+ "800000000000000000000000000000000000000000000000000000000000000000000000100000000000000001", -+ "5667676a654b20754f356ea92017d946567c46675556f19556a04616b567d223a5e05656fb549016a96656a557", -+ "2472e2d0197c49363f1fe7f5b6db075d52b6947d135d8ca445805d39bc345626089687742b6329e70680231988", -+ "3c258ef3047767e7ede0f1fdaa79daee3841366a132e163aced4ed2401df9c6bdcde98e8e707c07a2239b1b097", -+ "53d7e08529547048121e9c95f3791dd804963948f34fae7bf44ea82365dc7868fe57e4ae2de211305a407104bd", -+ "01af286bca1af286bca1af286bca1af286bca1af286bc9fb8f6b85c556892c20a7eb964fe7719e74f490758d3b", -+ 0x4C) -+ ); -+ -+ ecCurveDefinitions.add( -+ new ECCurveDefinition( -+ "X9.62 c2tnb431r1", -+ "1.2.840.10045.3.0.20", -+ "800000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000001", -+ "1a827ef00dd6fc0e234caf046c6a5d8a85395b236cc4ad2cf32a0cadbdc9ddf620b0eb9906d0957f6c6feacd615468df104de296cd8f", -+ "10d9b4a3d9047d8b154359abfb1b7f5485b04ceb868237ddc9deda982a679a5a919b626d4e50a8dd731b107a9962381fb5d807bf2618", -+ "120fc05d3c67a99de161d2f4092622feca701be4f50f4758714e8a87bbf2a658ef8c21e7c5efe965361f6c2999c0c247b0dbd70ce6b7", -+ "20d0af8903a96f8d5fa2c255745d3c451b302c9346d9b7e485e7bce41f6b591f3e8f6addcbb0bc4c2f947a7de1a89b625d6a598b3760", -+ "0340340340340340340340340340340340340340340340340340340323c313fab50589703b5ec68d3587fec60d161cc149c1ad4a91", -+ 0x2760) -+ ); - } - - public static String getOIDFromPublicKey(ECPublicKey ecPublicKey) { diff --git a/jdk/src/share/classes/java/io/ObjectInputStream.java b/jdk/src/share/classes/java/io/ObjectInputStream.java index 6fe0ed0b..b86b5fbe 100644 --- a/jdk/src/share/classes/java/io/ObjectInputStream.java @@ -167186,627 +166171,6 @@ index 32e2586e..e38541a9 100644 if (java_profile_name.length() > 0) { // profile name -diff --git a/jdk/src/share/classes/sun/security/ssl/SupportedGroupsExtension.java b/jdk/src/share/classes/sun/security/ssl/SupportedGroupsExtension.java -index 891406da..440ba056 100644 ---- a/jdk/src/share/classes/sun/security/ssl/SupportedGroupsExtension.java -+++ b/jdk/src/share/classes/sun/security/ssl/SupportedGroupsExtension.java -@@ -179,6 +179,70 @@ final class SupportedGroupsExtension { - // Elliptic Curves (RFC 4492) - // - // See sun.security.util.CurveDB for the OIDs -+ // NIST K-163 -+ SECT163_K1 (0x0001, "sect163k1", "1.3.132.0.1", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECT163_R1 (0x0002, "sect163r1", "1.3.132.0.2", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST B-163 -+ SECT163_R2 (0x0003, "sect163r2", "1.3.132.0.15", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECT193_R1 (0x0004, "sect193r1", "1.3.132.0.24", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECT193_R2 (0x0005, "sect193r2", "1.3.132.0.25", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST K-233 -+ SECT233_K1 (0x0006, "sect233k1", "1.3.132.0.26", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST B-233 -+ SECT233_R1 (0x0007, "sect233r1", "1.3.132.0.27", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECT239_K1 (0x0008, "sect239k1", "1.3.132.0.3", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST K-283 -+ SECT283_K1 (0x0009, "sect283k1", "1.3.132.0.16", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST B-283 -+ SECT283_R1 (0x000A, "sect283r1", "1.3.132.0.17", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST K-409 -+ SECT409_K1 (0x000B, "sect409k1", "1.3.132.0.36", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST B-409 -+ SECT409_R1 (0x000C, "sect409r1", "1.3.132.0.37", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST K-571 -+ SECT571_K1 (0x000D, "sect571k1", "1.3.132.0.38", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST B-571 -+ SECT571_R1 (0x000E, "sect571r1", "1.3.132.0.39", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECP160_K1 (0x000F, "secp160k1", "1.3.132.0.9", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECP160_R1 (0x0010, "secp160r1", "1.3.132.0.8", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECP160_R2 (0x0011, "secp160r2", "1.3.132.0.30", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECP192_K1 (0x0012, "secp192k1", "1.3.132.0.31", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ -+ // NIST P-192 -+ SECP192_R1 (0x0013, "secp192r1", "1.2.840.10045.3.1.1", true, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ SECP224_K1 (0x0014, "secp224k1", "1.3.132.0.32", false, -+ ProtocolVersion.PROTOCOLS_TO_12), -+ // NIST P-224 -+ SECP224_R1 (0x0015, "secp224r1", "1.3.132.0.33", true, -+ ProtocolVersion.PROTOCOLS_TO_12), - SECP256_K1 (0x0016, "secp256k1", "1.3.132.0.10", false, - ProtocolVersion.PROTOCOLS_TO_12), - -diff --git a/jdk/src/share/classes/sun/security/util/CurveDB.java b/jdk/src/share/classes/sun/security/util/CurveDB.java -index 7293201a..81ced2b6 100644 ---- a/jdk/src/share/classes/sun/security/util/CurveDB.java -+++ b/jdk/src/share/classes/sun/security/util/CurveDB.java -@@ -178,6 +178,105 @@ public class CurveDB { - Pattern nameSplitPattern = Holder.nameSplitPattern; - - /* SEC2 prime curves */ -+ add("secp112r1", "1.3.132.0.6", P, -+ "DB7C2ABF62E35E668076BEAD208B", -+ "DB7C2ABF62E35E668076BEAD2088", -+ "659EF8BA043916EEDE8911702B22", -+ "09487239995A5EE76B55F9C2F098", -+ "A89CE5AF8724C0A23E0E0FF77500", -+ "DB7C2ABF62E35E7628DFAC6561C5", -+ 1, nameSplitPattern); -+ -+ add("secp112r2", "1.3.132.0.7", P, -+ "DB7C2ABF62E35E668076BEAD208B", -+ "6127C24C05F38A0AAAF65C0EF02C", -+ "51DEF1815DB5ED74FCC34C85D709", -+ "4BA30AB5E892B4E1649DD0928643", -+ "adcd46f5882e3747def36e956e97", -+ "36DF0AAFD8B8D7597CA10520D04B", -+ 4, nameSplitPattern); -+ -+ add("secp128r1", "1.3.132.0.28", P, -+ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", -+ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC", -+ "E87579C11079F43DD824993C2CEE5ED3", -+ "161FF7528B899B2D0C28607CA52C5B86", -+ "CF5AC8395BAFEB13C02DA292DDED7A83", -+ "FFFFFFFE0000000075A30D1B9038A115", -+ 1, nameSplitPattern); -+ -+ add("secp128r2", "1.3.132.0.29", P, -+ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", -+ "D6031998D1B3BBFEBF59CC9BBFF9AEE1", -+ "5EEEFCA380D02919DC2C6558BB6D8A5D", -+ "7B6AA5D85E572983E6FB32A7CDEBC140", -+ "27B6916A894D3AEE7106FE805FC34B44", -+ "3FFFFFFF7FFFFFFFBE0024720613B5A3", -+ 4, nameSplitPattern); -+ -+ add("secp160k1", "1.3.132.0.9", P, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", -+ "0000000000000000000000000000000000000000", -+ "0000000000000000000000000000000000000007", -+ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB", -+ "938CF935318FDCED6BC28286531733C3F03C4FEE", -+ "0100000000000000000001B8FA16DFAB9ACA16B6B3", -+ 1, nameSplitPattern); -+ -+ add("secp160r1", "1.3.132.0.8", P, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC", -+ "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45", -+ "4A96B5688EF573284664698968C38BB913CBFC82", -+ "23A628553168947D59DCC912042351377AC5FB32", -+ "0100000000000000000001F4C8F927AED3CA752257", -+ 1, nameSplitPattern); -+ -+ add("secp160r2", "1.3.132.0.30", P, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70", -+ "B4E134D3FB59EB8BAB57274904664D5AF50388BA", -+ "52DCB034293A117E1F4FF11B30F7199D3144CE6D", -+ "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E", -+ "0100000000000000000000351EE786A818F3A1A16B", -+ 1, nameSplitPattern); -+ -+ add("secp192k1", "1.3.132.0.31", P, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", -+ "000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000003", -+ "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", -+ "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", -+ "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", -+ 1, nameSplitPattern); -+ -+ add("secp192r1 [NIST P-192, X9.62 prime192v1]", "1.2.840.10045.3.1.1", PD, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", -+ "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1", -+ "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012", -+ "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811", -+ "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", -+ 1, nameSplitPattern); -+ -+ add("secp224k1", "1.3.132.0.32", P, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", -+ "00000000000000000000000000000000000000000000000000000000", -+ "00000000000000000000000000000000000000000000000000000005", -+ "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", -+ "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", -+ "010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", -+ 1, nameSplitPattern); -+ -+ add("secp224r1 [NIST P-224]", "1.3.132.0.33", PD, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", -+ "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", -+ "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21", -+ "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", -+ 1, nameSplitPattern); -+ - add("secp256k1", "1.3.132.0.10", P, - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", - "0000000000000000000000000000000000000000000000000000000000000000", -@@ -214,6 +313,435 @@ public class CurveDB { - "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409", - 1, nameSplitPattern); - -+ /* ANSI X9.62 prime curves */ -+ add("X9.62 prime192v2", "1.2.840.10045.3.1.2", P, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", -+ "CC22D6DFB95C6B25E49C0D6364A4E5980C393AA21668D953", -+ "EEA2BAE7E1497842F2DE7769CFE9C989C072AD696F48034A", -+ "6574D11D69B6EC7A672BB82A083DF2F2B0847DE970B2DE15", -+ "FFFFFFFFFFFFFFFFFFFFFFFE5FB1A724DC80418648D8DD31", -+ 1, nameSplitPattern); -+ -+ add("X9.62 prime192v3", "1.2.840.10045.3.1.3", P, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", -+ "22123DC2395A05CAA7423DAECCC94760A7D462256BD56916", -+ "7D29778100C65A1DA1783716588DCE2B8B4AEE8E228F1896", -+ "38A90F22637337334B49DCB66A6DC8F9978ACA7648A943B0", -+ "FFFFFFFFFFFFFFFFFFFFFFFF7A62D031C83F4294F640EC13", -+ 1, nameSplitPattern); -+ -+ add("X9.62 prime239v1", "1.2.840.10045.3.1.4", P, -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC", -+ "6B016C3BDCF18941D0D654921475CA71A9DB2FB27D1D37796185C2942C0A", -+ "0FFA963CDCA8816CCC33B8642BEDF905C3D358573D3F27FBBD3B3CB9AAAF", -+ "7DEBE8E4E90A5DAE6E4054CA530BA04654B36818CE226B39FCCB7B02F1AE", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B", -+ 1, nameSplitPattern); -+ -+ add("X9.62 prime239v2", "1.2.840.10045.3.1.5", P, -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC", -+ "617FAB6832576CBBFED50D99F0249C3FEE58B94BA0038C7AE84C8C832F2C", -+ "38AF09D98727705120C921BB5E9E26296A3CDCF2F35757A0EAFD87B830E7", -+ "5B0125E4DBEA0EC7206DA0FC01D9B081329FB555DE6EF460237DFF8BE4BA", -+ "7FFFFFFFFFFFFFFFFFFFFFFF800000CFA7E8594377D414C03821BC582063", -+ 1, nameSplitPattern); -+ -+ add("X9.62 prime239v3", "1.2.840.10045.3.1.6", P, -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC", -+ "255705FA2A306654B1F4CB03D6A750A30C250102D4988717D9BA15AB6D3E", -+ "6768AE8E18BB92CFCF005C949AA2C6D94853D0E660BBF854B1C9505FE95A", -+ "1607E6898F390C06BC1D552BAD226F3B6FCFE48B6E818499AF18E3ED6CF3", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF975DEB41B3A6057C3C432146526551", -+ 1, nameSplitPattern); -+ -+ /* SEC2 binary curves */ -+ add("sect113r1", "1.3.132.0.4", B, -+ "020000000000000000000000000201", -+ "003088250CA6E7C7FE649CE85820F7", -+ "00E8BEE4D3E2260744188BE0E9C723", -+ "009D73616F35F4AB1407D73562C10F", -+ "00A52830277958EE84D1315ED31886", -+ "0100000000000000D9CCEC8A39E56F", -+ 2, nameSplitPattern); -+ -+ add("sect113r2", "1.3.132.0.5", B, -+ "020000000000000000000000000201", -+ "00689918DBEC7E5A0DD6DFC0AA55C7", -+ "0095E9A9EC9B297BD4BF36E059184F", -+ "01A57A6A7B26CA5EF52FCDB8164797", -+ "00B3ADC94ED1FE674C06E695BABA1D", -+ "010000000000000108789B2496AF93", -+ 2, nameSplitPattern); -+ -+ add("sect131r1", "1.3.132.0.22", B, -+ "080000000000000000000000000000010D", -+ "07A11B09A76B562144418FF3FF8C2570B8", -+ "0217C05610884B63B9C6C7291678F9D341", -+ "0081BAF91FDF9833C40F9C181343638399", -+ "078C6E7EA38C001F73C8134B1B4EF9E150", -+ "0400000000000000023123953A9464B54D", -+ 2, nameSplitPattern); -+ -+ add("sect131r2", "1.3.132.0.23", B, -+ "080000000000000000000000000000010D", -+ "03E5A88919D7CAFCBF415F07C2176573B2", -+ "04B8266A46C55657AC734CE38F018F2192", -+ "0356DCD8F2F95031AD652D23951BB366A8", -+ "0648F06D867940A5366D9E265DE9EB240F", -+ "0400000000000000016954A233049BA98F", -+ 2, nameSplitPattern); -+ -+ add("sect163k1 [NIST K-163]", "1.3.132.0.1", BD, -+ "0800000000000000000000000000000000000000C9", -+ "000000000000000000000000000000000000000001", -+ "000000000000000000000000000000000000000001", -+ "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8", -+ "0289070FB05D38FF58321F2E800536D538CCDAA3D9", -+ "04000000000000000000020108A2E0CC0D99F8A5EF", -+ 2, nameSplitPattern); -+ -+ add("sect163r1", "1.3.132.0.2", B, -+ "0800000000000000000000000000000000000000C9", -+ "07B6882CAAEFA84F9554FF8428BD88E246D2782AE2", -+ "0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9", -+ "0369979697AB43897789566789567F787A7876A654", -+ "00435EDB42EFAFB2989D51FEFCE3C80988F41FF883", -+ "03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B", -+ 2, nameSplitPattern); -+ -+ add("sect163r2 [NIST B-163]", "1.3.132.0.15", BD, -+ "0800000000000000000000000000000000000000C9", -+ "000000000000000000000000000000000000000001", -+ "020A601907B8C953CA1481EB10512F78744A3205FD", -+ "03F0EBA16286A2D57EA0991168D4994637E8343E36", -+ "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1", -+ "040000000000000000000292FE77E70C12A4234C33", -+ 2, nameSplitPattern); -+ -+ add("sect193r1", "1.3.132.0.24", B, -+ "02000000000000000000000000000000000000000000008001", -+ "0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01", -+ "00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814", -+ "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1", -+ "0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05", -+ "01000000000000000000000000C7F34A778F443ACC920EBA49", -+ 2, nameSplitPattern); -+ -+ add("sect193r2", "1.3.132.0.25", B, -+ "02000000000000000000000000000000000000000000008001", -+ "0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B", -+ "00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE", -+ "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F", -+ "01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C", -+ "010000000000000000000000015AAB561B005413CCD4EE99D5", -+ 2, nameSplitPattern); -+ -+ add("sect233k1 [NIST K-233]", "1.3.132.0.26", BD, -+ "020000000000000000000000000000000000000004000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126", -+ "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3", -+ "008000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", -+ 4, nameSplitPattern); -+ -+ add("sect233r1 [NIST B-233]", "1.3.132.0.27", B, -+ "020000000000000000000000000000000000000004000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD", -+ "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B", -+ "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052", -+ "01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", -+ 2, nameSplitPattern); -+ -+ add("sect239k1", "1.3.132.0.3", B, -+ "800000000000000000004000000000000000000000000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC", -+ "76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA", -+ "2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5", -+ 4, nameSplitPattern); -+ -+ add("sect283k1 [NIST K-283]", "1.3.132.0.16", BD, -+ "0800000000000000000000000000000000000000000000000000000000000000000010A1", -+ "000000000000000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836", -+ "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259", -+ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", -+ 4, nameSplitPattern); -+ -+ add("sect283r1 [NIST B-283]", "1.3.132.0.17", B, -+ "0800000000000000000000000000000000000000000000000000000000000000000010A1", -+ "000000000000000000000000000000000000000000000000000000000000000000000001", -+ "027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5", -+ "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053", -+ "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4", -+ "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", -+ 2, nameSplitPattern); -+ -+ add("sect409k1 [NIST K-409]", "1.3.132.0.36", BD, -+ "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746", -+ "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B", -+ "007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", -+ 4, nameSplitPattern); -+ -+ add("sect409r1 [NIST B-409]", "1.3.132.0.37", B, -+ "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F", -+ "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7", -+ "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706", -+ "010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", -+ 2, nameSplitPattern); -+ -+ add("sect571k1 [NIST K-571]", "1.3.132.0.38", BD, -+ "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972", -+ "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3", -+ "020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", -+ 4, nameSplitPattern); -+ -+ add("sect571r1 [NIST B-571]", "1.3.132.0.39", B, -+ "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A", -+ "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19", -+ "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B", -+ "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", -+ 2, nameSplitPattern); -+ -+ /* ANSI X9.62 binary curves */ -+ add("X9.62 c2tnb191v1", "1.2.840.10045.3.0.5", B, -+ "800000000000000000000000000000000000000000000201", -+ "2866537B676752636A68F56554E12640276B649EF7526267", -+ "2E45EF571F00786F67B0081B9495A3D95462F5DE0AA185EC", -+ "36B3DAF8A23206F9C4F299D7B21A9C369137F2C84AE1AA0D", -+ "765BE73433B3F95E332932E70EA245CA2418EA0EF98018FB", -+ "40000000000000000000000004A20E90C39067C893BBB9A5", -+ 2, nameSplitPattern); -+ -+ add("X9.62 c2tnb191v2", "1.2.840.10045.3.0.6", B, -+ "800000000000000000000000000000000000000000000201", -+ "401028774D7777C7B7666D1366EA432071274F89FF01E718", -+ "0620048D28BCBD03B6249C99182B7C8CD19700C362C46A01", -+ "3809B2B7CC1B28CC5A87926AAD83FD28789E81E2C9E3BF10", -+ "17434386626D14F3DBF01760D9213A3E1CF37AEC437D668A", -+ "20000000000000000000000050508CB89F652824E06B8173", -+ 4, nameSplitPattern); -+ -+ add("X9.62 c2tnb191v3", "1.2.840.10045.3.0.7", B, -+ "800000000000000000000000000000000000000000000201", -+ "6C01074756099122221056911C77D77E77A777E7E7E77FCB", -+ "71FE1AF926CF847989EFEF8DB459F66394D90F32AD3F15E8", -+ "375D4CE24FDE434489DE8746E71786015009E66E38A926DD", -+ "545A39176196575D985999366E6AD34CE0A77CD7127B06BE", -+ "155555555555555555555555610C0B196812BFB6288A3EA3", -+ 6, nameSplitPattern); -+ -+ add("X9.62 c2tnb239v1", "1.2.840.10045.3.0.11", B, -+ "800000000000000000000000000000000000000000000000001000000001", -+ "32010857077C5431123A46B808906756F543423E8D27877578125778AC76", -+ "790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16", -+ "57927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D", -+ "61D8EE5077C33FECF6F1A16B268DE469C3C7744EA9A971649FC7A9616305", -+ "2000000000000000000000000000000F4D42FFE1492A4993F1CAD666E447", -+ 4, nameSplitPattern); -+ -+ add("X9.62 c2tnb239v2", "1.2.840.10045.3.0.12", B, -+ "800000000000000000000000000000000000000000000000001000000001", -+ "4230017757A767FAE42398569B746325D45313AF0766266479B75654E65F", -+ "5037EA654196CFF0CD82B2C14A2FCF2E3FF8775285B545722F03EACDB74B", -+ "28F9D04E900069C8DC47A08534FE76D2B900B7D7EF31F5709F200C4CA205", -+ "5667334C45AFF3B5A03BAD9DD75E2C71A99362567D5453F7FA6E227EC833", -+ "1555555555555555555555555555553C6F2885259C31E3FCDF154624522D", -+ 6, nameSplitPattern); -+ -+ add("X9.62 c2tnb239v3", "1.2.840.10045.3.0.13", B, -+ "800000000000000000000000000000000000000000000000001000000001", -+ "01238774666A67766D6676F778E676B66999176666E687666D8766C66A9F", -+ "6A941977BA9F6A435199ACFC51067ED587F519C5ECB541B8E44111DE1D40", -+ "70F6E9D04D289C4E89913CE3530BFDE903977D42B146D539BF1BDE4E9C92", -+ "2E5A0EAF6E5E1305B9004DCE5C0ED7FE59A35608F33837C816D80B79F461", -+ "0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCAC4912D2D9DF903EF9888B8A0E4CFF", -+ 0xA, nameSplitPattern); -+ -+ add("X9.62 c2tnb359v1", "1.2.840.10045.3.0.18", B, -+ "800000000000000000000000000000000000000000000000000000000000000000000000100000000000000001", -+ "5667676A654B20754F356EA92017D946567C46675556F19556A04616B567D223A5E05656FB549016A96656A557", -+ "2472E2D0197C49363F1FE7F5B6DB075D52B6947D135D8CA445805D39BC345626089687742B6329E70680231988", -+ "3C258EF3047767E7EDE0F1FDAA79DAEE3841366A132E163ACED4ED2401DF9C6BDCDE98E8E707C07A2239B1B097", -+ "53D7E08529547048121E9C95F3791DD804963948F34FAE7BF44EA82365DC7868FE57E4AE2DE211305A407104BD", -+ "01AF286BCA1AF286BCA1AF286BCA1AF286BCA1AF286BC9FB8F6B85C556892C20A7EB964FE7719E74F490758D3B", -+ 0x4C, nameSplitPattern); -+ -+ add("X9.62 c2tnb431r1", "1.2.840.10045.3.0.20", B, -+ "800000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000001", -+ "1A827EF00DD6FC0E234CAF046C6A5D8A85395B236CC4AD2CF32A0CADBDC9DDF620B0EB9906D0957F6C6FEACD615468DF104DE296CD8F", -+ "10D9B4A3D9047D8B154359ABFB1B7F5485B04CEB868237DDC9DEDA982A679A5A919B626D4E50A8DD731B107A9962381FB5D807BF2618", -+ "120FC05D3C67A99DE161D2F4092622FECA701BE4F50F4758714E8A87BBF2A658EF8C21E7C5EFE965361F6C2999C0C247B0DBD70CE6B7", -+ "20D0AF8903A96F8D5FA2C255745D3C451B302C9346D9B7E485E7BCE41F6B591F3E8F6ADDCBB0BC4C2F947A7DE1A89B625D6A598B3760", -+ "0340340340340340340340340340340340340340340340340340340323C313FAB50589703B5EC68D3587FEC60D161CC149C1AD4A91", -+ 0x2760, nameSplitPattern); -+ -+ /* ANSI X9.62 binary curves from the 1998 standard but forbidden -+ * in the 2005 version of the standard. -+ * We don't register them but leave them here for the time being in -+ * case we need to support them after all. -+ */ -+/* -+ add("X9.62 c2pnb163v1", "1.2.840.10045.3.0.1", B, -+ "080000000000000000000000000000000000000107", -+ "072546B5435234A422E0789675F432C89435DE5242", -+ "00C9517D06D5240D3CFF38C74B20B6CD4D6F9DD4D9", -+ "07AF69989546103D79329FCC3D74880F33BBE803CB", -+ "01EC23211B5966ADEA1D3F87F7EA5848AEF0B7CA9F", -+ "0400000000000000000001E60FC8821CC74DAEAFC1", -+ 2, nameSplitPattern); -+ -+ add("X9.62 c2pnb163v2", "1.2.840.10045.3.0.2", B, -+ "080000000000000000000000000000000000000107", -+ "0108B39E77C4B108BED981ED0E890E117C511CF072", -+ "0667ACEB38AF4E488C407433FFAE4F1C811638DF20", -+ "0024266E4EB5106D0A964D92C4860E2671DB9B6CC5", -+ "079F684DDF6684C5CD258B3890021B2386DFD19FC5", -+ "03FFFFFFFFFFFFFFFFFFFDF64DE1151ADBB78F10A7", -+ 2, nameSplitPattern); -+ -+ add("X9.62 c2pnb163v3", "1.2.840.10045.3.0.3", B, -+ "080000000000000000000000000000000000000107", -+ "07A526C63D3E25A256A007699F5447E32AE456B50E", -+ "03F7061798EB99E238FD6F1BF95B48FEEB4854252B", -+ "02F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB", -+ "05B935590C155E17EA48EB3FF3718B893DF59A05D0", -+ "03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309", -+ 2, nameSplitPattern); -+ -+ add("X9.62 c2pnb176w1", "1.2.840.10045.3.0.4", B, -+ "0100000000000000000000000000000000080000000007", -+ "E4E6DB2995065C407D9D39B8D0967B96704BA8E9C90B", -+ "5DDA470ABE6414DE8EC133AE28E9BBD7FCEC0AE0FFF2", -+ "8D16C2866798B600F9F08BB4A8E860F3298CE04A5798", -+ "6FA4539C2DADDDD6BAB5167D61B436E1D92BB16A562C", -+ "00010092537397ECA4F6145799D62B0A19CE06FE26AD", -+ 0xFF6E, nameSplitPattern); -+ -+ add("X9.62 c2pnb208w1", "1.2.840.10045.3.0.10", B, -+ "010000000000000000000000000000000800000000000000000007", -+ "0000000000000000000000000000000000000000000000000000", -+ "C8619ED45A62E6212E1160349E2BFA844439FAFC2A3FD1638F9E", -+ "89FDFBE4ABE193DF9559ECF07AC0CE78554E2784EB8C1ED1A57A", -+ "0F55B51A06E78E9AC38A035FF520D8B01781BEB1A6BB08617DE3", -+ "000101BAF95C9723C57B6C21DA2EFF2D5ED588BDD5717E212F9D", -+ 0xFE48, nameSplitPattern); -+ -+ add("X9.62 c2pnb272w1", "1.2.840.10045.3.0.16", B, -+ "010000000000000000000000000000000000000000000000000000010000000000000B", -+ "91A091F03B5FBA4AB2CCF49C4EDD220FB028712D42BE752B2C40094DBACDB586FB20", -+ "7167EFC92BB2E3CE7C8AAAFF34E12A9C557003D7C73A6FAF003F99F6CC8482E540F7", -+ "6108BABB2CEEBCF787058A056CBE0CFE622D7723A289E08A07AE13EF0D10D171DD8D", -+ "10C7695716851EEF6BA7F6872E6142FBD241B830FF5EFCACECCAB05E02005DDE9D23", -+ "000100FAF51354E0E39E4892DF6E319C72C8161603FA45AA7B998A167B8F1E629521", -+ 0xFF06, nameSplitPattern); -+ -+ add("X9.62 c2pnb304w1", "1.2.840.10045.3.0.17", B, -+ "010000000000000000000000000000000000000000000000000000000000000000000000000807", -+ "FD0D693149A118F651E6DCE6802085377E5F882D1B510B44160074C1288078365A0396C8E681", -+ "BDDB97E555A50A908E43B01C798EA5DAA6788F1EA2794EFCF57166B8C14039601E55827340BE", -+ "197B07845E9BE2D96ADB0F5F3C7F2CFFBD7A3EB8B6FEC35C7FD67F26DDF6285A644F740A2614", -+ "E19FBEB76E0DA171517ECF401B50289BF014103288527A9B416A105E80260B549FDC1B92C03B", -+ "000101D556572AABAC800101D556572AABAC8001022D5C91DD173F8FB561DA6899164443051D", -+ 0xFE2E, nameSplitPattern); -+ -+ add("X9.62 c2pnb368w1", "1.2.840.10045.3.0.19", B, -+ "0100000000000000000000000000000000000000000000000000000000000000000000002000000000000000000007", -+ "E0D2EE25095206F5E2A4F9ED229F1F256E79A0E2B455970D8D0D865BD94778C576D62F0AB7519CCD2A1A906AE30D", -+ "FC1217D4320A90452C760A58EDCD30C8DD069B3C34453837A34ED50CB54917E1C2112D84D164F444F8F74786046A", -+ "1085E2755381DCCCE3C1557AFA10C2F0C0C2825646C5B34A394CBCFA8BC16B22E7E789E927BE216F02E1FB136A5F", -+ "7B3EB1BDDCBA62D5D8B2059B525797FC73822C59059C623A45FF3843CEE8F87CD1855ADAA81E2A0750B80FDA2310", -+ "00010090512DA9AF72B08349D98A5DD4C7B0532ECA51CE03E2D10F3B7AC579BD87E909AE40A6F131E9CFCE5BD967", -+ 0xFF70, nameSplitPattern); -+*/ -+ -+ /* -+ * Brainpool curves (RFC 5639) -+ * (Twisted curves are not included) -+ */ -+ -+ add("brainpoolP160r1", "1.3.36.3.3.2.8.1.1.1", P, -+ "E95E4A5F737059DC60DFC7AD95B3D8139515620F", -+ "340E7BE2A280EB74E2BE61BADA745D97E8F7C300", -+ "1E589A8595423412134FAA2DBDEC95C8D8675E58", -+ "BED5AF16EA3F6A4F62938C4631EB5AF7BDBCDBC3", -+ "1667CB477A1A8EC338F94741669C976316DA6321", -+ "E95E4A5F737059DC60DF5991D45029409E60FC09", -+ 1, nameSplitPattern); -+ -+ add("brainpoolP192r1", "1.3.36.3.3.2.8.1.1.3", P, -+ "C302F41D932A36CDA7A3463093D18DB78FCE476DE1A86297", -+ "6A91174076B1E0E19C39C031FE8685C1CAE040E5C69A28EF", -+ "469A28EF7C28CCA3DC721D044F4496BCCA7EF4146FBF25C9", -+ "C0A0647EAAB6A48753B033C56CB0F0900A2F5C4853375FD6", -+ "14B690866ABD5BB88B5F4828C1490002E6773FA2FA299B8F", -+ "C302F41D932A36CDA7A3462F9E9E916B5BE8F1029AC4ACC1", -+ 1, nameSplitPattern); -+ -+ add("brainpoolP224r1", "1.3.36.3.3.2.8.1.1.5", P, -+ "D7C134AA264366862A18302575D1D787B09F075797DA89F57EC8C0FF", -+ "68A5E62CA9CE6C1C299803A6C1530B514E182AD8B0042A59CAD29F43", -+ "2580F63CCFE44138870713B1A92369E33E2135D266DBB372386C400B", -+ "0D9029AD2C7E5CF4340823B2A87DC68C9E4CE3174C1E6EFDEE12C07D", -+ "58AA56F772C0726F24C6B89E4ECDAC24354B9E99CAA3F6D3761402CD", -+ "D7C134AA264366862A18302575D0FB98D116BC4B6DDEBCA3A5A7939F", -+ 1, nameSplitPattern); -+ -+ add("brainpoolP256r1", "1.3.36.3.3.2.8.1.1.7", P, -+ "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", -+ "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", -+ "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", -+ "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", -+ "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", -+ "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", -+ 1, nameSplitPattern); -+ -+ add("brainpoolP320r1", "1.3.36.3.3.2.8.1.1.9", P, -+ "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27", -+ "3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4", -+ "520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6", -+ "43BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C710AF8D0D39E20611", -+ "14FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7D35245D1692E8EE1", -+ "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311", -+ 1, nameSplitPattern); -+ -+ add("brainpoolP384r1", "1.3.36.3.3.2.8.1.1.11", P, -+ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", -+ "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", -+ "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", -+ "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", -+ "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", -+ "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", -+ 1, nameSplitPattern); -+ -+ add("brainpoolP512r1", "1.3.36.3.3.2.8.1.1.13", P, -+ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", -+ "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", -+ "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", -+ "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", -+ "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", -+ "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", -+ 1, nameSplitPattern); -+ - specCollection = Collections.unmodifiableCollection(oidMap.values()); - } - } diff --git a/jdk/src/share/demo/scripting/jconsole-plugin/README.txt b/jdk/src/share/demo/scripting/jconsole-plugin/README.txt index 44b42d1a..fc4bbf19 100644 --- a/jdk/src/share/demo/scripting/jconsole-plugin/README.txt @@ -168737,3897 +167101,6 @@ index 00000000..f39dea30 +// synonym to exit +var quit = exit; + -diff --git a/jdk/src/share/lib/security/java.security-aix b/jdk/src/share/lib/security/java.security-aix -index 1ea0d8fe..88df2b68 100644 ---- a/jdk/src/share/lib/security/java.security-aix -+++ b/jdk/src/share/lib/security/java.security-aix -@@ -456,7 +456,16 @@ sun.security.krb5.maxReferrals=5 - # in the jdk.[tls|certpath|jar].disabledAlgorithms properties. To include this - # list in any of the disabledAlgorithms properties, add the property name as - # an entry. --jdk.disabled.namedCurves = secp256k1 -+jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \ -+ secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \ -+ secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \ -+ sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \ -+ sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \ -+ sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \ -+ X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \ -+ X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \ -+ X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \ -+ brainpoolP320r1, brainpoolP384r1, brainpoolP512r1 - - # - # Algorithm restrictions for certification path (CertPath) processing -diff --git a/jdk/src/share/lib/security/java.security-linux b/jdk/src/share/lib/security/java.security-linux -index 4837e4bf..cd83750f 100644 ---- a/jdk/src/share/lib/security/java.security-linux -+++ b/jdk/src/share/lib/security/java.security-linux -@@ -456,7 +456,16 @@ sun.security.krb5.maxReferrals=5 - # in the jdk.[tls|certpath|jar].disabledAlgorithms properties. To include this - # list in any of the disabledAlgorithms properties, add the property name as - # an entry. --jdk.disabled.namedCurves = secp256k1 -+jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \ -+ secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \ -+ secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \ -+ sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \ -+ sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \ -+ sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \ -+ X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \ -+ X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \ -+ X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \ -+ brainpoolP320r1, brainpoolP384r1, brainpoolP512r1 - - # - # Algorithm restrictions for certification path (CertPath) processing -diff --git a/jdk/src/share/lib/security/java.security-macosx b/jdk/src/share/lib/security/java.security-macosx -index c3c7fb1d..a4d76c1e 100644 ---- a/jdk/src/share/lib/security/java.security-macosx -+++ b/jdk/src/share/lib/security/java.security-macosx -@@ -459,7 +459,16 @@ sun.security.krb5.maxReferrals=5 - # in the jdk.[tls|certpath|jar].disabledAlgorithms properties. To include this - # list in any of the disabledAlgorithms properties, add the property name as - # an entry. --jdk.disabled.namedCurves = secp256k1 -+jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \ -+ secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \ -+ secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \ -+ sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \ -+ sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \ -+ sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \ -+ X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \ -+ X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \ -+ X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \ -+ brainpoolP320r1, brainpoolP384r1, brainpoolP512r1 - - # - # Algorithm restrictions for certification path (CertPath) processing -diff --git a/jdk/src/share/lib/security/java.security-solaris b/jdk/src/share/lib/security/java.security-solaris -index a1eb78bb..a5bff609 100644 ---- a/jdk/src/share/lib/security/java.security-solaris -+++ b/jdk/src/share/lib/security/java.security-solaris -@@ -457,7 +457,16 @@ sun.security.krb5.maxReferrals=5 - # in the jdk.[tls|certpath|jar].disabledAlgorithms properties. To include this - # list in any of the disabledAlgorithms properties, add the property name as - # an entry. --jdk.disabled.namedCurves = secp256k1 -+jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \ -+ secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \ -+ secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \ -+ sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \ -+ sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \ -+ sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \ -+ X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \ -+ X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \ -+ X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \ -+ brainpoolP320r1, brainpoolP384r1, brainpoolP512r1 - - # - # Algorithm restrictions for certification path (CertPath) processing -diff --git a/jdk/src/share/lib/security/java.security-windows b/jdk/src/share/lib/security/java.security-windows -index a6891901..e9c6e43d 100644 ---- a/jdk/src/share/lib/security/java.security-windows -+++ b/jdk/src/share/lib/security/java.security-windows -@@ -459,7 +459,16 @@ sun.security.krb5.maxReferrals=5 - # in the jdk.[tls|certpath|jar].disabledAlgorithms properties. To include this - # list in any of the disabledAlgorithms properties, add the property name as - # an entry. --jdk.disabled.namedCurves = secp256k1 -+jdk.disabled.namedCurves = secp112r1, secp112r2, secp128r1, secp128r2, \ -+ secp160k1, secp160r1, secp160r2, secp192k1, secp192r1, secp224k1, \ -+ secp224r1, secp256k1, sect113r1, sect113r2, sect131r1, sect131r2, \ -+ sect163k1, sect163r1, sect163r2, sect193r1, sect193r2, sect233k1, \ -+ sect233r1, sect239k1, sect283k1, sect283r1, sect409k1, sect409r1, \ -+ sect571k1, sect571r1, X9.62 c2tnb191v1, X9.62 c2tnb191v2, \ -+ X9.62 c2tnb191v3, X9.62 c2tnb239v1, X9.62 c2tnb239v2, X9.62 c2tnb239v3, \ -+ X9.62 c2tnb359v1, X9.62 c2tnb431r1, X9.62 prime192v2, X9.62 prime192v3, \ -+ X9.62 prime239v1, X9.62 prime239v2, X9.62 prime239v3, brainpoolP256r1, \ -+ brainpoolP320r1, brainpoolP384r1, brainpoolP512r1 - - # - # Algorithm restrictions for certification path (CertPath) processing -diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2.h b/jdk/src/share/native/sun/security/ec/impl/ec2.h -new file mode 100644 -index 00000000..72df04ef ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ec2.h -@@ -0,0 +1,126 @@ -+/* -+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for binary polynomial field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Douglas Stebila , Sun Microsystems Laboratories -+ * -+ * Last Modified Date from the Original Code: May 2017 -+ *********************************************************************** */ -+ -+#ifndef _EC2_H -+#define _EC2_H -+ -+#include "ecl-priv.h" -+ -+/* Checks if point P(px, py) is at infinity. Uses affine coordinates. */ -+mp_err ec_GF2m_pt_is_inf_aff(const mp_int *px, const mp_int *py); -+ -+/* Sets P(px, py) to be the point at infinity. Uses affine coordinates. */ -+mp_err ec_GF2m_pt_set_inf_aff(mp_int *px, mp_int *py); -+ -+/* Computes R = P + Q where R is (rx, ry), P is (px, py) and Q is (qx, -+ * qy). Uses affine coordinates. */ -+mp_err ec_GF2m_pt_add_aff(const mp_int *px, const mp_int *py, -+ const mp_int *qx, const mp_int *qy, mp_int *rx, -+ mp_int *ry, const ECGroup *group); -+ -+/* Computes R = P - Q. Uses affine coordinates. */ -+mp_err ec_GF2m_pt_sub_aff(const mp_int *px, const mp_int *py, -+ const mp_int *qx, const mp_int *qy, mp_int *rx, -+ mp_int *ry, const ECGroup *group); -+ -+/* Computes R = 2P. Uses affine coordinates. */ -+mp_err ec_GF2m_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx, -+ mp_int *ry, const ECGroup *group); -+ -+/* Validates a point on a GF2m curve. */ -+mp_err ec_GF2m_validate_point(const mp_int *px, const mp_int *py, const ECGroup *group); -+ -+/* by default, this routine is unused and thus doesn't need to be compiled */ -+#ifdef ECL_ENABLE_GF2M_PT_MUL_AFF -+/* Computes R = nP where R is (rx, ry) and P is (px, py). The parameters -+ * a, b and p are the elliptic curve coefficients and the irreducible that -+ * determines the field GF2m. Uses affine coordinates. */ -+mp_err ec_GF2m_pt_mul_aff(const mp_int *n, const mp_int *px, -+ const mp_int *py, mp_int *rx, mp_int *ry, -+ const ECGroup *group); -+#endif -+ -+/* Computes R = nP where R is (rx, ry) and P is (px, py). The parameters -+ * a, b and p are the elliptic curve coefficients and the irreducible that -+ * determines the field GF2m. Uses Montgomery projective coordinates. */ -+mp_err ec_GF2m_pt_mul_mont(const mp_int *n, const mp_int *px, -+ const mp_int *py, mp_int *rx, mp_int *ry, -+ const ECGroup *group, int timing); -+ -+#ifdef ECL_ENABLE_GF2M_PROJ -+/* Converts a point P(px, py) from affine coordinates to projective -+ * coordinates R(rx, ry, rz). */ -+mp_err ec_GF2m_pt_aff2proj(const mp_int *px, const mp_int *py, mp_int *rx, -+ mp_int *ry, mp_int *rz, const ECGroup *group); -+ -+/* Converts a point P(px, py, pz) from projective coordinates to affine -+ * coordinates R(rx, ry). */ -+mp_err ec_GF2m_pt_proj2aff(const mp_int *px, const mp_int *py, -+ const mp_int *pz, mp_int *rx, mp_int *ry, -+ const ECGroup *group); -+ -+/* Checks if point P(px, py, pz) is at infinity. Uses projective -+ * coordinates. */ -+mp_err ec_GF2m_pt_is_inf_proj(const mp_int *px, const mp_int *py, -+ const mp_int *pz); -+ -+/* Sets P(px, py, pz) to be the point at infinity. Uses projective -+ * coordinates. */ -+mp_err ec_GF2m_pt_set_inf_proj(mp_int *px, mp_int *py, mp_int *pz); -+ -+/* Computes R = P + Q where R is (rx, ry, rz), P is (px, py, pz) and Q is -+ * (qx, qy, qz). Uses projective coordinates. */ -+mp_err ec_GF2m_pt_add_proj(const mp_int *px, const mp_int *py, -+ const mp_int *pz, const mp_int *qx, -+ const mp_int *qy, mp_int *rx, mp_int *ry, -+ mp_int *rz, const ECGroup *group); -+ -+/* Computes R = 2P. Uses projective coordinates. */ -+mp_err ec_GF2m_pt_dbl_proj(const mp_int *px, const mp_int *py, -+ const mp_int *pz, mp_int *rx, mp_int *ry, -+ mp_int *rz, const ECGroup *group); -+ -+/* Computes R = nP where R is (rx, ry) and P is (px, py). The parameters -+ * a, b and p are the elliptic curve coefficients and the prime that -+ * determines the field GF2m. Uses projective coordinates. */ -+mp_err ec_GF2m_pt_mul_proj(const mp_int *n, const mp_int *px, -+ const mp_int *py, mp_int *rx, mp_int *ry, -+ const ECGroup *group); -+#endif -+ -+#endif /* _EC2_H */ -diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_163.c b/jdk/src/share/native/sun/security/ec/impl/ec2_163.c -new file mode 100644 -index 00000000..d35d11d0 ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ec2_163.c -@@ -0,0 +1,260 @@ -+/* -+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for binary polynomial field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Sheueling Chang-Shantz , -+ * Stephen Fung , and -+ * Douglas Stebila , Sun Microsystems Laboratories. -+ * -+ *********************************************************************** */ -+ -+#include "ec2.h" -+#include "mp_gf2m.h" -+#include "mp_gf2m-priv.h" -+#include "mpi.h" -+#include "mpi-priv.h" -+#ifndef _KERNEL -+#include -+#endif -+ -+/* Fast reduction for polynomials over a 163-bit curve. Assumes reduction -+ * polynomial with terms {163, 7, 6, 3, 0}. */ -+mp_err -+ec_GF2m_163_mod(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit *u, z; -+ -+ if (a != r) { -+ MP_CHECKOK(mp_copy(a, r)); -+ } -+#ifdef ECL_SIXTY_FOUR_BIT -+ if (MP_USED(r) < 6) { -+ MP_CHECKOK(s_mp_pad(r, 6)); -+ } -+ u = MP_DIGITS(r); -+ MP_USED(r) = 6; -+ -+ /* u[5] only has 6 significant bits */ -+ z = u[5]; -+ u[2] ^= (z << 36) ^ (z << 35) ^ (z << 32) ^ (z << 29); -+ z = u[4]; -+ u[2] ^= (z >> 28) ^ (z >> 29) ^ (z >> 32) ^ (z >> 35); -+ u[1] ^= (z << 36) ^ (z << 35) ^ (z << 32) ^ (z << 29); -+ z = u[3]; -+ u[1] ^= (z >> 28) ^ (z >> 29) ^ (z >> 32) ^ (z >> 35); -+ u[0] ^= (z << 36) ^ (z << 35) ^ (z << 32) ^ (z << 29); -+ z = u[2] >> 35; /* z only has 29 significant bits */ -+ u[0] ^= (z << 7) ^ (z << 6) ^ (z << 3) ^ z; -+ /* clear bits above 163 */ -+ u[5] = u[4] = u[3] = 0; -+ u[2] ^= z << 35; -+#else -+ if (MP_USED(r) < 11) { -+ MP_CHECKOK(s_mp_pad(r, 11)); -+ } -+ u = MP_DIGITS(r); -+ MP_USED(r) = 11; -+ -+ /* u[11] only has 6 significant bits */ -+ z = u[10]; -+ u[5] ^= (z << 4) ^ (z << 3) ^ z ^ (z >> 3); -+ u[4] ^= (z << 29); -+ z = u[9]; -+ u[5] ^= (z >> 28) ^ (z >> 29); -+ u[4] ^= (z << 4) ^ (z << 3) ^ z ^ (z >> 3); -+ u[3] ^= (z << 29); -+ z = u[8]; -+ u[4] ^= (z >> 28) ^ (z >> 29); -+ u[3] ^= (z << 4) ^ (z << 3) ^ z ^ (z >> 3); -+ u[2] ^= (z << 29); -+ z = u[7]; -+ u[3] ^= (z >> 28) ^ (z >> 29); -+ u[2] ^= (z << 4) ^ (z << 3) ^ z ^ (z >> 3); -+ u[1] ^= (z << 29); -+ z = u[6]; -+ u[2] ^= (z >> 28) ^ (z >> 29); -+ u[1] ^= (z << 4) ^ (z << 3) ^ z ^ (z >> 3); -+ u[0] ^= (z << 29); -+ z = u[5] >> 3; /* z only has 29 significant bits */ -+ u[1] ^= (z >> 25) ^ (z >> 26); -+ u[0] ^= (z << 7) ^ (z << 6) ^ (z << 3) ^ z; -+ /* clear bits above 163 */ -+ u[11] = u[10] = u[9] = u[8] = u[7] = u[6] = 0; -+ u[5] ^= z << 3; -+#endif -+ s_mp_clamp(r); -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Fast squaring for polynomials over a 163-bit curve. Assumes reduction -+ * polynomial with terms {163, 7, 6, 3, 0}. */ -+mp_err -+ec_GF2m_163_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit *u, *v; -+ -+ v = MP_DIGITS(a); -+ -+#ifdef ECL_SIXTY_FOUR_BIT -+ if (MP_USED(a) < 3) { -+ return mp_bsqrmod(a, meth->irr_arr, r); -+ } -+ if (MP_USED(r) < 6) { -+ MP_CHECKOK(s_mp_pad(r, 6)); -+ } -+ MP_USED(r) = 6; -+#else -+ if (MP_USED(a) < 6) { -+ return mp_bsqrmod(a, meth->irr_arr, r); -+ } -+ if (MP_USED(r) < 12) { -+ MP_CHECKOK(s_mp_pad(r, 12)); -+ } -+ MP_USED(r) = 12; -+#endif -+ u = MP_DIGITS(r); -+ -+#ifdef ECL_THIRTY_TWO_BIT -+ u[11] = gf2m_SQR1(v[5]); -+ u[10] = gf2m_SQR0(v[5]); -+ u[9] = gf2m_SQR1(v[4]); -+ u[8] = gf2m_SQR0(v[4]); -+ u[7] = gf2m_SQR1(v[3]); -+ u[6] = gf2m_SQR0(v[3]); -+#endif -+ u[5] = gf2m_SQR1(v[2]); -+ u[4] = gf2m_SQR0(v[2]); -+ u[3] = gf2m_SQR1(v[1]); -+ u[2] = gf2m_SQR0(v[1]); -+ u[1] = gf2m_SQR1(v[0]); -+ u[0] = gf2m_SQR0(v[0]); -+ return ec_GF2m_163_mod(r, r, meth); -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Fast multiplication for polynomials over a 163-bit curve. Assumes -+ * reduction polynomial with terms {163, 7, 6, 3, 0}. */ -+mp_err -+ec_GF2m_163_mul(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit a2 = 0, a1 = 0, a0, b2 = 0, b1 = 0, b0; -+ -+#ifdef ECL_THIRTY_TWO_BIT -+ mp_digit a5 = 0, a4 = 0, a3 = 0, b5 = 0, b4 = 0, b3 = 0; -+ mp_digit rm[6]; -+#endif -+ -+ if (a == b) { -+ return ec_GF2m_163_sqr(a, r, meth); -+ } else { -+ switch (MP_USED(a)) { -+#ifdef ECL_THIRTY_TWO_BIT -+ case 6: -+ a5 = MP_DIGIT(a, 5); -+ case 5: -+ a4 = MP_DIGIT(a, 4); -+ case 4: -+ a3 = MP_DIGIT(a, 3); -+#endif -+ case 3: -+ a2 = MP_DIGIT(a, 2); -+ case 2: -+ a1 = MP_DIGIT(a, 1); -+ default: -+ a0 = MP_DIGIT(a, 0); -+ } -+ switch (MP_USED(b)) { -+#ifdef ECL_THIRTY_TWO_BIT -+ case 6: -+ b5 = MP_DIGIT(b, 5); -+ case 5: -+ b4 = MP_DIGIT(b, 4); -+ case 4: -+ b3 = MP_DIGIT(b, 3); -+#endif -+ case 3: -+ b2 = MP_DIGIT(b, 2); -+ case 2: -+ b1 = MP_DIGIT(b, 1); -+ default: -+ b0 = MP_DIGIT(b, 0); -+ } -+#ifdef ECL_SIXTY_FOUR_BIT -+ MP_CHECKOK(s_mp_pad(r, 6)); -+ s_bmul_3x3(MP_DIGITS(r), a2, a1, a0, b2, b1, b0); -+ MP_USED(r) = 6; -+ s_mp_clamp(r); -+#else -+ MP_CHECKOK(s_mp_pad(r, 12)); -+ s_bmul_3x3(MP_DIGITS(r) + 6, a5, a4, a3, b5, b4, b3); -+ s_bmul_3x3(MP_DIGITS(r), a2, a1, a0, b2, b1, b0); -+ s_bmul_3x3(rm, a5 ^ a2, a4 ^ a1, a3 ^ a0, b5 ^ b2, b4 ^ b1, -+ b3 ^ b0); -+ rm[5] ^= MP_DIGIT(r, 5) ^ MP_DIGIT(r, 11); -+ rm[4] ^= MP_DIGIT(r, 4) ^ MP_DIGIT(r, 10); -+ rm[3] ^= MP_DIGIT(r, 3) ^ MP_DIGIT(r, 9); -+ rm[2] ^= MP_DIGIT(r, 2) ^ MP_DIGIT(r, 8); -+ rm[1] ^= MP_DIGIT(r, 1) ^ MP_DIGIT(r, 7); -+ rm[0] ^= MP_DIGIT(r, 0) ^ MP_DIGIT(r, 6); -+ MP_DIGIT(r, 8) ^= rm[5]; -+ MP_DIGIT(r, 7) ^= rm[4]; -+ MP_DIGIT(r, 6) ^= rm[3]; -+ MP_DIGIT(r, 5) ^= rm[2]; -+ MP_DIGIT(r, 4) ^= rm[1]; -+ MP_DIGIT(r, 3) ^= rm[0]; -+ MP_USED(r) = 12; -+ s_mp_clamp(r); -+#endif -+ return ec_GF2m_163_mod(r, r, meth); -+ } -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Wire in fast field arithmetic for 163-bit curves. */ -+mp_err -+ec_group_set_gf2m163(ECGroup *group, ECCurveName name) -+{ -+ group->meth->field_mod = &ec_GF2m_163_mod; -+ group->meth->field_mul = &ec_GF2m_163_mul; -+ group->meth->field_sqr = &ec_GF2m_163_sqr; -+ return MP_OKAY; -+} -diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_193.c b/jdk/src/share/native/sun/security/ec/impl/ec2_193.c -new file mode 100644 -index 00000000..bbff2e50 ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ec2_193.c -@@ -0,0 +1,277 @@ -+/* -+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for binary polynomial field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Sheueling Chang-Shantz , -+ * Stephen Fung , and -+ * Douglas Stebila , Sun Microsystems Laboratories. -+ * -+ *********************************************************************** */ -+ -+#include "ec2.h" -+#include "mp_gf2m.h" -+#include "mp_gf2m-priv.h" -+#include "mpi.h" -+#include "mpi-priv.h" -+#ifndef _KERNEL -+#include -+#endif -+ -+/* Fast reduction for polynomials over a 193-bit curve. Assumes reduction -+ * polynomial with terms {193, 15, 0}. */ -+mp_err -+ec_GF2m_193_mod(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit *u, z; -+ -+ if (a != r) { -+ MP_CHECKOK(mp_copy(a, r)); -+ } -+#ifdef ECL_SIXTY_FOUR_BIT -+ if (MP_USED(r) < 7) { -+ MP_CHECKOK(s_mp_pad(r, 7)); -+ } -+ u = MP_DIGITS(r); -+ MP_USED(r) = 7; -+ -+ /* u[6] only has 2 significant bits */ -+ z = u[6]; -+ u[3] ^= (z << 14) ^ (z >> 1); -+ u[2] ^= (z << 63); -+ z = u[5]; -+ u[3] ^= (z >> 50); -+ u[2] ^= (z << 14) ^ (z >> 1); -+ u[1] ^= (z << 63); -+ z = u[4]; -+ u[2] ^= (z >> 50); -+ u[1] ^= (z << 14) ^ (z >> 1); -+ u[0] ^= (z << 63); -+ z = u[3] >> 1; /* z only has 63 significant bits */ -+ u[1] ^= (z >> 49); -+ u[0] ^= (z << 15) ^ z; -+ /* clear bits above 193 */ -+ u[6] = u[5] = u[4] = 0; -+ u[3] ^= z << 1; -+#else -+ if (MP_USED(r) < 13) { -+ MP_CHECKOK(s_mp_pad(r, 13)); -+ } -+ u = MP_DIGITS(r); -+ MP_USED(r) = 13; -+ -+ /* u[12] only has 2 significant bits */ -+ z = u[12]; -+ u[6] ^= (z << 14) ^ (z >> 1); -+ u[5] ^= (z << 31); -+ z = u[11]; -+ u[6] ^= (z >> 18); -+ u[5] ^= (z << 14) ^ (z >> 1); -+ u[4] ^= (z << 31); -+ z = u[10]; -+ u[5] ^= (z >> 18); -+ u[4] ^= (z << 14) ^ (z >> 1); -+ u[3] ^= (z << 31); -+ z = u[9]; -+ u[4] ^= (z >> 18); -+ u[3] ^= (z << 14) ^ (z >> 1); -+ u[2] ^= (z << 31); -+ z = u[8]; -+ u[3] ^= (z >> 18); -+ u[2] ^= (z << 14) ^ (z >> 1); -+ u[1] ^= (z << 31); -+ z = u[7]; -+ u[2] ^= (z >> 18); -+ u[1] ^= (z << 14) ^ (z >> 1); -+ u[0] ^= (z << 31); -+ z = u[6] >> 1; /* z only has 31 significant bits */ -+ u[1] ^= (z >> 17); -+ u[0] ^= (z << 15) ^ z; -+ /* clear bits above 193 */ -+ u[12] = u[11] = u[10] = u[9] = u[8] = u[7] = 0; -+ u[6] ^= z << 1; -+#endif -+ s_mp_clamp(r); -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Fast squaring for polynomials over a 193-bit curve. Assumes reduction -+ * polynomial with terms {193, 15, 0}. */ -+mp_err -+ec_GF2m_193_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit *u, *v; -+ -+ v = MP_DIGITS(a); -+ -+#ifdef ECL_SIXTY_FOUR_BIT -+ if (MP_USED(a) < 4) { -+ return mp_bsqrmod(a, meth->irr_arr, r); -+ } -+ if (MP_USED(r) < 7) { -+ MP_CHECKOK(s_mp_pad(r, 7)); -+ } -+ MP_USED(r) = 7; -+#else -+ if (MP_USED(a) < 7) { -+ return mp_bsqrmod(a, meth->irr_arr, r); -+ } -+ if (MP_USED(r) < 13) { -+ MP_CHECKOK(s_mp_pad(r, 13)); -+ } -+ MP_USED(r) = 13; -+#endif -+ u = MP_DIGITS(r); -+ -+#ifdef ECL_THIRTY_TWO_BIT -+ u[12] = gf2m_SQR0(v[6]); -+ u[11] = gf2m_SQR1(v[5]); -+ u[10] = gf2m_SQR0(v[5]); -+ u[9] = gf2m_SQR1(v[4]); -+ u[8] = gf2m_SQR0(v[4]); -+ u[7] = gf2m_SQR1(v[3]); -+#endif -+ u[6] = gf2m_SQR0(v[3]); -+ u[5] = gf2m_SQR1(v[2]); -+ u[4] = gf2m_SQR0(v[2]); -+ u[3] = gf2m_SQR1(v[1]); -+ u[2] = gf2m_SQR0(v[1]); -+ u[1] = gf2m_SQR1(v[0]); -+ u[0] = gf2m_SQR0(v[0]); -+ return ec_GF2m_193_mod(r, r, meth); -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Fast multiplication for polynomials over a 193-bit curve. Assumes -+ * reduction polynomial with terms {193, 15, 0}. */ -+mp_err -+ec_GF2m_193_mul(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit a3 = 0, a2 = 0, a1 = 0, a0, b3 = 0, b2 = 0, b1 = 0, b0; -+ -+#ifdef ECL_THIRTY_TWO_BIT -+ mp_digit a6 = 0, a5 = 0, a4 = 0, b6 = 0, b5 = 0, b4 = 0; -+ mp_digit rm[8]; -+#endif -+ -+ if (a == b) { -+ return ec_GF2m_193_sqr(a, r, meth); -+ } else { -+ switch (MP_USED(a)) { -+#ifdef ECL_THIRTY_TWO_BIT -+ case 7: -+ a6 = MP_DIGIT(a, 6); -+ case 6: -+ a5 = MP_DIGIT(a, 5); -+ case 5: -+ a4 = MP_DIGIT(a, 4); -+#endif -+ case 4: -+ a3 = MP_DIGIT(a, 3); -+ case 3: -+ a2 = MP_DIGIT(a, 2); -+ case 2: -+ a1 = MP_DIGIT(a, 1); -+ default: -+ a0 = MP_DIGIT(a, 0); -+ } -+ switch (MP_USED(b)) { -+#ifdef ECL_THIRTY_TWO_BIT -+ case 7: -+ b6 = MP_DIGIT(b, 6); -+ case 6: -+ b5 = MP_DIGIT(b, 5); -+ case 5: -+ b4 = MP_DIGIT(b, 4); -+#endif -+ case 4: -+ b3 = MP_DIGIT(b, 3); -+ case 3: -+ b2 = MP_DIGIT(b, 2); -+ case 2: -+ b1 = MP_DIGIT(b, 1); -+ default: -+ b0 = MP_DIGIT(b, 0); -+ } -+#ifdef ECL_SIXTY_FOUR_BIT -+ MP_CHECKOK(s_mp_pad(r, 8)); -+ s_bmul_4x4(MP_DIGITS(r), a3, a2, a1, a0, b3, b2, b1, b0); -+ MP_USED(r) = 8; -+ s_mp_clamp(r); -+#else -+ MP_CHECKOK(s_mp_pad(r, 14)); -+ s_bmul_3x3(MP_DIGITS(r) + 8, a6, a5, a4, b6, b5, b4); -+ s_bmul_4x4(MP_DIGITS(r), a3, a2, a1, a0, b3, b2, b1, b0); -+ s_bmul_4x4(rm, a3, a6 ^ a2, a5 ^ a1, a4 ^ a0, b3, b6 ^ b2, b5 ^ b1, -+ b4 ^ b0); -+ rm[7] ^= MP_DIGIT(r, 7); -+ rm[6] ^= MP_DIGIT(r, 6); -+ rm[5] ^= MP_DIGIT(r, 5) ^ MP_DIGIT(r, 13); -+ rm[4] ^= MP_DIGIT(r, 4) ^ MP_DIGIT(r, 12); -+ rm[3] ^= MP_DIGIT(r, 3) ^ MP_DIGIT(r, 11); -+ rm[2] ^= MP_DIGIT(r, 2) ^ MP_DIGIT(r, 10); -+ rm[1] ^= MP_DIGIT(r, 1) ^ MP_DIGIT(r, 9); -+ rm[0] ^= MP_DIGIT(r, 0) ^ MP_DIGIT(r, 8); -+ MP_DIGIT(r, 11) ^= rm[7]; -+ MP_DIGIT(r, 10) ^= rm[6]; -+ MP_DIGIT(r, 9) ^= rm[5]; -+ MP_DIGIT(r, 8) ^= rm[4]; -+ MP_DIGIT(r, 7) ^= rm[3]; -+ MP_DIGIT(r, 6) ^= rm[2]; -+ MP_DIGIT(r, 5) ^= rm[1]; -+ MP_DIGIT(r, 4) ^= rm[0]; -+ MP_USED(r) = 14; -+ s_mp_clamp(r); -+#endif -+ return ec_GF2m_193_mod(r, r, meth); -+ } -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Wire in fast field arithmetic for 193-bit curves. */ -+mp_err -+ec_group_set_gf2m193(ECGroup *group, ECCurveName name) -+{ -+ group->meth->field_mod = &ec_GF2m_193_mod; -+ group->meth->field_mul = &ec_GF2m_193_mul; -+ group->meth->field_sqr = &ec_GF2m_193_sqr; -+ return MP_OKAY; -+} -diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_233.c b/jdk/src/share/native/sun/security/ec/impl/ec2_233.c -new file mode 100644 -index 00000000..6ba2706c ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ec2_233.c -@@ -0,0 +1,300 @@ -+/* -+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for binary polynomial field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Sheueling Chang-Shantz , -+ * Stephen Fung , and -+ * Douglas Stebila , Sun Microsystems Laboratories. -+ * -+ *********************************************************************** */ -+ -+#include "ec2.h" -+#include "mp_gf2m.h" -+#include "mp_gf2m-priv.h" -+#include "mpi.h" -+#include "mpi-priv.h" -+#ifndef _KERNEL -+#include -+#endif -+ -+/* Fast reduction for polynomials over a 233-bit curve. Assumes reduction -+ * polynomial with terms {233, 74, 0}. */ -+mp_err -+ec_GF2m_233_mod(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit *u, z; -+ -+ if (a != r) { -+ MP_CHECKOK(mp_copy(a, r)); -+ } -+#ifdef ECL_SIXTY_FOUR_BIT -+ if (MP_USED(r) < 8) { -+ MP_CHECKOK(s_mp_pad(r, 8)); -+ } -+ u = MP_DIGITS(r); -+ MP_USED(r) = 8; -+ -+ /* u[7] only has 18 significant bits */ -+ z = u[7]; -+ u[4] ^= (z << 33) ^ (z >> 41); -+ u[3] ^= (z << 23); -+ z = u[6]; -+ u[4] ^= (z >> 31); -+ u[3] ^= (z << 33) ^ (z >> 41); -+ u[2] ^= (z << 23); -+ z = u[5]; -+ u[3] ^= (z >> 31); -+ u[2] ^= (z << 33) ^ (z >> 41); -+ u[1] ^= (z << 23); -+ z = u[4]; -+ u[2] ^= (z >> 31); -+ u[1] ^= (z << 33) ^ (z >> 41); -+ u[0] ^= (z << 23); -+ z = u[3] >> 41; /* z only has 23 significant bits */ -+ u[1] ^= (z << 10); -+ u[0] ^= z; -+ /* clear bits above 233 */ -+ u[7] = u[6] = u[5] = u[4] = 0; -+ u[3] ^= z << 41; -+#else -+ if (MP_USED(r) < 15) { -+ MP_CHECKOK(s_mp_pad(r, 15)); -+ } -+ u = MP_DIGITS(r); -+ MP_USED(r) = 15; -+ -+ /* u[14] only has 18 significant bits */ -+ z = u[14]; -+ u[9] ^= (z << 1); -+ u[7] ^= (z >> 9); -+ u[6] ^= (z << 23); -+ z = u[13]; -+ u[9] ^= (z >> 31); -+ u[8] ^= (z << 1); -+ u[6] ^= (z >> 9); -+ u[5] ^= (z << 23); -+ z = u[12]; -+ u[8] ^= (z >> 31); -+ u[7] ^= (z << 1); -+ u[5] ^= (z >> 9); -+ u[4] ^= (z << 23); -+ z = u[11]; -+ u[7] ^= (z >> 31); -+ u[6] ^= (z << 1); -+ u[4] ^= (z >> 9); -+ u[3] ^= (z << 23); -+ z = u[10]; -+ u[6] ^= (z >> 31); -+ u[5] ^= (z << 1); -+ u[3] ^= (z >> 9); -+ u[2] ^= (z << 23); -+ z = u[9]; -+ u[5] ^= (z >> 31); -+ u[4] ^= (z << 1); -+ u[2] ^= (z >> 9); -+ u[1] ^= (z << 23); -+ z = u[8]; -+ u[4] ^= (z >> 31); -+ u[3] ^= (z << 1); -+ u[1] ^= (z >> 9); -+ u[0] ^= (z << 23); -+ z = u[7] >> 9; /* z only has 23 significant bits */ -+ u[3] ^= (z >> 22); -+ u[2] ^= (z << 10); -+ u[0] ^= z; -+ /* clear bits above 233 */ -+ u[14] = u[13] = u[12] = u[11] = u[10] = u[9] = u[8] = 0; -+ u[7] ^= z << 9; -+#endif -+ s_mp_clamp(r); -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Fast squaring for polynomials over a 233-bit curve. Assumes reduction -+ * polynomial with terms {233, 74, 0}. */ -+mp_err -+ec_GF2m_233_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit *u, *v; -+ -+ v = MP_DIGITS(a); -+ -+#ifdef ECL_SIXTY_FOUR_BIT -+ if (MP_USED(a) < 4) { -+ return mp_bsqrmod(a, meth->irr_arr, r); -+ } -+ if (MP_USED(r) < 8) { -+ MP_CHECKOK(s_mp_pad(r, 8)); -+ } -+ MP_USED(r) = 8; -+#else -+ if (MP_USED(a) < 8) { -+ return mp_bsqrmod(a, meth->irr_arr, r); -+ } -+ if (MP_USED(r) < 15) { -+ MP_CHECKOK(s_mp_pad(r, 15)); -+ } -+ MP_USED(r) = 15; -+#endif -+ u = MP_DIGITS(r); -+ -+#ifdef ECL_THIRTY_TWO_BIT -+ u[14] = gf2m_SQR0(v[7]); -+ u[13] = gf2m_SQR1(v[6]); -+ u[12] = gf2m_SQR0(v[6]); -+ u[11] = gf2m_SQR1(v[5]); -+ u[10] = gf2m_SQR0(v[5]); -+ u[9] = gf2m_SQR1(v[4]); -+ u[8] = gf2m_SQR0(v[4]); -+#endif -+ u[7] = gf2m_SQR1(v[3]); -+ u[6] = gf2m_SQR0(v[3]); -+ u[5] = gf2m_SQR1(v[2]); -+ u[4] = gf2m_SQR0(v[2]); -+ u[3] = gf2m_SQR1(v[1]); -+ u[2] = gf2m_SQR0(v[1]); -+ u[1] = gf2m_SQR1(v[0]); -+ u[0] = gf2m_SQR0(v[0]); -+ return ec_GF2m_233_mod(r, r, meth); -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Fast multiplication for polynomials over a 233-bit curve. Assumes -+ * reduction polynomial with terms {233, 74, 0}. */ -+mp_err -+ec_GF2m_233_mul(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit a3 = 0, a2 = 0, a1 = 0, a0, b3 = 0, b2 = 0, b1 = 0, b0; -+ -+#ifdef ECL_THIRTY_TWO_BIT -+ mp_digit a7 = 0, a6 = 0, a5 = 0, a4 = 0, b7 = 0, b6 = 0, b5 = 0, b4 = -+ 0; -+ mp_digit rm[8]; -+#endif -+ -+ if (a == b) { -+ return ec_GF2m_233_sqr(a, r, meth); -+ } else { -+ switch (MP_USED(a)) { -+#ifdef ECL_THIRTY_TWO_BIT -+ case 8: -+ a7 = MP_DIGIT(a, 7); -+ case 7: -+ a6 = MP_DIGIT(a, 6); -+ case 6: -+ a5 = MP_DIGIT(a, 5); -+ case 5: -+ a4 = MP_DIGIT(a, 4); -+#endif -+ case 4: -+ a3 = MP_DIGIT(a, 3); -+ case 3: -+ a2 = MP_DIGIT(a, 2); -+ case 2: -+ a1 = MP_DIGIT(a, 1); -+ default: -+ a0 = MP_DIGIT(a, 0); -+ } -+ switch (MP_USED(b)) { -+#ifdef ECL_THIRTY_TWO_BIT -+ case 8: -+ b7 = MP_DIGIT(b, 7); -+ case 7: -+ b6 = MP_DIGIT(b, 6); -+ case 6: -+ b5 = MP_DIGIT(b, 5); -+ case 5: -+ b4 = MP_DIGIT(b, 4); -+#endif -+ case 4: -+ b3 = MP_DIGIT(b, 3); -+ case 3: -+ b2 = MP_DIGIT(b, 2); -+ case 2: -+ b1 = MP_DIGIT(b, 1); -+ default: -+ b0 = MP_DIGIT(b, 0); -+ } -+#ifdef ECL_SIXTY_FOUR_BIT -+ MP_CHECKOK(s_mp_pad(r, 8)); -+ s_bmul_4x4(MP_DIGITS(r), a3, a2, a1, a0, b3, b2, b1, b0); -+ MP_USED(r) = 8; -+ s_mp_clamp(r); -+#else -+ MP_CHECKOK(s_mp_pad(r, 16)); -+ s_bmul_4x4(MP_DIGITS(r) + 8, a7, a6, a5, a4, b7, b6, b5, b4); -+ s_bmul_4x4(MP_DIGITS(r), a3, a2, a1, a0, b3, b2, b1, b0); -+ s_bmul_4x4(rm, a7 ^ a3, a6 ^ a2, a5 ^ a1, a4 ^ a0, b7 ^ b3, -+ b6 ^ b2, b5 ^ b1, b4 ^ b0); -+ rm[7] ^= MP_DIGIT(r, 7) ^ MP_DIGIT(r, 15); -+ rm[6] ^= MP_DIGIT(r, 6) ^ MP_DIGIT(r, 14); -+ rm[5] ^= MP_DIGIT(r, 5) ^ MP_DIGIT(r, 13); -+ rm[4] ^= MP_DIGIT(r, 4) ^ MP_DIGIT(r, 12); -+ rm[3] ^= MP_DIGIT(r, 3) ^ MP_DIGIT(r, 11); -+ rm[2] ^= MP_DIGIT(r, 2) ^ MP_DIGIT(r, 10); -+ rm[1] ^= MP_DIGIT(r, 1) ^ MP_DIGIT(r, 9); -+ rm[0] ^= MP_DIGIT(r, 0) ^ MP_DIGIT(r, 8); -+ MP_DIGIT(r, 11) ^= rm[7]; -+ MP_DIGIT(r, 10) ^= rm[6]; -+ MP_DIGIT(r, 9) ^= rm[5]; -+ MP_DIGIT(r, 8) ^= rm[4]; -+ MP_DIGIT(r, 7) ^= rm[3]; -+ MP_DIGIT(r, 6) ^= rm[2]; -+ MP_DIGIT(r, 5) ^= rm[1]; -+ MP_DIGIT(r, 4) ^= rm[0]; -+ MP_USED(r) = 16; -+ s_mp_clamp(r); -+#endif -+ return ec_GF2m_233_mod(r, r, meth); -+ } -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Wire in fast field arithmetic for 233-bit curves. */ -+mp_err -+ec_group_set_gf2m233(ECGroup *group, ECCurveName name) -+{ -+ group->meth->field_mod = &ec_GF2m_233_mod; -+ group->meth->field_mul = &ec_GF2m_233_mul; -+ group->meth->field_sqr = &ec_GF2m_233_sqr; -+ return MP_OKAY; -+} -diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_aff.c b/jdk/src/share/native/sun/security/ec/impl/ec2_aff.c -new file mode 100644 -index 00000000..8d0f5460 ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ec2_aff.c -@@ -0,0 +1,349 @@ -+/* -+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for binary polynomial field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Douglas Stebila , Sun Microsystems Laboratories -+ * -+ * Last Modified Date from the Original Code: May 2017 -+ *********************************************************************** */ -+ -+#include "ec2.h" -+#include "mplogic.h" -+#include "mp_gf2m.h" -+#ifndef _KERNEL -+#include -+#endif -+ -+/* Checks if point P(px, py) is at infinity. Uses affine coordinates. */ -+mp_err -+ec_GF2m_pt_is_inf_aff(const mp_int *px, const mp_int *py) -+{ -+ -+ if ((mp_cmp_z(px) == 0) && (mp_cmp_z(py) == 0)) { -+ return MP_YES; -+ } else { -+ return MP_NO; -+ } -+ -+} -+ -+/* Sets P(px, py) to be the point at infinity. Uses affine coordinates. */ -+mp_err -+ec_GF2m_pt_set_inf_aff(mp_int *px, mp_int *py) -+{ -+ mp_zero(px); -+ mp_zero(py); -+ return MP_OKAY; -+} -+ -+/* Computes R = P + Q based on IEEE P1363 A.10.2. Elliptic curve points P, -+ * Q, and R can all be identical. Uses affine coordinates. */ -+mp_err -+ec_GF2m_pt_add_aff(const mp_int *px, const mp_int *py, const mp_int *qx, -+ const mp_int *qy, mp_int *rx, mp_int *ry, -+ const ECGroup *group) -+{ -+ mp_err res = MP_OKAY; -+ mp_int lambda, tempx, tempy; -+ -+ MP_DIGITS(&lambda) = 0; -+ MP_DIGITS(&tempx) = 0; -+ MP_DIGITS(&tempy) = 0; -+ MP_CHECKOK(mp_init(&lambda, FLAG(px))); -+ MP_CHECKOK(mp_init(&tempx, FLAG(px))); -+ MP_CHECKOK(mp_init(&tempy, FLAG(px))); -+ /* if P = inf, then R = Q */ -+ if (ec_GF2m_pt_is_inf_aff(px, py) == 0) { -+ MP_CHECKOK(mp_copy(qx, rx)); -+ MP_CHECKOK(mp_copy(qy, ry)); -+ res = MP_OKAY; -+ goto CLEANUP; -+ } -+ /* if Q = inf, then R = P */ -+ if (ec_GF2m_pt_is_inf_aff(qx, qy) == 0) { -+ MP_CHECKOK(mp_copy(px, rx)); -+ MP_CHECKOK(mp_copy(py, ry)); -+ res = MP_OKAY; -+ goto CLEANUP; -+ } -+ /* if px != qx, then lambda = (py+qy) / (px+qx), tempx = a + lambda^2 -+ * + lambda + px + qx */ -+ if (mp_cmp(px, qx) != 0) { -+ MP_CHECKOK(group->meth->field_add(py, qy, &tempy, group->meth)); -+ MP_CHECKOK(group->meth->field_add(px, qx, &tempx, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_div(&tempy, &tempx, &lambda, group->meth)); -+ MP_CHECKOK(group->meth->field_sqr(&lambda, &tempx, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&tempx, &lambda, &tempx, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&tempx, &group->curvea, &tempx, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&tempx, px, &tempx, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&tempx, qx, &tempx, group->meth)); -+ } else { -+ /* if py != qy or qx = 0, then R = inf */ -+ if (((mp_cmp(py, qy) != 0)) || (mp_cmp_z(qx) == 0)) { -+ mp_zero(rx); -+ mp_zero(ry); -+ res = MP_OKAY; -+ goto CLEANUP; -+ } -+ /* lambda = qx + qy / qx */ -+ MP_CHECKOK(group->meth->field_div(qy, qx, &lambda, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&lambda, qx, &lambda, group->meth)); -+ /* tempx = a + lambda^2 + lambda */ -+ MP_CHECKOK(group->meth->field_sqr(&lambda, &tempx, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&tempx, &lambda, &tempx, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&tempx, &group->curvea, &tempx, group->meth)); -+ } -+ /* ry = (qx + tempx) * lambda + tempx + qy */ -+ MP_CHECKOK(group->meth->field_add(qx, &tempx, &tempy, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_mul(&tempy, &lambda, &tempy, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_add(&tempy, &tempx, &tempy, group->meth)); -+ MP_CHECKOK(group->meth->field_add(&tempy, qy, ry, group->meth)); -+ /* rx = tempx */ -+ MP_CHECKOK(mp_copy(&tempx, rx)); -+ -+ CLEANUP: -+ mp_clear(&lambda); -+ mp_clear(&tempx); -+ mp_clear(&tempy); -+ return res; -+} -+ -+/* Computes R = P - Q. Elliptic curve points P, Q, and R can all be -+ * identical. Uses affine coordinates. */ -+mp_err -+ec_GF2m_pt_sub_aff(const mp_int *px, const mp_int *py, const mp_int *qx, -+ const mp_int *qy, mp_int *rx, mp_int *ry, -+ const ECGroup *group) -+{ -+ mp_err res = MP_OKAY; -+ mp_int nqy; -+ -+ MP_DIGITS(&nqy) = 0; -+ MP_CHECKOK(mp_init(&nqy, FLAG(px))); -+ /* nqy = qx+qy */ -+ MP_CHECKOK(group->meth->field_add(qx, qy, &nqy, group->meth)); -+ MP_CHECKOK(group->point_add(px, py, qx, &nqy, rx, ry, group)); -+ CLEANUP: -+ mp_clear(&nqy); -+ return res; -+} -+ -+/* Computes R = 2P. Elliptic curve points P and R can be identical. Uses -+ * affine coordinates. */ -+mp_err -+ec_GF2m_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx, -+ mp_int *ry, const ECGroup *group) -+{ -+ return group->point_add(px, py, px, py, rx, ry, group); -+} -+ -+/* by default, this routine is unused and thus doesn't need to be compiled */ -+#ifdef ECL_ENABLE_GF2M_PT_MUL_AFF -+/* Computes R = nP based on IEEE P1363 A.10.3. Elliptic curve points P and -+ * R can be identical. Uses affine coordinates. */ -+mp_err -+ec_GF2m_pt_mul_aff(const mp_int *n, const mp_int *px, const mp_int *py, -+ mp_int *rx, mp_int *ry, const ECGroup *group) -+{ -+ mp_err res = MP_OKAY; -+ mp_int k, k3, qx, qy, sx, sy; -+ int b1, b3, i, l; -+ -+ MP_DIGITS(&k) = 0; -+ MP_DIGITS(&k3) = 0; -+ MP_DIGITS(&qx) = 0; -+ MP_DIGITS(&qy) = 0; -+ MP_DIGITS(&sx) = 0; -+ MP_DIGITS(&sy) = 0; -+ MP_CHECKOK(mp_init(&k)); -+ MP_CHECKOK(mp_init(&k3)); -+ MP_CHECKOK(mp_init(&qx)); -+ MP_CHECKOK(mp_init(&qy)); -+ MP_CHECKOK(mp_init(&sx)); -+ MP_CHECKOK(mp_init(&sy)); -+ -+ /* if n = 0 then r = inf */ -+ if (mp_cmp_z(n) == 0) { -+ mp_zero(rx); -+ mp_zero(ry); -+ res = MP_OKAY; -+ goto CLEANUP; -+ } -+ /* Q = P, k = n */ -+ MP_CHECKOK(mp_copy(px, &qx)); -+ MP_CHECKOK(mp_copy(py, &qy)); -+ MP_CHECKOK(mp_copy(n, &k)); -+ /* if n < 0 then Q = -Q, k = -k */ -+ if (mp_cmp_z(n) < 0) { -+ MP_CHECKOK(group->meth->field_add(&qx, &qy, &qy, group->meth)); -+ MP_CHECKOK(mp_neg(&k, &k)); -+ } -+#ifdef ECL_DEBUG /* basic double and add method */ -+ l = mpl_significant_bits(&k) - 1; -+ MP_CHECKOK(mp_copy(&qx, &sx)); -+ MP_CHECKOK(mp_copy(&qy, &sy)); -+ for (i = l - 1; i >= 0; i--) { -+ /* S = 2S */ -+ MP_CHECKOK(group->point_dbl(&sx, &sy, &sx, &sy, group)); -+ /* if k_i = 1, then S = S + Q */ -+ if (mpl_get_bit(&k, i) != 0) { -+ MP_CHECKOK(group-> -+ point_add(&sx, &sy, &qx, &qy, &sx, &sy, group)); -+ } -+ } -+#else /* double and add/subtract method from -+ * standard */ -+ /* k3 = 3 * k */ -+ MP_CHECKOK(mp_set_int(&k3, 3)); -+ MP_CHECKOK(mp_mul(&k, &k3, &k3)); -+ /* S = Q */ -+ MP_CHECKOK(mp_copy(&qx, &sx)); -+ MP_CHECKOK(mp_copy(&qy, &sy)); -+ /* l = index of high order bit in binary representation of 3*k */ -+ l = mpl_significant_bits(&k3) - 1; -+ /* for i = l-1 downto 1 */ -+ for (i = l - 1; i >= 1; i--) { -+ /* S = 2S */ -+ MP_CHECKOK(group->point_dbl(&sx, &sy, &sx, &sy, group)); -+ b3 = MP_GET_BIT(&k3, i); -+ b1 = MP_GET_BIT(&k, i); -+ /* if k3_i = 1 and k_i = 0, then S = S + Q */ -+ if ((b3 == 1) && (b1 == 0)) { -+ MP_CHECKOK(group-> -+ point_add(&sx, &sy, &qx, &qy, &sx, &sy, group)); -+ /* if k3_i = 0 and k_i = 1, then S = S - Q */ -+ } else if ((b3 == 0) && (b1 == 1)) { -+ MP_CHECKOK(group-> -+ point_sub(&sx, &sy, &qx, &qy, &sx, &sy, group)); -+ } -+ } -+#endif -+ /* output S */ -+ MP_CHECKOK(mp_copy(&sx, rx)); -+ MP_CHECKOK(mp_copy(&sy, ry)); -+ -+ CLEANUP: -+ mp_clear(&k); -+ mp_clear(&k3); -+ mp_clear(&qx); -+ mp_clear(&qy); -+ mp_clear(&sx); -+ mp_clear(&sy); -+ return res; -+} -+#endif -+ -+/* Validates a point on a GF2m curve. */ -+mp_err -+ec_GF2m_validate_point(const mp_int *px, const mp_int *py, const ECGroup *group) -+{ -+ mp_err res = MP_NO; -+ mp_int accl, accr, tmp, pxt, pyt; -+ -+ MP_DIGITS(&accl) = 0; -+ MP_DIGITS(&accr) = 0; -+ MP_DIGITS(&tmp) = 0; -+ MP_DIGITS(&pxt) = 0; -+ MP_DIGITS(&pyt) = 0; -+ MP_CHECKOK(mp_init(&accl, FLAG(px))); -+ MP_CHECKOK(mp_init(&accr, FLAG(px))); -+ MP_CHECKOK(mp_init(&tmp, FLAG(px))); -+ MP_CHECKOK(mp_init(&pxt, FLAG(px))); -+ MP_CHECKOK(mp_init(&pyt, FLAG(px))); -+ -+ /* 1: Verify that publicValue is not the point at infinity */ -+ if (ec_GF2m_pt_is_inf_aff(px, py) == MP_YES) { -+ res = MP_NO; -+ goto CLEANUP; -+ } -+ /* 2: Verify that the coordinates of publicValue are elements -+ * of the field. -+ */ -+ if ((MP_SIGN(px) == MP_NEG) || (mp_cmp(px, &group->meth->irr) >= 0) || -+ (MP_SIGN(py) == MP_NEG) || (mp_cmp(py, &group->meth->irr) >= 0)) { -+ res = MP_NO; -+ goto CLEANUP; -+ } -+ /* 3: Verify that publicValue is on the curve. */ -+ if (group->meth->field_enc) { -+ group->meth->field_enc(px, &pxt, group->meth); -+ group->meth->field_enc(py, &pyt, group->meth); -+ } else { -+ mp_copy(px, &pxt); -+ mp_copy(py, &pyt); -+ } -+ /* left-hand side: y^2 + x*y */ -+ MP_CHECKOK( group->meth->field_sqr(&pyt, &accl, group->meth) ); -+ MP_CHECKOK( group->meth->field_mul(&pxt, &pyt, &tmp, group->meth) ); -+ MP_CHECKOK( group->meth->field_add(&accl, &tmp, &accl, group->meth) ); -+ /* right-hand side: x^3 + a*x^2 + b */ -+ MP_CHECKOK( group->meth->field_sqr(&pxt, &tmp, group->meth) ); -+ MP_CHECKOK( group->meth->field_mul(&pxt, &tmp, &accr, group->meth) ); -+ MP_CHECKOK( group->meth->field_mul(&group->curvea, &tmp, &tmp, group->meth) ); -+ MP_CHECKOK( group->meth->field_add(&tmp, &accr, &accr, group->meth) ); -+ MP_CHECKOK( group->meth->field_add(&accr, &group->curveb, &accr, group->meth) ); -+ /* check LHS - RHS == 0 */ -+ MP_CHECKOK( group->meth->field_add(&accl, &accr, &accr, group->meth) ); -+ if (mp_cmp_z(&accr) != 0) { -+ res = MP_NO; -+ goto CLEANUP; -+ } -+ /* 4: Verify that the order of the curve times the publicValue -+ * is the point at infinity. -+ */ -+ /* timing mitigation is not supported */ -+ MP_CHECKOK( ECPoint_mul(group, &group->order, px, py, &pxt, &pyt, /*timing*/ 0) ); -+ if (ec_GF2m_pt_is_inf_aff(&pxt, &pyt) != MP_YES) { -+ res = MP_NO; -+ goto CLEANUP; -+ } -+ -+ res = MP_YES; -+ -+CLEANUP: -+ mp_clear(&accl); -+ mp_clear(&accr); -+ mp_clear(&tmp); -+ mp_clear(&pxt); -+ mp_clear(&pyt); -+ return res; -+} -diff --git a/jdk/src/share/native/sun/security/ec/impl/ec2_mont.c b/jdk/src/share/native/sun/security/ec/impl/ec2_mont.c -new file mode 100644 -index 00000000..bb605536 ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ec2_mont.c -@@ -0,0 +1,278 @@ -+/* -+ * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for binary polynomial field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Sheueling Chang-Shantz , -+ * Stephen Fung , and -+ * Douglas Stebila , Sun Microsystems Laboratories. -+ * -+ * Last Modified Date from the Original Code: May 2017 -+ *********************************************************************** */ -+ -+#include "ec2.h" -+#include "mplogic.h" -+#include "mp_gf2m.h" -+#ifndef _KERNEL -+#include -+#endif -+ -+/* Compute the x-coordinate x/z for the point 2*(x/z) in Montgomery -+ * projective coordinates. Uses algorithm Mdouble in appendix of Lopez, J. -+ * and Dahab, R. "Fast multiplication on elliptic curves over GF(2^m) -+ * without precomputation". modified to not require precomputation of -+ * c=b^{2^{m-1}}. */ -+static mp_err -+gf2m_Mdouble(mp_int *x, mp_int *z, const ECGroup *group, int kmflag) -+{ -+ mp_err res = MP_OKAY; -+ mp_int t1; -+ -+ MP_DIGITS(&t1) = 0; -+ MP_CHECKOK(mp_init(&t1, kmflag)); -+ -+ MP_CHECKOK(group->meth->field_sqr(x, x, group->meth)); -+ MP_CHECKOK(group->meth->field_sqr(z, &t1, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(x, &t1, z, group->meth)); -+ MP_CHECKOK(group->meth->field_sqr(x, x, group->meth)); -+ MP_CHECKOK(group->meth->field_sqr(&t1, &t1, group->meth)); -+ MP_CHECKOK(group->meth-> -+ field_mul(&group->curveb, &t1, &t1, group->meth)); -+ MP_CHECKOK(group->meth->field_add(x, &t1, x, group->meth)); -+ -+ CLEANUP: -+ mp_clear(&t1); -+ return res; -+} -+ -+/* Compute the x-coordinate x1/z1 for the point (x1/z1)+(x2/x2) in -+ * Montgomery projective coordinates. Uses algorithm Madd in appendix of -+ * Lopex, J. and Dahab, R. "Fast multiplication on elliptic curves over -+ * GF(2^m) without precomputation". */ -+static mp_err -+gf2m_Madd(const mp_int *x, mp_int *x1, mp_int *z1, mp_int *x2, mp_int *z2, -+ const ECGroup *group, int kmflag) -+{ -+ mp_err res = MP_OKAY; -+ mp_int t1, t2; -+ -+ MP_DIGITS(&t1) = 0; -+ MP_DIGITS(&t2) = 0; -+ MP_CHECKOK(mp_init(&t1, kmflag)); -+ MP_CHECKOK(mp_init(&t2, kmflag)); -+ -+ MP_CHECKOK(mp_copy(x, &t1)); -+ MP_CHECKOK(group->meth->field_mul(x1, z2, x1, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(z1, x2, z1, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(x1, z1, &t2, group->meth)); -+ MP_CHECKOK(group->meth->field_add(z1, x1, z1, group->meth)); -+ MP_CHECKOK(group->meth->field_sqr(z1, z1, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(z1, &t1, x1, group->meth)); -+ MP_CHECKOK(group->meth->field_add(x1, &t2, x1, group->meth)); -+ -+ CLEANUP: -+ mp_clear(&t1); -+ mp_clear(&t2); -+ return res; -+} -+ -+/* Compute the x, y affine coordinates from the point (x1, z1) (x2, z2) -+ * using Montgomery point multiplication algorithm Mxy() in appendix of -+ * Lopex, J. and Dahab, R. "Fast multiplication on elliptic curves over -+ * GF(2^m) without precomputation". Returns: 0 on error 1 if return value -+ * should be the point at infinity 2 otherwise */ -+static int -+gf2m_Mxy(const mp_int *x, const mp_int *y, mp_int *x1, mp_int *z1, -+ mp_int *x2, mp_int *z2, const ECGroup *group) -+{ -+ mp_err res = MP_OKAY; -+ int ret = 0; -+ mp_int t3, t4, t5; -+ -+ MP_DIGITS(&t3) = 0; -+ MP_DIGITS(&t4) = 0; -+ MP_DIGITS(&t5) = 0; -+ MP_CHECKOK(mp_init(&t3, FLAG(x2))); -+ MP_CHECKOK(mp_init(&t4, FLAG(x2))); -+ MP_CHECKOK(mp_init(&t5, FLAG(x2))); -+ -+ if (mp_cmp_z(z1) == 0) { -+ mp_zero(x2); -+ mp_zero(z2); -+ ret = 1; -+ goto CLEANUP; -+ } -+ -+ if (mp_cmp_z(z2) == 0) { -+ MP_CHECKOK(mp_copy(x, x2)); -+ MP_CHECKOK(group->meth->field_add(x, y, z2, group->meth)); -+ ret = 2; -+ goto CLEANUP; -+ } -+ -+ MP_CHECKOK(mp_set_int(&t5, 1)); -+ if (group->meth->field_enc) { -+ MP_CHECKOK(group->meth->field_enc(&t5, &t5, group->meth)); -+ } -+ -+ MP_CHECKOK(group->meth->field_mul(z1, z2, &t3, group->meth)); -+ -+ MP_CHECKOK(group->meth->field_mul(z1, x, z1, group->meth)); -+ MP_CHECKOK(group->meth->field_add(z1, x1, z1, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(z2, x, z2, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(z2, x1, x1, group->meth)); -+ MP_CHECKOK(group->meth->field_add(z2, x2, z2, group->meth)); -+ -+ MP_CHECKOK(group->meth->field_mul(z2, z1, z2, group->meth)); -+ MP_CHECKOK(group->meth->field_sqr(x, &t4, group->meth)); -+ MP_CHECKOK(group->meth->field_add(&t4, y, &t4, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(&t4, &t3, &t4, group->meth)); -+ MP_CHECKOK(group->meth->field_add(&t4, z2, &t4, group->meth)); -+ -+ MP_CHECKOK(group->meth->field_mul(&t3, x, &t3, group->meth)); -+ MP_CHECKOK(group->meth->field_div(&t5, &t3, &t3, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(&t3, &t4, &t4, group->meth)); -+ MP_CHECKOK(group->meth->field_mul(x1, &t3, x2, group->meth)); -+ MP_CHECKOK(group->meth->field_add(x2, x, z2, group->meth)); -+ -+ MP_CHECKOK(group->meth->field_mul(z2, &t4, z2, group->meth)); -+ MP_CHECKOK(group->meth->field_add(z2, y, z2, group->meth)); -+ -+ ret = 2; -+ -+ CLEANUP: -+ mp_clear(&t3); -+ mp_clear(&t4); -+ mp_clear(&t5); -+ if (res == MP_OKAY) { -+ return ret; -+ } else { -+ return 0; -+ } -+} -+ -+/* Computes R = nP based on algorithm 2P of Lopex, J. and Dahab, R. "Fast -+ * multiplication on elliptic curves over GF(2^m) without -+ * precomputation". Elliptic curve points P and R can be identical. Uses -+ * Montgomery projective coordinates. The timing parameter is ignored -+ * because this algorithm resists timing attacks by default. */ -+mp_err -+ec_GF2m_pt_mul_mont(const mp_int *n, const mp_int *px, const mp_int *py, -+ mp_int *rx, mp_int *ry, const ECGroup *group, -+ int timing) -+{ -+ mp_err res = MP_OKAY; -+ mp_int x1, x2, z1, z2; -+ int i, j; -+ mp_digit top_bit, mask; -+ -+ MP_DIGITS(&x1) = 0; -+ MP_DIGITS(&x2) = 0; -+ MP_DIGITS(&z1) = 0; -+ MP_DIGITS(&z2) = 0; -+ MP_CHECKOK(mp_init(&x1, FLAG(n))); -+ MP_CHECKOK(mp_init(&x2, FLAG(n))); -+ MP_CHECKOK(mp_init(&z1, FLAG(n))); -+ MP_CHECKOK(mp_init(&z2, FLAG(n))); -+ -+ /* if result should be point at infinity */ -+ if ((mp_cmp_z(n) == 0) || (ec_GF2m_pt_is_inf_aff(px, py) == MP_YES)) { -+ MP_CHECKOK(ec_GF2m_pt_set_inf_aff(rx, ry)); -+ goto CLEANUP; -+ } -+ -+ MP_CHECKOK(mp_copy(px, &x1)); /* x1 = px */ -+ MP_CHECKOK(mp_set_int(&z1, 1)); /* z1 = 1 */ -+ MP_CHECKOK(group->meth->field_sqr(&x1, &z2, group->meth)); /* z2 = -+ * x1^2 = -+ * px^2 */ -+ MP_CHECKOK(group->meth->field_sqr(&z2, &x2, group->meth)); -+ MP_CHECKOK(group->meth->field_add(&x2, &group->curveb, &x2, group->meth)); /* x2 -+ * = -+ * px^4 -+ * + -+ * b -+ */ -+ -+ /* find top-most bit and go one past it */ -+ i = MP_USED(n) - 1; -+ j = MP_DIGIT_BIT - 1; -+ top_bit = 1; -+ top_bit <<= MP_DIGIT_BIT - 1; -+ mask = top_bit; -+ while (!(MP_DIGITS(n)[i] & mask)) { -+ mask >>= 1; -+ j--; -+ } -+ mask >>= 1; -+ j--; -+ -+ /* if top most bit was at word break, go to next word */ -+ if (!mask) { -+ i--; -+ j = MP_DIGIT_BIT - 1; -+ mask = top_bit; -+ } -+ -+ for (; i >= 0; i--) { -+ for (; j >= 0; j--) { -+ if (MP_DIGITS(n)[i] & mask) { -+ MP_CHECKOK(gf2m_Madd(px, &x1, &z1, &x2, &z2, group, FLAG(n))); -+ MP_CHECKOK(gf2m_Mdouble(&x2, &z2, group, FLAG(n))); -+ } else { -+ MP_CHECKOK(gf2m_Madd(px, &x2, &z2, &x1, &z1, group, FLAG(n))); -+ MP_CHECKOK(gf2m_Mdouble(&x1, &z1, group, FLAG(n))); -+ } -+ mask >>= 1; -+ } -+ j = MP_DIGIT_BIT - 1; -+ mask = top_bit; -+ } -+ -+ /* convert out of "projective" coordinates */ -+ i = gf2m_Mxy(px, py, &x1, &z1, &x2, &z2, group); -+ if (i == 0) { -+ res = MP_BADARG; -+ goto CLEANUP; -+ } else if (i == 1) { -+ MP_CHECKOK(ec_GF2m_pt_set_inf_aff(rx, ry)); -+ } else { -+ MP_CHECKOK(mp_copy(&x2, rx)); -+ MP_CHECKOK(mp_copy(&z2, ry)); -+ } -+ -+ CLEANUP: -+ mp_clear(&x1); -+ mp_clear(&x2); -+ mp_clear(&z1); -+ mp_clear(&z2); -+ return res; -+} -diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h b/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h -index a51fbd60..5ee89d67 100644 ---- a/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h -+++ b/jdk/src/share/native/sun/security/ec/impl/ecl-curve.h -@@ -44,6 +44,25 @@ - #endif - - /* NIST prime curves */ -+static const ECCurveParams ecCurve_NIST_P192 = { -+ "NIST-P192", ECField_GFp, 192, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", -+ "64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1", -+ "188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012", -+ "07192B95FFC8DA78631011ED6B24CDD573F977A11E794811", -+ "FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831", 1 -+}; -+ -+static const ECCurveParams ecCurve_NIST_P224 = { -+ "NIST-P224", ECField_GFp, 224, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE", -+ "B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4", -+ "B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21", -+ "BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D", 1 -+}; - - static const ECCurveParams ecCurve_NIST_P256 = { - "NIST-P256", ECField_GFp, 256, -@@ -77,7 +96,411 @@ static const ECCurveParams ecCurve_NIST_P521 = { - 1 - }; - -+/* NIST binary curves */ -+static const ECCurveParams ecCurve_NIST_K163 = { -+ "NIST-K163", ECField_GF2m, 163, -+ "0800000000000000000000000000000000000000C9", -+ "000000000000000000000000000000000000000001", -+ "000000000000000000000000000000000000000001", -+ "02FE13C0537BBC11ACAA07D793DE4E6D5E5C94EEE8", -+ "0289070FB05D38FF58321F2E800536D538CCDAA3D9", -+ "04000000000000000000020108A2E0CC0D99F8A5EF", 2 -+}; -+ -+static const ECCurveParams ecCurve_NIST_B163 = { -+ "NIST-B163", ECField_GF2m, 163, -+ "0800000000000000000000000000000000000000C9", -+ "000000000000000000000000000000000000000001", -+ "020A601907B8C953CA1481EB10512F78744A3205FD", -+ "03F0EBA16286A2D57EA0991168D4994637E8343E36", -+ "00D51FBC6C71A0094FA2CDD545B11C5C0C797324F1", -+ "040000000000000000000292FE77E70C12A4234C33", 2 -+}; -+ -+static const ECCurveParams ecCurve_NIST_K233 = { -+ "NIST-K233", ECField_GF2m, 233, -+ "020000000000000000000000000000000000000004000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "017232BA853A7E731AF129F22FF4149563A419C26BF50A4C9D6EEFAD6126", -+ "01DB537DECE819B7F70F555A67C427A8CD9BF18AEB9B56E0C11056FAE6A3", -+ "008000000000000000000000000000069D5BB915BCD46EFB1AD5F173ABDF", 4 -+}; -+ -+static const ECCurveParams ecCurve_NIST_B233 = { -+ "NIST-B233", ECField_GF2m, 233, -+ "020000000000000000000000000000000000000004000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "0066647EDE6C332C7F8C0923BB58213B333B20E9CE4281FE115F7D8F90AD", -+ "00FAC9DFCBAC8313BB2139F1BB755FEF65BC391F8B36F8F8EB7371FD558B", -+ "01006A08A41903350678E58528BEBF8A0BEFF867A7CA36716F7E01F81052", -+ "01000000000000000000000000000013E974E72F8A6922031D2603CFE0D7", 2 -+}; -+ -+static const ECCurveParams ecCurve_NIST_K283 = { -+ "NIST-K283", ECField_GF2m, 283, -+ "0800000000000000000000000000000000000000000000000000000000000000000010A1", -+ "000000000000000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0503213F78CA44883F1A3B8162F188E553CD265F23C1567A16876913B0C2AC2458492836", -+ "01CCDA380F1C9E318D90F95D07E5426FE87E45C0E8184698E45962364E34116177DD2259", -+ "01FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE9AE2ED07577265DFF7F94451E061E163C61", 4 -+}; -+ -+static const ECCurveParams ecCurve_NIST_B283 = { -+ "NIST-B283", ECField_GF2m, 283, -+ "0800000000000000000000000000000000000000000000000000000000000000000010A1", -+ "000000000000000000000000000000000000000000000000000000000000000000000001", -+ "027B680AC8B8596DA5A4AF8A19A0303FCA97FD7645309FA2A581485AF6263E313B79A2F5", -+ "05F939258DB7DD90E1934F8C70B0DFEC2EED25B8557EAC9C80E2E198F8CDBECD86B12053", -+ "03676854FE24141CB98FE6D4B20D02B4516FF702350EDDB0826779C813F0DF45BE8112F4", -+ "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEF90399660FC938A90165B042A7CEFADB307", 2 -+}; -+ -+static const ECCurveParams ecCurve_NIST_K409 = { -+ "NIST-K409", ECField_GF2m, 409, -+ "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0060F05F658F49C1AD3AB1890F7184210EFD0987E307C84C27ACCFB8F9F67CC2C460189EB5AAAA62EE222EB1B35540CFE9023746", -+ "01E369050B7C4E42ACBA1DACBF04299C3460782F918EA427E6325165E9EA10E3DA5F6C42E9C55215AA9CA27A5863EC48D8E0286B", -+ "007FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE5F83B2D4EA20400EC4557D5ED3E3E7CA5B4B5C83B8E01E5FCF", 4 -+}; -+ -+static const ECCurveParams ecCurve_NIST_B409 = { -+ "NIST-B409", ECField_GF2m, 409, -+ "02000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000001", -+ "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "0021A5C2C8EE9FEB5C4B9A753B7B476B7FD6422EF1F3DD674761FA99D6AC27C8A9A197B272822F6CD57A55AA4F50AE317B13545F", -+ "015D4860D088DDB3496B0C6064756260441CDE4AF1771D4DB01FFE5B34E59703DC255A868A1180515603AEAB60794E54BB7996A7", -+ "0061B1CFAB6BE5F32BBFA78324ED106A7636B9C5A7BD198D0158AA4F5488D08F38514F1FDF4B4F40D2181B3681C364BA0273C706", -+ "010000000000000000000000000000000000000000000000000001E2AAD6A612F33307BE5FA47C3C9E052F838164CD37D9A21173", 2 -+}; -+ -+static const ECCurveParams ecCurve_NIST_K571 = { -+ "NIST-K571", ECField_GF2m, 571, -+ "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "026EB7A859923FBC82189631F8103FE4AC9CA2970012D5D46024804801841CA44370958493B205E647DA304DB4CEB08CBBD1BA39494776FB988B47174DCA88C7E2945283A01C8972", -+ "0349DC807F4FBF374F4AEADE3BCA95314DD58CEC9F307A54FFC61EFC006D8A2C9D4979C0AC44AEA74FBEBBB9F772AEDCB620B01A7BA7AF1B320430C8591984F601CD4C143EF1C7A3", -+ "020000000000000000000000000000000000000000000000000000000000000000000000131850E1F19A63E4B391A8DB917F4138B630D84BE5D639381E91DEB45CFE778F637C1001", 4 -+}; -+ -+static const ECCurveParams ecCurve_NIST_B571 = { -+ "NIST-B571", ECField_GF2m, 571, -+ "080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000425", -+ "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001", -+ "02F40E7E2221F295DE297117B7F3D62F5C6A97FFCB8CEFF1CD6BA8CE4A9A18AD84FFABBD8EFA59332BE7AD6756A66E294AFD185A78FF12AA520E4DE739BACA0C7FFEFF7F2955727A", -+ "0303001D34B856296C16C0D40D3CD7750A93D1D2955FA80AA5F40FC8DB7B2ABDBDE53950F4C0D293CDD711A35B67FB1499AE60038614F1394ABFA3B4C850D927E1E7769C8EEC2D19", -+ "037BF27342DA639B6DCCFFFEB73D69D78C6C27A6009CBBCA1980F8533921E8A684423E43BAB08A576291AF8F461BB2A8B3531D2F0485C19B16E2F1516E23DD3C1A4827AF1B8AC15B", -+ "03FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE661CE18FF55987308059B186823851EC7DD9CA1161DE93D5174D66E8382E9BB2FE84E47", 2 -+}; -+ -+/* ANSI X9.62 prime curves */ -+static const ECCurveParams ecCurve_X9_62_PRIME_192V2 = { -+ "X9.62 P-192V2", ECField_GFp, 192, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", -+ "CC22D6DFB95C6B25E49C0D6364A4E5980C393AA21668D953", -+ "EEA2BAE7E1497842F2DE7769CFE9C989C072AD696F48034A", -+ "6574D11D69B6EC7A672BB82A083DF2F2B0847DE970B2DE15", -+ "FFFFFFFFFFFFFFFFFFFFFFFE5FB1A724DC80418648D8DD31", 1 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_PRIME_192V3 = { -+ "X9.62 P-192V3", ECField_GFp, 192, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC", -+ "22123DC2395A05CAA7423DAECCC94760A7D462256BD56916", -+ "7D29778100C65A1DA1783716588DCE2B8B4AEE8E228F1896", -+ "38A90F22637337334B49DCB66A6DC8F9978ACA7648A943B0", -+ "FFFFFFFFFFFFFFFFFFFFFFFF7A62D031C83F4294F640EC13", 1 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_PRIME_239V1 = { -+ "X9.62 P-239V1", ECField_GFp, 239, -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC", -+ "6B016C3BDCF18941D0D654921475CA71A9DB2FB27D1D37796185C2942C0A", -+ "0FFA963CDCA8816CCC33B8642BEDF905C3D358573D3F27FBBD3B3CB9AAAF", -+ "7DEBE8E4E90A5DAE6E4054CA530BA04654B36818CE226B39FCCB7B02F1AE", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF9E5E9A9F5D9071FBD1522688909D0B", 1 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_PRIME_239V2 = { -+ "X9.62 P-239V2", ECField_GFp, 239, -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC", -+ "617FAB6832576CBBFED50D99F0249C3FEE58B94BA0038C7AE84C8C832F2C", -+ "38AF09D98727705120C921BB5E9E26296A3CDCF2F35757A0EAFD87B830E7", -+ "5B0125E4DBEA0EC7206DA0FC01D9B081329FB555DE6EF460237DFF8BE4BA", -+ "7FFFFFFFFFFFFFFFFFFFFFFF800000CFA7E8594377D414C03821BC582063", 1 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_PRIME_239V3 = { -+ "X9.62 P-239V3", ECField_GFp, 239, -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFF", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFFFFFFFF8000000000007FFFFFFFFFFC", -+ "255705FA2A306654B1F4CB03D6A750A30C250102D4988717D9BA15AB6D3E", -+ "6768AE8E18BB92CFCF005C949AA2C6D94853D0E660BBF854B1C9505FE95A", -+ "1607E6898F390C06BC1D552BAD226F3B6FCFE48B6E818499AF18E3ED6CF3", -+ "7FFFFFFFFFFFFFFFFFFFFFFF7FFFFF975DEB41B3A6057C3C432146526551", 1 -+}; -+ -+/* ANSI X9.62 binary curves */ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB163V1 = { -+ "X9.62 C2-PNB163V1", ECField_GF2m, 163, -+ "080000000000000000000000000000000000000107", -+ "072546B5435234A422E0789675F432C89435DE5242", -+ "00C9517D06D5240D3CFF38C74B20B6CD4D6F9DD4D9", -+ "07AF69989546103D79329FCC3D74880F33BBE803CB", -+ "01EC23211B5966ADEA1D3F87F7EA5848AEF0B7CA9F", -+ "0400000000000000000001E60FC8821CC74DAEAFC1", 2 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB163V2 = { -+ "X9.62 C2-PNB163V2", ECField_GF2m, 163, -+ "080000000000000000000000000000000000000107", -+ "0108B39E77C4B108BED981ED0E890E117C511CF072", -+ "0667ACEB38AF4E488C407433FFAE4F1C811638DF20", -+ "0024266E4EB5106D0A964D92C4860E2671DB9B6CC5", -+ "079F684DDF6684C5CD258B3890021B2386DFD19FC5", -+ "03FFFFFFFFFFFFFFFFFFFDF64DE1151ADBB78F10A7", 2 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB163V3 = { -+ "X9.62 C2-PNB163V3", ECField_GF2m, 163, -+ "080000000000000000000000000000000000000107", -+ "07A526C63D3E25A256A007699F5447E32AE456B50E", -+ "03F7061798EB99E238FD6F1BF95B48FEEB4854252B", -+ "02F9F87B7C574D0BDECF8A22E6524775F98CDEBDCB", -+ "05B935590C155E17EA48EB3FF3718B893DF59A05D0", -+ "03FFFFFFFFFFFFFFFFFFFE1AEE140F110AFF961309", 2 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB176V1 = { -+ "X9.62 C2-PNB176V1", ECField_GF2m, 176, -+ "0100000000000000000000000000000000080000000007", -+ "E4E6DB2995065C407D9D39B8D0967B96704BA8E9C90B", -+ "5DDA470ABE6414DE8EC133AE28E9BBD7FCEC0AE0FFF2", -+ "8D16C2866798B600F9F08BB4A8E860F3298CE04A5798", -+ "6FA4539C2DADDDD6BAB5167D61B436E1D92BB16A562C", -+ "00010092537397ECA4F6145799D62B0A19CE06FE26AD", 0xFF6E -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB191V1 = { -+ "X9.62 C2-TNB191V1", ECField_GF2m, 191, -+ "800000000000000000000000000000000000000000000201", -+ "2866537B676752636A68F56554E12640276B649EF7526267", -+ "2E45EF571F00786F67B0081B9495A3D95462F5DE0AA185EC", -+ "36B3DAF8A23206F9C4F299D7B21A9C369137F2C84AE1AA0D", -+ "765BE73433B3F95E332932E70EA245CA2418EA0EF98018FB", -+ "40000000000000000000000004A20E90C39067C893BBB9A5", 2 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB191V2 = { -+ "X9.62 C2-TNB191V2", ECField_GF2m, 191, -+ "800000000000000000000000000000000000000000000201", -+ "401028774D7777C7B7666D1366EA432071274F89FF01E718", -+ "0620048D28BCBD03B6249C99182B7C8CD19700C362C46A01", -+ "3809B2B7CC1B28CC5A87926AAD83FD28789E81E2C9E3BF10", -+ "17434386626D14F3DBF01760D9213A3E1CF37AEC437D668A", -+ "20000000000000000000000050508CB89F652824E06B8173", 4 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB191V3 = { -+ "X9.62 C2-TNB191V3", ECField_GF2m, 191, -+ "800000000000000000000000000000000000000000000201", -+ "6C01074756099122221056911C77D77E77A777E7E7E77FCB", -+ "71FE1AF926CF847989EFEF8DB459F66394D90F32AD3F15E8", -+ "375D4CE24FDE434489DE8746E71786015009E66E38A926DD", -+ "545A39176196575D985999366E6AD34CE0A77CD7127B06BE", -+ "155555555555555555555555610C0B196812BFB6288A3EA3", 6 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB208W1 = { -+ "X9.62 C2-PNB208W1", ECField_GF2m, 208, -+ "010000000000000000000000000000000800000000000000000007", -+ "0000000000000000000000000000000000000000000000000000", -+ "C8619ED45A62E6212E1160349E2BFA844439FAFC2A3FD1638F9E", -+ "89FDFBE4ABE193DF9559ECF07AC0CE78554E2784EB8C1ED1A57A", -+ "0F55B51A06E78E9AC38A035FF520D8B01781BEB1A6BB08617DE3", -+ "000101BAF95C9723C57B6C21DA2EFF2D5ED588BDD5717E212F9D", 0xFE48 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB239V1 = { -+ "X9.62 C2-TNB239V1", ECField_GF2m, 239, -+ "800000000000000000000000000000000000000000000000001000000001", -+ "32010857077C5431123A46B808906756F543423E8D27877578125778AC76", -+ "790408F2EEDAF392B012EDEFB3392F30F4327C0CA3F31FC383C422AA8C16", -+ "57927098FA932E7C0A96D3FD5B706EF7E5F5C156E16B7E7C86038552E91D", -+ "61D8EE5077C33FECF6F1A16B268DE469C3C7744EA9A971649FC7A9616305", -+ "2000000000000000000000000000000F4D42FFE1492A4993F1CAD666E447", 4 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB239V2 = { -+ "X9.62 C2-TNB239V2", ECField_GF2m, 239, -+ "800000000000000000000000000000000000000000000000001000000001", -+ "4230017757A767FAE42398569B746325D45313AF0766266479B75654E65F", -+ "5037EA654196CFF0CD82B2C14A2FCF2E3FF8775285B545722F03EACDB74B", -+ "28F9D04E900069C8DC47A08534FE76D2B900B7D7EF31F5709F200C4CA205", -+ "5667334C45AFF3B5A03BAD9DD75E2C71A99362567D5453F7FA6E227EC833", -+ "1555555555555555555555555555553C6F2885259C31E3FCDF154624522D", 6 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB239V3 = { -+ "X9.62 C2-TNB239V3", ECField_GF2m, 239, -+ "800000000000000000000000000000000000000000000000001000000001", -+ "01238774666A67766D6676F778E676B66999176666E687666D8766C66A9F", -+ "6A941977BA9F6A435199ACFC51067ED587F519C5ECB541B8E44111DE1D40", -+ "70F6E9D04D289C4E89913CE3530BFDE903977D42B146D539BF1BDE4E9C92", -+ "2E5A0EAF6E5E1305B9004DCE5C0ED7FE59A35608F33837C816D80B79F461", -+ "0CCCCCCCCCCCCCCCCCCCCCCCCCCCCCAC4912D2D9DF903EF9888B8A0E4CFF", 0xA -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB272W1 = { -+ "X9.62 C2-PNB272W1", ECField_GF2m, 272, -+ "010000000000000000000000000000000000000000000000000000010000000000000B", -+ "91A091F03B5FBA4AB2CCF49C4EDD220FB028712D42BE752B2C40094DBACDB586FB20", -+ "7167EFC92BB2E3CE7C8AAAFF34E12A9C557003D7C73A6FAF003F99F6CC8482E540F7", -+ "6108BABB2CEEBCF787058A056CBE0CFE622D7723A289E08A07AE13EF0D10D171DD8D", -+ "10C7695716851EEF6BA7F6872E6142FBD241B830FF5EFCACECCAB05E02005DDE9D23", -+ "000100FAF51354E0E39E4892DF6E319C72C8161603FA45AA7B998A167B8F1E629521", -+ 0xFF06 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB304W1 = { -+ "X9.62 C2-PNB304W1", ECField_GF2m, 304, -+ "010000000000000000000000000000000000000000000000000000000000000000000000000807", -+ "FD0D693149A118F651E6DCE6802085377E5F882D1B510B44160074C1288078365A0396C8E681", -+ "BDDB97E555A50A908E43B01C798EA5DAA6788F1EA2794EFCF57166B8C14039601E55827340BE", -+ "197B07845E9BE2D96ADB0F5F3C7F2CFFBD7A3EB8B6FEC35C7FD67F26DDF6285A644F740A2614", -+ "E19FBEB76E0DA171517ECF401B50289BF014103288527A9B416A105E80260B549FDC1B92C03B", -+ "000101D556572AABAC800101D556572AABAC8001022D5C91DD173F8FB561DA6899164443051D", 0xFE2E -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB359V1 = { -+ "X9.62 C2-TNB359V1", ECField_GF2m, 359, -+ "800000000000000000000000000000000000000000000000000000000000000000000000100000000000000001", -+ "5667676A654B20754F356EA92017D946567C46675556F19556A04616B567D223A5E05656FB549016A96656A557", -+ "2472E2D0197C49363F1FE7F5B6DB075D52B6947D135D8CA445805D39BC345626089687742B6329E70680231988", -+ "3C258EF3047767E7EDE0F1FDAA79DAEE3841366A132E163ACED4ED2401DF9C6BDCDE98E8E707C07A2239B1B097", -+ "53D7E08529547048121E9C95F3791DD804963948F34FAE7BF44EA82365DC7868FE57E4AE2DE211305A407104BD", -+ "01AF286BCA1AF286BCA1AF286BCA1AF286BCA1AF286BC9FB8F6B85C556892C20A7EB964FE7719E74F490758D3B", 0x4C -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_PNB368W1 = { -+ "X9.62 C2-PNB368W1", ECField_GF2m, 368, -+ "0100000000000000000000000000000000000000000000000000000000000000000000002000000000000000000007", -+ "E0D2EE25095206F5E2A4F9ED229F1F256E79A0E2B455970D8D0D865BD94778C576D62F0AB7519CCD2A1A906AE30D", -+ "FC1217D4320A90452C760A58EDCD30C8DD069B3C34453837A34ED50CB54917E1C2112D84D164F444F8F74786046A", -+ "1085E2755381DCCCE3C1557AFA10C2F0C0C2825646C5B34A394CBCFA8BC16B22E7E789E927BE216F02E1FB136A5F", -+ "7B3EB1BDDCBA62D5D8B2059B525797FC73822C59059C623A45FF3843CEE8F87CD1855ADAA81E2A0750B80FDA2310", -+ "00010090512DA9AF72B08349D98A5DD4C7B0532ECA51CE03E2D10F3B7AC579BD87E909AE40A6F131E9CFCE5BD967", 0xFF70 -+}; -+ -+static const ECCurveParams ecCurve_X9_62_CHAR2_TNB431R1 = { -+ "X9.62 C2-TNB431R1", ECField_GF2m, 431, -+ "800000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000001", -+ "1A827EF00DD6FC0E234CAF046C6A5D8A85395B236CC4AD2CF32A0CADBDC9DDF620B0EB9906D0957F6C6FEACD615468DF104DE296CD8F", -+ "10D9B4A3D9047D8B154359ABFB1B7F5485B04CEB868237DDC9DEDA982A679A5A919B626D4E50A8DD731B107A9962381FB5D807BF2618", -+ "120FC05D3C67A99DE161D2F4092622FECA701BE4F50F4758714E8A87BBF2A658EF8C21E7C5EFE965361F6C2999C0C247B0DBD70CE6B7", -+ "20D0AF8903A96F8D5FA2C255745D3C451B302C9346D9B7E485E7BCE41F6B591F3E8F6ADDCBB0BC4C2F947A7DE1A89B625D6A598B3760", -+ "0340340340340340340340340340340340340340340340340340340323C313FAB50589703B5EC68D3587FEC60D161CC149C1AD4A91", 0x2760 -+}; -+ - /* SEC2 prime curves */ -+static const ECCurveParams ecCurve_SECG_PRIME_112R1 = { -+ "SECP-112R1", ECField_GFp, 112, -+ "DB7C2ABF62E35E668076BEAD208B", -+ "DB7C2ABF62E35E668076BEAD2088", -+ "659EF8BA043916EEDE8911702B22", -+ "09487239995A5EE76B55F9C2F098", -+ "A89CE5AF8724C0A23E0E0FF77500", -+ "DB7C2ABF62E35E7628DFAC6561C5", 1 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_112R2 = { -+ "SECP-112R2", ECField_GFp, 112, -+ "DB7C2ABF62E35E668076BEAD208B", -+ "6127C24C05F38A0AAAF65C0EF02C", -+ "51DEF1815DB5ED74FCC34C85D709", -+ "4BA30AB5E892B4E1649DD0928643", -+ "adcd46f5882e3747def36e956e97", -+ "36DF0AAFD8B8D7597CA10520D04B", 4 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_128R1 = { -+ "SECP-128R1", ECField_GFp, 128, -+ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", -+ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC", -+ "E87579C11079F43DD824993C2CEE5ED3", -+ "161FF7528B899B2D0C28607CA52C5B86", -+ "CF5AC8395BAFEB13C02DA292DDED7A83", -+ "FFFFFFFE0000000075A30D1B9038A115", 1 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_128R2 = { -+ "SECP-128R2", ECField_GFp, 128, -+ "FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF", -+ "D6031998D1B3BBFEBF59CC9BBFF9AEE1", -+ "5EEEFCA380D02919DC2C6558BB6D8A5D", -+ "7B6AA5D85E572983E6FB32A7CDEBC140", -+ "27B6916A894D3AEE7106FE805FC34B44", -+ "3FFFFFFF7FFFFFFFBE0024720613B5A3", 4 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_160K1 = { -+ "SECP-160K1", ECField_GFp, 160, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", -+ "0000000000000000000000000000000000000000", -+ "0000000000000000000000000000000000000007", -+ "3B4C382CE37AA192A4019E763036F4F5DD4D7EBB", -+ "938CF935318FDCED6BC28286531733C3F03C4FEE", -+ "0100000000000000000001B8FA16DFAB9ACA16B6B3", 1 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_160R1 = { -+ "SECP-160R1", ECField_GFp, 160, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC", -+ "1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45", -+ "4A96B5688EF573284664698968C38BB913CBFC82", -+ "23A628553168947D59DCC912042351377AC5FB32", -+ "0100000000000000000001F4C8F927AED3CA752257", 1 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_160R2 = { -+ "SECP-160R2", ECField_GFp, 160, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73", -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC70", -+ "B4E134D3FB59EB8BAB57274904664D5AF50388BA", -+ "52DCB034293A117E1F4FF11B30F7199D3144CE6D", -+ "FEAFFEF2E331F296E071FA0DF9982CFEA7D43F2E", -+ "0100000000000000000000351EE786A818F3A1A16B", 1 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_192K1 = { -+ "SECP-192K1", ECField_GFp, 192, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37", -+ "000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000003", -+ "DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D", -+ "9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D", -+ "FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D", 1 -+}; -+ -+static const ECCurveParams ecCurve_SECG_PRIME_224K1 = { -+ "SECP-224K1", ECField_GFp, 224, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFE56D", -+ "00000000000000000000000000000000000000000000000000000000", -+ "00000000000000000000000000000000000000000000000000000005", -+ "A1455B334DF099DF30FC28A169A467E9E47075A90F7E650EB6B7A45C", -+ "7E089FED7FBA344282CAFBD6F7E319F7C0B0BD59E2CA4BDB556D61A5", -+ "010000000000000000000000000001DCE8D2EC6184CAF0A971769FB1F7", 1 -+}; -+ - static const ECCurveParams ecCurve_SECG_PRIME_256K1 = { - "SECP-256K1", ECField_GFp, 256, - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F", -@@ -88,70 +511,178 @@ static const ECCurveParams ecCurve_SECG_PRIME_256K1 = { - "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141", 1 - }; - -+/* SEC2 binary curves */ -+static const ECCurveParams ecCurve_SECG_CHAR2_113R1 = { -+ "SECT-113R1", ECField_GF2m, 113, -+ "020000000000000000000000000201", -+ "003088250CA6E7C7FE649CE85820F7", -+ "00E8BEE4D3E2260744188BE0E9C723", -+ "009D73616F35F4AB1407D73562C10F", -+ "00A52830277958EE84D1315ED31886", -+ "0100000000000000D9CCEC8A39E56F", 2 -+}; -+ -+static const ECCurveParams ecCurve_SECG_CHAR2_113R2 = { -+ "SECT-113R2", ECField_GF2m, 113, -+ "020000000000000000000000000201", -+ "00689918DBEC7E5A0DD6DFC0AA55C7", -+ "0095E9A9EC9B297BD4BF36E059184F", -+ "01A57A6A7B26CA5EF52FCDB8164797", -+ "00B3ADC94ED1FE674C06E695BABA1D", -+ "010000000000000108789B2496AF93", 2 -+}; -+ -+static const ECCurveParams ecCurve_SECG_CHAR2_131R1 = { -+ "SECT-131R1", ECField_GF2m, 131, -+ "080000000000000000000000000000010D", -+ "07A11B09A76B562144418FF3FF8C2570B8", -+ "0217C05610884B63B9C6C7291678F9D341", -+ "0081BAF91FDF9833C40F9C181343638399", -+ "078C6E7EA38C001F73C8134B1B4EF9E150", -+ "0400000000000000023123953A9464B54D", 2 -+}; -+ -+static const ECCurveParams ecCurve_SECG_CHAR2_131R2 = { -+ "SECT-131R2", ECField_GF2m, 131, -+ "080000000000000000000000000000010D", -+ "03E5A88919D7CAFCBF415F07C2176573B2", -+ "04B8266A46C55657AC734CE38F018F2192", -+ "0356DCD8F2F95031AD652D23951BB366A8", -+ "0648F06D867940A5366D9E265DE9EB240F", -+ "0400000000000000016954A233049BA98F", 2 -+}; -+ -+static const ECCurveParams ecCurve_SECG_CHAR2_163R1 = { -+ "SECT-163R1", ECField_GF2m, 163, -+ "0800000000000000000000000000000000000000C9", -+ "07B6882CAAEFA84F9554FF8428BD88E246D2782AE2", -+ "0713612DCDDCB40AAB946BDA29CA91F73AF958AFD9", -+ "0369979697AB43897789566789567F787A7876A654", -+ "00435EDB42EFAFB2989D51FEFCE3C80988F41FF883", -+ "03FFFFFFFFFFFFFFFFFFFF48AAB689C29CA710279B", 2 -+}; -+ -+static const ECCurveParams ecCurve_SECG_CHAR2_193R1 = { -+ "SECT-193R1", ECField_GF2m, 193, -+ "02000000000000000000000000000000000000000000008001", -+ "0017858FEB7A98975169E171F77B4087DE098AC8A911DF7B01", -+ "00FDFB49BFE6C3A89FACADAA7A1E5BBC7CC1C2E5D831478814", -+ "01F481BC5F0FF84A74AD6CDF6FDEF4BF6179625372D8C0C5E1", -+ "0025E399F2903712CCF3EA9E3A1AD17FB0B3201B6AF7CE1B05", -+ "01000000000000000000000000C7F34A778F443ACC920EBA49", 2 -+}; -+ -+static const ECCurveParams ecCurve_SECG_CHAR2_193R2 = { -+ "SECT-193R2", ECField_GF2m, 193, -+ "02000000000000000000000000000000000000000000008001", -+ "0163F35A5137C2CE3EA6ED8667190B0BC43ECD69977702709B", -+ "00C9BB9E8927D4D64C377E2AB2856A5B16E3EFB7F61D4316AE", -+ "00D9B67D192E0367C803F39E1A7E82CA14A651350AAE617E8F", -+ "01CE94335607C304AC29E7DEFBD9CA01F596F927224CDECF6C", -+ "010000000000000000000000015AAB561B005413CCD4EE99D5", 2 -+}; -+ -+static const ECCurveParams ecCurve_SECG_CHAR2_239K1 = { -+ "SECT-239K1", ECField_GF2m, 239, -+ "800000000000000000004000000000000000000000000000000000000001", -+ "000000000000000000000000000000000000000000000000000000000000", -+ "000000000000000000000000000000000000000000000000000000000001", -+ "29A0B6A887A983E9730988A68727A8B2D126C44CC2CC7B2A6555193035DC", -+ "76310804F12E549BDB011C103089E73510ACB275FC312A5DC6B76553F0CA", -+ "2000000000000000000000000000005A79FEC67CB6E91F1C1DA800E478A5", 4 -+}; -+ -+/* WTLS curves */ -+static const ECCurveParams ecCurve_WTLS_1 = { -+ "WTLS-1", ECField_GF2m, 113, -+ "020000000000000000000000000201", -+ "000000000000000000000000000001", -+ "000000000000000000000000000001", -+ "01667979A40BA497E5D5C270780617", -+ "00F44B4AF1ECC2630E08785CEBCC15", -+ "00FFFFFFFFFFFFFFFDBF91AF6DEA73", 2 -+}; -+ -+static const ECCurveParams ecCurve_WTLS_8 = { -+ "WTLS-8", ECField_GFp, 112, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFDE7", -+ "0000000000000000000000000000", -+ "0000000000000000000000000003", -+ "0000000000000000000000000001", -+ "0000000000000000000000000002", -+ "0100000000000001ECEA551AD837E9", 1 -+}; -+ -+static const ECCurveParams ecCurve_WTLS_9 = { -+ "WTLS-9", ECField_GFp, 160, -+ "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC808F", -+ "0000000000000000000000000000000000000000", -+ "0000000000000000000000000000000000000003", -+ "0000000000000000000000000000000000000001", -+ "0000000000000000000000000000000000000002", -+ "0100000000000000000001CDC98AE0E2DE574ABF33", 1 -+}; -+ - /* mapping between ECCurveName enum and pointers to ECCurveParams */ - static const ECCurveParams *ecCurve_map[] = { - NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -+ &ecCurve_NIST_P192, /* ECCurve_NIST_P192 */ -+ &ecCurve_NIST_P224, /* ECCurve_NIST_P224 */ - &ecCurve_NIST_P256, /* ECCurve_NIST_P256 */ - &ecCurve_NIST_P384, /* ECCurve_NIST_P384 */ - &ecCurve_NIST_P521, /* ECCurve_NIST_P521 */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -+ &ecCurve_NIST_K163, /* ECCurve_NIST_K163 */ -+ &ecCurve_NIST_B163, /* ECCurve_NIST_B163 */ -+ &ecCurve_NIST_K233, /* ECCurve_NIST_K233 */ -+ &ecCurve_NIST_B233, /* ECCurve_NIST_B233 */ -+ &ecCurve_NIST_K283, /* ECCurve_NIST_K283 */ -+ &ecCurve_NIST_B283, /* ECCurve_NIST_B283 */ -+ &ecCurve_NIST_K409, /* ECCurve_NIST_K409 */ -+ &ecCurve_NIST_B409, /* ECCurve_NIST_B409 */ -+ &ecCurve_NIST_K571, /* ECCurve_NIST_K571 */ -+ &ecCurve_NIST_B571, /* ECCurve_NIST_B571 */ -+ &ecCurve_X9_62_PRIME_192V2, /* ECCurve_X9_62_PRIME_192V2 */ -+ &ecCurve_X9_62_PRIME_192V3, /* ECCurve_X9_62_PRIME_192V3 */ -+ &ecCurve_X9_62_PRIME_239V1, /* ECCurve_X9_62_PRIME_239V1 */ -+ &ecCurve_X9_62_PRIME_239V2, /* ECCurve_X9_62_PRIME_239V2 */ -+ &ecCurve_X9_62_PRIME_239V3, /* ECCurve_X9_62_PRIME_239V3 */ -+ &ecCurve_X9_62_CHAR2_PNB163V1, /* ECCurve_X9_62_CHAR2_PNB163V1 */ -+ &ecCurve_X9_62_CHAR2_PNB163V2, /* ECCurve_X9_62_CHAR2_PNB163V2 */ -+ &ecCurve_X9_62_CHAR2_PNB163V3, /* ECCurve_X9_62_CHAR2_PNB163V3 */ -+ &ecCurve_X9_62_CHAR2_PNB176V1, /* ECCurve_X9_62_CHAR2_PNB176V1 */ -+ &ecCurve_X9_62_CHAR2_TNB191V1, /* ECCurve_X9_62_CHAR2_TNB191V1 */ -+ &ecCurve_X9_62_CHAR2_TNB191V2, /* ECCurve_X9_62_CHAR2_TNB191V2 */ -+ &ecCurve_X9_62_CHAR2_TNB191V3, /* ECCurve_X9_62_CHAR2_TNB191V3 */ -+ &ecCurve_X9_62_CHAR2_PNB208W1, /* ECCurve_X9_62_CHAR2_PNB208W1 */ -+ &ecCurve_X9_62_CHAR2_TNB239V1, /* ECCurve_X9_62_CHAR2_TNB239V1 */ -+ &ecCurve_X9_62_CHAR2_TNB239V2, /* ECCurve_X9_62_CHAR2_TNB239V2 */ -+ &ecCurve_X9_62_CHAR2_TNB239V3, /* ECCurve_X9_62_CHAR2_TNB239V3 */ -+ &ecCurve_X9_62_CHAR2_PNB272W1, /* ECCurve_X9_62_CHAR2_PNB272W1 */ -+ &ecCurve_X9_62_CHAR2_PNB304W1, /* ECCurve_X9_62_CHAR2_PNB304W1 */ -+ &ecCurve_X9_62_CHAR2_TNB359V1, /* ECCurve_X9_62_CHAR2_TNB359V1 */ -+ &ecCurve_X9_62_CHAR2_PNB368W1, /* ECCurve_X9_62_CHAR2_PNB368W1 */ -+ &ecCurve_X9_62_CHAR2_TNB431R1, /* ECCurve_X9_62_CHAR2_TNB431R1 */ -+ &ecCurve_SECG_PRIME_112R1, /* ECCurve_SECG_PRIME_112R1 */ -+ &ecCurve_SECG_PRIME_112R2, /* ECCurve_SECG_PRIME_112R2 */ -+ &ecCurve_SECG_PRIME_128R1, /* ECCurve_SECG_PRIME_128R1 */ -+ &ecCurve_SECG_PRIME_128R2, /* ECCurve_SECG_PRIME_128R2 */ -+ &ecCurve_SECG_PRIME_160K1, /* ECCurve_SECG_PRIME_160K1 */ -+ &ecCurve_SECG_PRIME_160R1, /* ECCurve_SECG_PRIME_160R1 */ -+ &ecCurve_SECG_PRIME_160R2, /* ECCurve_SECG_PRIME_160R2 */ -+ &ecCurve_SECG_PRIME_192K1, /* ECCurve_SECG_PRIME_192K1 */ -+ &ecCurve_SECG_PRIME_224K1, /* ECCurve_SECG_PRIME_224K1 */ - &ecCurve_SECG_PRIME_256K1, /* ECCurve_SECG_PRIME_256K1 */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -- NULL, /* ECCurve_noName */ -+ &ecCurve_SECG_CHAR2_113R1, /* ECCurve_SECG_CHAR2_113R1 */ -+ &ecCurve_SECG_CHAR2_113R2, /* ECCurve_SECG_CHAR2_113R2 */ -+ &ecCurve_SECG_CHAR2_131R1, /* ECCurve_SECG_CHAR2_131R1 */ -+ &ecCurve_SECG_CHAR2_131R2, /* ECCurve_SECG_CHAR2_131R2 */ -+ &ecCurve_SECG_CHAR2_163R1, /* ECCurve_SECG_CHAR2_163R1 */ -+ &ecCurve_SECG_CHAR2_193R1, /* ECCurve_SECG_CHAR2_193R1 */ -+ &ecCurve_SECG_CHAR2_193R2, /* ECCurve_SECG_CHAR2_193R2 */ -+ &ecCurve_SECG_CHAR2_239K1, /* ECCurve_SECG_CHAR2_239K1 */ -+ &ecCurve_WTLS_1, /* ECCurve_WTLS_1 */ -+ &ecCurve_WTLS_8, /* ECCurve_WTLS_8 */ -+ &ecCurve_WTLS_9, /* ECCurve_WTLS_9 */ - NULL /* ECCurve_pastLastCurve */ - }; - -diff --git a/jdk/src/share/native/sun/security/ec/impl/ecl.c b/jdk/src/share/native/sun/security/ec/impl/ecl.c -index 2006aeda..49f407a2 100644 ---- a/jdk/src/share/native/sun/security/ec/impl/ecl.c -+++ b/jdk/src/share/native/sun/security/ec/impl/ecl.c -@@ -39,6 +39,7 @@ - #include "mplogic.h" - #include "ecl.h" - #include "ecl-priv.h" -+#include "ec2.h" - #include "ecp.h" - #ifndef _KERNEL - #include -@@ -169,6 +170,50 @@ ECGroup_consGFp_mont(const mp_int *irr, const mp_int *curvea, - return group; - } - -+#ifdef NSS_ECC_MORE_THAN_SUITE_B -+/* Construct a generic ECGroup for elliptic curves over binary polynomial -+ * fields. */ -+ECGroup * -+ECGroup_consGF2m(const mp_int *irr, const unsigned int irr_arr[5], -+ const mp_int *curvea, const mp_int *curveb, -+ const mp_int *genx, const mp_int *geny, -+ const mp_int *order, int cofactor) -+{ -+ mp_err res = MP_OKAY; -+ ECGroup *group = NULL; -+ -+ group = ECGroup_new(FLAG(irr)); -+ if (group == NULL) -+ return NULL; -+ -+ group->meth = GFMethod_consGF2m(irr, irr_arr); -+ if (group->meth == NULL) { -+ res = MP_MEM; -+ goto CLEANUP; -+ } -+ MP_CHECKOK(mp_copy(curvea, &group->curvea)); -+ MP_CHECKOK(mp_copy(curveb, &group->curveb)); -+ MP_CHECKOK(mp_copy(genx, &group->genx)); -+ MP_CHECKOK(mp_copy(geny, &group->geny)); -+ MP_CHECKOK(mp_copy(order, &group->order)); -+ group->cofactor = cofactor; -+ group->point_add = &ec_GF2m_pt_add_aff; -+ group->point_sub = &ec_GF2m_pt_sub_aff; -+ group->point_dbl = &ec_GF2m_pt_dbl_aff; -+ group->point_mul = &ec_GF2m_pt_mul_mont; -+ group->base_point_mul = NULL; -+ group->points_mul = &ec_pts_mul_basic; -+ group->validate_point = &ec_GF2m_validate_point; -+ -+ CLEANUP: -+ if (res != MP_OKAY) { -+ ECGroup_free(group); -+ return NULL; -+ } -+ return group; -+} -+#endif -+ - /* Construct ECGroup from hex parameters and name, if any. Called by - * ECGroup_fromHex and ECGroup_fromName. */ - ECGroup * -@@ -209,10 +254,85 @@ ecgroup_fromNameAndHex(const ECCurveName name, - - /* determine which optimizations (if any) to use */ - if (params->field == ECField_GFp) { -+#ifdef NSS_ECC_MORE_THAN_SUITE_B -+ switch (name) { -+#ifdef ECL_USE_FP -+ case ECCurve_SECG_PRIME_160R1: -+ group = -+ ECGroup_consGFp(&irr, &curvea, &curveb, &genx, &geny, -+ &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ MP_CHECKOK(ec_group_set_secp160r1_fp(group)); -+ break; -+#endif -+ case ECCurve_SECG_PRIME_192R1: -+#ifdef ECL_USE_FP -+ group = -+ ECGroup_consGFp(&irr, &curvea, &curveb, &genx, &geny, -+ &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ MP_CHECKOK(ec_group_set_nistp192_fp(group)); -+#else -+ group = -+ ECGroup_consGFp(&irr, &curvea, &curveb, &genx, &geny, -+ &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ MP_CHECKOK(ec_group_set_gfp192(group, name)); -+#endif -+ break; -+ case ECCurve_SECG_PRIME_224R1: -+#ifdef ECL_USE_FP -+ group = -+ ECGroup_consGFp(&irr, &curvea, &curveb, &genx, &geny, -+ &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ MP_CHECKOK(ec_group_set_nistp224_fp(group)); -+#else -+ group = -+ ECGroup_consGFp(&irr, &curvea, &curveb, &genx, &geny, -+ &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ MP_CHECKOK(ec_group_set_gfp224(group, name)); -+#endif -+ break; -+ case ECCurve_SECG_PRIME_256R1: -+ group = -+ ECGroup_consGFp(&irr, &curvea, &curveb, &genx, &geny, -+ &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ MP_CHECKOK(ec_group_set_gfp256(group, name)); -+ break; -+ case ECCurve_SECG_PRIME_521R1: -+ group = -+ ECGroup_consGFp(&irr, &curvea, &curveb, &genx, &geny, -+ &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ MP_CHECKOK(ec_group_set_gfp521(group, name)); -+ break; -+ default: -+ /* use generic arithmetic */ -+#endif - group = - ECGroup_consGFp_mont(&irr, &curvea, &curveb, &genx, &geny, - &order, params->cofactor); - if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+#ifdef NSS_ECC_MORE_THAN_SUITE_B -+ } -+ } else if (params->field == ECField_GF2m) { -+ group = ECGroup_consGF2m(&irr, NULL, &curvea, &curveb, &genx, &geny, &order, params->cofactor); -+ if (group == NULL) { res = MP_UNDEF; goto CLEANUP; } -+ if ((name == ECCurve_NIST_K163) || -+ (name == ECCurve_NIST_B163) || -+ (name == ECCurve_SECG_CHAR2_163R1)) { -+ MP_CHECKOK(ec_group_set_gf2m163(group, name)); -+ } else if ((name == ECCurve_SECG_CHAR2_193R1) || -+ (name == ECCurve_SECG_CHAR2_193R2)) { -+ MP_CHECKOK(ec_group_set_gf2m193(group, name)); -+ } else if ((name == ECCurve_NIST_K233) || -+ (name == ECCurve_NIST_B233)) { -+ MP_CHECKOK(ec_group_set_gf2m233(group, name)); -+ } -+#endif - } else { - res = MP_UNDEF; - goto CLEANUP; -diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_192.c b/jdk/src/share/native/sun/security/ec/impl/ecp_192.c -new file mode 100644 -index 00000000..69b0d857 ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ecp_192.c -@@ -0,0 +1,517 @@ -+/* -+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for prime field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Douglas Stebila , Sun Microsystems Laboratories -+ * -+ *********************************************************************** */ -+ -+#include "ecp.h" -+#include "mpi.h" -+#include "mplogic.h" -+#include "mpi-priv.h" -+#ifndef _KERNEL -+#include -+#endif -+ -+#define ECP192_DIGITS ECL_CURVE_DIGITS(192) -+ -+/* Fast modular reduction for p192 = 2^192 - 2^64 - 1. a can be r. Uses -+ * algorithm 7 from Brown, Hankerson, Lopez, Menezes. Software -+ * Implementation of the NIST Elliptic Curves over Prime Fields. */ -+mp_err -+ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_size a_used = MP_USED(a); -+ mp_digit r3; -+#ifndef MPI_AMD64_ADD -+ mp_digit carry; -+#endif -+#ifdef ECL_THIRTY_TWO_BIT -+ mp_digit a5a = 0, a5b = 0, a4a = 0, a4b = 0, a3a = 0, a3b = 0; -+ mp_digit r0a, r0b, r1a, r1b, r2a, r2b; -+#else -+ mp_digit a5 = 0, a4 = 0, a3 = 0; -+ mp_digit r0, r1, r2; -+#endif -+ -+ /* reduction not needed if a is not larger than field size */ -+ if (a_used < ECP192_DIGITS) { -+ if (a == r) { -+ return MP_OKAY; -+ } -+ return mp_copy(a, r); -+ } -+ -+ /* for polynomials larger than twice the field size, use regular -+ * reduction */ -+ if (a_used > ECP192_DIGITS*2) { -+ MP_CHECKOK(mp_mod(a, &meth->irr, r)); -+ } else { -+ /* copy out upper words of a */ -+ -+#ifdef ECL_THIRTY_TWO_BIT -+ -+ /* in all the math below, -+ * nXb is most signifiant, nXa is least significant */ -+ switch (a_used) { -+ case 12: -+ a5b = MP_DIGIT(a, 11); -+ case 11: -+ a5a = MP_DIGIT(a, 10); -+ case 10: -+ a4b = MP_DIGIT(a, 9); -+ case 9: -+ a4a = MP_DIGIT(a, 8); -+ case 8: -+ a3b = MP_DIGIT(a, 7); -+ case 7: -+ a3a = MP_DIGIT(a, 6); -+ } -+ -+ -+ r2b= MP_DIGIT(a, 5); -+ r2a= MP_DIGIT(a, 4); -+ r1b = MP_DIGIT(a, 3); -+ r1a = MP_DIGIT(a, 2); -+ r0b = MP_DIGIT(a, 1); -+ r0a = MP_DIGIT(a, 0); -+ -+ /* implement r = (a2,a1,a0)+(a5,a5,a5)+(a4,a4,0)+(0,a3,a3) */ -+ MP_ADD_CARRY(r0a, a3a, r0a, 0, carry); -+ MP_ADD_CARRY(r0b, a3b, r0b, carry, carry); -+ MP_ADD_CARRY(r1a, a3a, r1a, carry, carry); -+ MP_ADD_CARRY(r1b, a3b, r1b, carry, carry); -+ MP_ADD_CARRY(r2a, a4a, r2a, carry, carry); -+ MP_ADD_CARRY(r2b, a4b, r2b, carry, carry); -+ r3 = carry; carry = 0; -+ MP_ADD_CARRY(r0a, a5a, r0a, 0, carry); -+ MP_ADD_CARRY(r0b, a5b, r0b, carry, carry); -+ MP_ADD_CARRY(r1a, a5a, r1a, carry, carry); -+ MP_ADD_CARRY(r1b, a5b, r1b, carry, carry); -+ MP_ADD_CARRY(r2a, a5a, r2a, carry, carry); -+ MP_ADD_CARRY(r2b, a5b, r2b, carry, carry); -+ r3 += carry; -+ MP_ADD_CARRY(r1a, a4a, r1a, 0, carry); -+ MP_ADD_CARRY(r1b, a4b, r1b, carry, carry); -+ MP_ADD_CARRY(r2a, 0, r2a, carry, carry); -+ MP_ADD_CARRY(r2b, 0, r2b, carry, carry); -+ r3 += carry; -+ -+ /* reduce out the carry */ -+ while (r3) { -+ MP_ADD_CARRY(r0a, r3, r0a, 0, carry); -+ MP_ADD_CARRY(r0b, 0, r0b, carry, carry); -+ MP_ADD_CARRY(r1a, r3, r1a, carry, carry); -+ MP_ADD_CARRY(r1b, 0, r1b, carry, carry); -+ MP_ADD_CARRY(r2a, 0, r2a, carry, carry); -+ MP_ADD_CARRY(r2b, 0, r2b, carry, carry); -+ r3 = carry; -+ } -+ -+ /* check for final reduction */ -+ /* -+ * our field is 0xffffffffffffffff, 0xfffffffffffffffe, -+ * 0xffffffffffffffff. That means we can only be over and need -+ * one more reduction -+ * if r2 == 0xffffffffffffffffff (same as r2+1 == 0) -+ * and -+ * r1 == 0xffffffffffffffffff or -+ * r1 == 0xfffffffffffffffffe and r0 = 0xfffffffffffffffff -+ * In all cases, we subtract the field (or add the 2's -+ * complement value (1,1,0)). (r0, r1, r2) -+ */ -+ if (((r2b == 0xffffffff) && (r2a == 0xffffffff) -+ && (r1b == 0xffffffff) ) && -+ ((r1a == 0xffffffff) || -+ (r1a == 0xfffffffe) && (r0a == 0xffffffff) && -+ (r0b == 0xffffffff)) ) { -+ /* do a quick subtract */ -+ MP_ADD_CARRY(r0a, 1, r0a, 0, carry); -+ r0b += carry; -+ r1a = r1b = r2a = r2b = 0; -+ } -+ -+ /* set the lower words of r */ -+ if (a != r) { -+ MP_CHECKOK(s_mp_pad(r, 6)); -+ } -+ MP_DIGIT(r, 5) = r2b; -+ MP_DIGIT(r, 4) = r2a; -+ MP_DIGIT(r, 3) = r1b; -+ MP_DIGIT(r, 2) = r1a; -+ MP_DIGIT(r, 1) = r0b; -+ MP_DIGIT(r, 0) = r0a; -+ MP_USED(r) = 6; -+#else -+ switch (a_used) { -+ case 6: -+ a5 = MP_DIGIT(a, 5); -+ case 5: -+ a4 = MP_DIGIT(a, 4); -+ case 4: -+ a3 = MP_DIGIT(a, 3); -+ } -+ -+ r2 = MP_DIGIT(a, 2); -+ r1 = MP_DIGIT(a, 1); -+ r0 = MP_DIGIT(a, 0); -+ -+ /* implement r = (a2,a1,a0)+(a5,a5,a5)+(a4,a4,0)+(0,a3,a3) */ -+#ifndef MPI_AMD64_ADD -+ MP_ADD_CARRY_ZERO(r0, a3, r0, carry); -+ MP_ADD_CARRY(r1, a3, r1, carry, carry); -+ MP_ADD_CARRY(r2, a4, r2, carry, carry); -+ r3 = carry; -+ MP_ADD_CARRY_ZERO(r0, a5, r0, carry); -+ MP_ADD_CARRY(r1, a5, r1, carry, carry); -+ MP_ADD_CARRY(r2, a5, r2, carry, carry); -+ r3 += carry; -+ MP_ADD_CARRY_ZERO(r1, a4, r1, carry); -+ MP_ADD_CARRY(r2, 0, r2, carry, carry); -+ r3 += carry; -+ -+#else -+ r2 = MP_DIGIT(a, 2); -+ r1 = MP_DIGIT(a, 1); -+ r0 = MP_DIGIT(a, 0); -+ -+ /* set the lower words of r */ -+ __asm__ ( -+ "xorq %3,%3 \n\t" -+ "addq %4,%0 \n\t" -+ "adcq %4,%1 \n\t" -+ "adcq %5,%2 \n\t" -+ "adcq $0,%3 \n\t" -+ "addq %6,%0 \n\t" -+ "adcq %6,%1 \n\t" -+ "adcq %6,%2 \n\t" -+ "adcq $0,%3 \n\t" -+ "addq %5,%1 \n\t" -+ "adcq $0,%2 \n\t" -+ "adcq $0,%3 \n\t" -+ : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(r3), "=r"(a3), -+ "=r"(a4), "=r"(a5) -+ : "0" (r0), "1" (r1), "2" (r2), "3" (r3), -+ "4" (a3), "5" (a4), "6"(a5) -+ : "%cc" ); -+#endif -+ -+ /* reduce out the carry */ -+ while (r3) { -+#ifndef MPI_AMD64_ADD -+ MP_ADD_CARRY_ZERO(r0, r3, r0, carry); -+ MP_ADD_CARRY(r1, r3, r1, carry, carry); -+ MP_ADD_CARRY(r2, 0, r2, carry, carry); -+ r3 = carry; -+#else -+ a3=r3; -+ __asm__ ( -+ "xorq %3,%3 \n\t" -+ "addq %4,%0 \n\t" -+ "adcq %4,%1 \n\t" -+ "adcq $0,%2 \n\t" -+ "adcq $0,%3 \n\t" -+ : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(r3), "=r"(a3) -+ : "0" (r0), "1" (r1), "2" (r2), "3" (r3), "4"(a3) -+ : "%cc" ); -+#endif -+ } -+ -+ /* check for final reduction */ -+ /* -+ * our field is 0xffffffffffffffff, 0xfffffffffffffffe, -+ * 0xffffffffffffffff. That means we can only be over and need -+ * one more reduction -+ * if r2 == 0xffffffffffffffffff (same as r2+1 == 0) -+ * and -+ * r1 == 0xffffffffffffffffff or -+ * r1 == 0xfffffffffffffffffe and r0 = 0xfffffffffffffffff -+ * In all cases, we subtract the field (or add the 2's -+ * complement value (1,1,0)). (r0, r1, r2) -+ */ -+ if (r3 || ((r2 == MP_DIGIT_MAX) && -+ ((r1 == MP_DIGIT_MAX) || -+ ((r1 == (MP_DIGIT_MAX-1)) && (r0 == MP_DIGIT_MAX))))) { -+ /* do a quick subtract */ -+ r0++; -+ r1 = r2 = 0; -+ } -+ /* set the lower words of r */ -+ if (a != r) { -+ MP_CHECKOK(s_mp_pad(r, 3)); -+ } -+ MP_DIGIT(r, 2) = r2; -+ MP_DIGIT(r, 1) = r1; -+ MP_DIGIT(r, 0) = r0; -+ MP_USED(r) = 3; -+#endif -+ } -+ -+ CLEANUP: -+ return res; -+} -+ -+#ifndef ECL_THIRTY_TWO_BIT -+/* Compute the sum of 192 bit curves. Do the work in-line since the -+ * number of words are so small, we don't want to overhead of mp function -+ * calls. Uses optimized modular reduction for p192. -+ */ -+mp_err -+ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit a0 = 0, a1 = 0, a2 = 0; -+ mp_digit r0 = 0, r1 = 0, r2 = 0; -+ mp_digit carry; -+ -+ switch(MP_USED(a)) { -+ case 3: -+ a2 = MP_DIGIT(a,2); -+ case 2: -+ a1 = MP_DIGIT(a,1); -+ case 1: -+ a0 = MP_DIGIT(a,0); -+ } -+ switch(MP_USED(b)) { -+ case 3: -+ r2 = MP_DIGIT(b,2); -+ case 2: -+ r1 = MP_DIGIT(b,1); -+ case 1: -+ r0 = MP_DIGIT(b,0); -+ } -+ -+#ifndef MPI_AMD64_ADD -+ MP_ADD_CARRY_ZERO(a0, r0, r0, carry); -+ MP_ADD_CARRY(a1, r1, r1, carry, carry); -+ MP_ADD_CARRY(a2, r2, r2, carry, carry); -+#else -+ __asm__ ( -+ "xorq %3,%3 \n\t" -+ "addq %4,%0 \n\t" -+ "adcq %5,%1 \n\t" -+ "adcq %6,%2 \n\t" -+ "adcq $0,%3 \n\t" -+ : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(carry) -+ : "r" (a0), "r" (a1), "r" (a2), "0" (r0), -+ "1" (r1), "2" (r2) -+ : "%cc" ); -+#endif -+ -+ /* Do quick 'subract' if we've gone over -+ * (add the 2's complement of the curve field) */ -+ if (carry || ((r2 == MP_DIGIT_MAX) && -+ ((r1 == MP_DIGIT_MAX) || -+ ((r1 == (MP_DIGIT_MAX-1)) && (r0 == MP_DIGIT_MAX))))) { -+#ifndef MPI_AMD64_ADD -+ MP_ADD_CARRY_ZERO(r0, 1, r0, carry); -+ MP_ADD_CARRY(r1, 1, r1, carry, carry); -+ MP_ADD_CARRY(r2, 0, r2, carry, carry); -+#else -+ __asm__ ( -+ "addq $1,%0 \n\t" -+ "adcq $1,%1 \n\t" -+ "adcq $0,%2 \n\t" -+ : "=r"(r0), "=r"(r1), "=r"(r2) -+ : "0" (r0), "1" (r1), "2" (r2) -+ : "%cc" ); -+#endif -+ } -+ -+ -+ MP_CHECKOK(s_mp_pad(r, 3)); -+ MP_DIGIT(r, 2) = r2; -+ MP_DIGIT(r, 1) = r1; -+ MP_DIGIT(r, 0) = r0; -+ MP_SIGN(r) = MP_ZPOS; -+ MP_USED(r) = 3; -+ s_mp_clamp(r); -+ -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Compute the diff of 192 bit curves. Do the work in-line since the -+ * number of words are so small, we don't want to overhead of mp function -+ * calls. Uses optimized modular reduction for p192. -+ */ -+mp_err -+ec_GFp_nistp192_sub(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_digit b0 = 0, b1 = 0, b2 = 0; -+ mp_digit r0 = 0, r1 = 0, r2 = 0; -+ mp_digit borrow; -+ -+ switch(MP_USED(a)) { -+ case 3: -+ r2 = MP_DIGIT(a,2); -+ case 2: -+ r1 = MP_DIGIT(a,1); -+ case 1: -+ r0 = MP_DIGIT(a,0); -+ } -+ -+ switch(MP_USED(b)) { -+ case 3: -+ b2 = MP_DIGIT(b,2); -+ case 2: -+ b1 = MP_DIGIT(b,1); -+ case 1: -+ b0 = MP_DIGIT(b,0); -+ } -+ -+#ifndef MPI_AMD64_ADD -+ MP_SUB_BORROW(r0, b0, r0, 0, borrow); -+ MP_SUB_BORROW(r1, b1, r1, borrow, borrow); -+ MP_SUB_BORROW(r2, b2, r2, borrow, borrow); -+#else -+ __asm__ ( -+ "xorq %3,%3 \n\t" -+ "subq %4,%0 \n\t" -+ "sbbq %5,%1 \n\t" -+ "sbbq %6,%2 \n\t" -+ "adcq $0,%3 \n\t" -+ : "=r"(r0), "=r"(r1), "=r"(r2), "=r"(borrow) -+ : "r" (b0), "r" (b1), "r" (b2), "0" (r0), -+ "1" (r1), "2" (r2) -+ : "%cc" ); -+#endif -+ -+ /* Do quick 'add' if we've gone under 0 -+ * (subtract the 2's complement of the curve field) */ -+ if (borrow) { -+#ifndef MPI_AMD64_ADD -+ MP_SUB_BORROW(r0, 1, r0, 0, borrow); -+ MP_SUB_BORROW(r1, 1, r1, borrow, borrow); -+ MP_SUB_BORROW(r2, 0, r2, borrow, borrow); -+#else -+ __asm__ ( -+ "subq $1,%0 \n\t" -+ "sbbq $1,%1 \n\t" -+ "sbbq $0,%2 \n\t" -+ : "=r"(r0), "=r"(r1), "=r"(r2) -+ : "0" (r0), "1" (r1), "2" (r2) -+ : "%cc" ); -+#endif -+ } -+ -+ MP_CHECKOK(s_mp_pad(r, 3)); -+ MP_DIGIT(r, 2) = r2; -+ MP_DIGIT(r, 1) = r1; -+ MP_DIGIT(r, 0) = r0; -+ MP_SIGN(r) = MP_ZPOS; -+ MP_USED(r) = 3; -+ s_mp_clamp(r); -+ -+ CLEANUP: -+ return res; -+} -+ -+#endif -+ -+/* Compute the square of polynomial a, reduce modulo p192. Store the -+ * result in r. r could be a. Uses optimized modular reduction for p192. -+ */ -+mp_err -+ec_GFp_nistp192_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ -+ MP_CHECKOK(mp_sqr(a, r)); -+ MP_CHECKOK(ec_GFp_nistp192_mod(r, r, meth)); -+ CLEANUP: -+ return res; -+} -+ -+/* Compute the product of two polynomials a and b, reduce modulo p192. -+ * Store the result in r. r could be a or b; a could be b. Uses -+ * optimized modular reduction for p192. */ -+mp_err -+ec_GFp_nistp192_mul(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ -+ MP_CHECKOK(mp_mul(a, b, r)); -+ MP_CHECKOK(ec_GFp_nistp192_mod(r, r, meth)); -+ CLEANUP: -+ return res; -+} -+ -+/* Divides two field elements. If a is NULL, then returns the inverse of -+ * b. */ -+mp_err -+ec_GFp_nistp192_div(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_int t; -+ -+ /* If a is NULL, then return the inverse of b, otherwise return a/b. */ -+ if (a == NULL) { -+ return mp_invmod(b, &meth->irr, r); -+ } else { -+ /* MPI doesn't support divmod, so we implement it using invmod and -+ * mulmod. */ -+ MP_CHECKOK(mp_init(&t, FLAG(b))); -+ MP_CHECKOK(mp_invmod(b, &meth->irr, &t)); -+ MP_CHECKOK(mp_mul(a, &t, r)); -+ MP_CHECKOK(ec_GFp_nistp192_mod(r, r, meth)); -+ CLEANUP: -+ mp_clear(&t); -+ return res; -+ } -+} -+ -+/* Wire in fast field arithmetic and precomputation of base point for -+ * named curves. */ -+mp_err -+ec_group_set_gfp192(ECGroup *group, ECCurveName name) -+{ -+ if (name == ECCurve_NIST_P192) { -+ group->meth->field_mod = &ec_GFp_nistp192_mod; -+ group->meth->field_mul = &ec_GFp_nistp192_mul; -+ group->meth->field_sqr = &ec_GFp_nistp192_sqr; -+ group->meth->field_div = &ec_GFp_nistp192_div; -+#ifndef ECL_THIRTY_TWO_BIT -+ group->meth->field_add = &ec_GFp_nistp192_add; -+ group->meth->field_sub = &ec_GFp_nistp192_sub; -+#endif -+ } -+ return MP_OKAY; -+} -diff --git a/jdk/src/share/native/sun/security/ec/impl/ecp_224.c b/jdk/src/share/native/sun/security/ec/impl/ecp_224.c -new file mode 100644 -index 00000000..b2901e06 ---- /dev/null -+++ b/jdk/src/share/native/sun/security/ec/impl/ecp_224.c -@@ -0,0 +1,373 @@ -+/* -+ * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. -+ * Use is subject to license terms. -+ * -+ * This library is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU Lesser General Public -+ * License as published by the Free Software Foundation; either -+ * version 2.1 of the License, or (at your option) any later version. -+ * -+ * This library is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -+ * Lesser General Public License for more details. -+ * -+ * You should have received a copy of the GNU Lesser General Public License -+ * along with this library; if not, write to the Free Software Foundation, -+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ * -+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA -+ * or visit www.oracle.com if you need additional information or have any -+ * questions. -+ */ -+ -+/* ********************************************************************* -+ * -+ * The Original Code is the elliptic curve math library for prime field curves. -+ * -+ * The Initial Developer of the Original Code is -+ * Sun Microsystems, Inc. -+ * Portions created by the Initial Developer are Copyright (C) 2003 -+ * the Initial Developer. All Rights Reserved. -+ * -+ * Contributor(s): -+ * Douglas Stebila , Sun Microsystems Laboratories -+ * -+ *********************************************************************** */ -+ -+#include "ecp.h" -+#include "mpi.h" -+#include "mplogic.h" -+#include "mpi-priv.h" -+#ifndef _KERNEL -+#include -+#endif -+ -+#define ECP224_DIGITS ECL_CURVE_DIGITS(224) -+ -+/* Fast modular reduction for p224 = 2^224 - 2^96 + 1. a can be r. Uses -+ * algorithm 7 from Brown, Hankerson, Lopez, Menezes. Software -+ * Implementation of the NIST Elliptic Curves over Prime Fields. */ -+mp_err -+ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_size a_used = MP_USED(a); -+ -+ int r3b; -+ mp_digit carry; -+#ifdef ECL_THIRTY_TWO_BIT -+ mp_digit a6a = 0, a6b = 0, -+ a5a = 0, a5b = 0, a4a = 0, a4b = 0, a3a = 0, a3b = 0; -+ mp_digit r0a, r0b, r1a, r1b, r2a, r2b, r3a; -+#else -+ mp_digit a6 = 0, a5 = 0, a4 = 0, a3b = 0, a5a = 0; -+ mp_digit a6b = 0, a6a_a5b = 0, a5b = 0, a5a_a4b = 0, a4a_a3b = 0; -+ mp_digit r0, r1, r2, r3; -+#endif -+ -+ /* reduction not needed if a is not larger than field size */ -+ if (a_used < ECP224_DIGITS) { -+ if (a == r) return MP_OKAY; -+ return mp_copy(a, r); -+ } -+ /* for polynomials larger than twice the field size, use regular -+ * reduction */ -+ if (a_used > ECL_CURVE_DIGITS(224*2)) { -+ MP_CHECKOK(mp_mod(a, &meth->irr, r)); -+ } else { -+#ifdef ECL_THIRTY_TWO_BIT -+ /* copy out upper words of a */ -+ switch (a_used) { -+ case 14: -+ a6b = MP_DIGIT(a, 13); -+ case 13: -+ a6a = MP_DIGIT(a, 12); -+ case 12: -+ a5b = MP_DIGIT(a, 11); -+ case 11: -+ a5a = MP_DIGIT(a, 10); -+ case 10: -+ a4b = MP_DIGIT(a, 9); -+ case 9: -+ a4a = MP_DIGIT(a, 8); -+ case 8: -+ a3b = MP_DIGIT(a, 7); -+ } -+ r3a = MP_DIGIT(a, 6); -+ r2b= MP_DIGIT(a, 5); -+ r2a= MP_DIGIT(a, 4); -+ r1b = MP_DIGIT(a, 3); -+ r1a = MP_DIGIT(a, 2); -+ r0b = MP_DIGIT(a, 1); -+ r0a = MP_DIGIT(a, 0); -+ -+ -+ /* implement r = (a3a,a2,a1,a0) -+ +(a5a, a4,a3b, 0) -+ +( 0, a6,a5b, 0) -+ -( 0 0, 0|a6b, a6a|a5b ) -+ -( a6b, a6a|a5b, a5a|a4b, a4a|a3b ) */ -+ MP_ADD_CARRY (r1b, a3b, r1b, 0, carry); -+ MP_ADD_CARRY (r2a, a4a, r2a, carry, carry); -+ MP_ADD_CARRY (r2b, a4b, r2b, carry, carry); -+ MP_ADD_CARRY (r3a, a5a, r3a, carry, carry); -+ r3b = carry; -+ MP_ADD_CARRY (r1b, a5b, r1b, 0, carry); -+ MP_ADD_CARRY (r2a, a6a, r2a, carry, carry); -+ MP_ADD_CARRY (r2b, a6b, r2b, carry, carry); -+ MP_ADD_CARRY (r3a, 0, r3a, carry, carry); -+ r3b += carry; -+ MP_SUB_BORROW(r0a, a3b, r0a, 0, carry); -+ MP_SUB_BORROW(r0b, a4a, r0b, carry, carry); -+ MP_SUB_BORROW(r1a, a4b, r1a, carry, carry); -+ MP_SUB_BORROW(r1b, a5a, r1b, carry, carry); -+ MP_SUB_BORROW(r2a, a5b, r2a, carry, carry); -+ MP_SUB_BORROW(r2b, a6a, r2b, carry, carry); -+ MP_SUB_BORROW(r3a, a6b, r3a, carry, carry); -+ r3b -= carry; -+ MP_SUB_BORROW(r0a, a5b, r0a, 0, carry); -+ MP_SUB_BORROW(r0b, a6a, r0b, carry, carry); -+ MP_SUB_BORROW(r1a, a6b, r1a, carry, carry); -+ if (carry) { -+ MP_SUB_BORROW(r1b, 0, r1b, carry, carry); -+ MP_SUB_BORROW(r2a, 0, r2a, carry, carry); -+ MP_SUB_BORROW(r2b, 0, r2b, carry, carry); -+ MP_SUB_BORROW(r3a, 0, r3a, carry, carry); -+ r3b -= carry; -+ } -+ -+ while (r3b > 0) { -+ int tmp; -+ MP_ADD_CARRY(r1b, r3b, r1b, 0, carry); -+ if (carry) { -+ MP_ADD_CARRY(r2a, 0, r2a, carry, carry); -+ MP_ADD_CARRY(r2b, 0, r2b, carry, carry); -+ MP_ADD_CARRY(r3a, 0, r3a, carry, carry); -+ } -+ tmp = carry; -+ MP_SUB_BORROW(r0a, r3b, r0a, 0, carry); -+ if (carry) { -+ MP_SUB_BORROW(r0b, 0, r0b, carry, carry); -+ MP_SUB_BORROW(r1a, 0, r1a, carry, carry); -+ MP_SUB_BORROW(r1b, 0, r1b, carry, carry); -+ MP_SUB_BORROW(r2a, 0, r2a, carry, carry); -+ MP_SUB_BORROW(r2b, 0, r2b, carry, carry); -+ MP_SUB_BORROW(r3a, 0, r3a, carry, carry); -+ tmp -= carry; -+ } -+ r3b = tmp; -+ } -+ -+ while (r3b < 0) { -+ mp_digit maxInt = MP_DIGIT_MAX; -+ MP_ADD_CARRY (r0a, 1, r0a, 0, carry); -+ MP_ADD_CARRY (r0b, 0, r0b, carry, carry); -+ MP_ADD_CARRY (r1a, 0, r1a, carry, carry); -+ MP_ADD_CARRY (r1b, maxInt, r1b, carry, carry); -+ MP_ADD_CARRY (r2a, maxInt, r2a, carry, carry); -+ MP_ADD_CARRY (r2b, maxInt, r2b, carry, carry); -+ MP_ADD_CARRY (r3a, maxInt, r3a, carry, carry); -+ r3b += carry; -+ } -+ /* check for final reduction */ -+ /* now the only way we are over is if the top 4 words are all ones */ -+ if ((r3a == MP_DIGIT_MAX) && (r2b == MP_DIGIT_MAX) -+ && (r2a == MP_DIGIT_MAX) && (r1b == MP_DIGIT_MAX) && -+ ((r1a != 0) || (r0b != 0) || (r0a != 0)) ) { -+ /* one last subraction */ -+ MP_SUB_BORROW(r0a, 1, r0a, 0, carry); -+ MP_SUB_BORROW(r0b, 0, r0b, carry, carry); -+ MP_SUB_BORROW(r1a, 0, r1a, carry, carry); -+ r1b = r2a = r2b = r3a = 0; -+ } -+ -+ -+ if (a != r) { -+ MP_CHECKOK(s_mp_pad(r, 7)); -+ } -+ /* set the lower words of r */ -+ MP_SIGN(r) = MP_ZPOS; -+ MP_USED(r) = 7; -+ MP_DIGIT(r, 6) = r3a; -+ MP_DIGIT(r, 5) = r2b; -+ MP_DIGIT(r, 4) = r2a; -+ MP_DIGIT(r, 3) = r1b; -+ MP_DIGIT(r, 2) = r1a; -+ MP_DIGIT(r, 1) = r0b; -+ MP_DIGIT(r, 0) = r0a; -+#else -+ /* copy out upper words of a */ -+ switch (a_used) { -+ case 7: -+ a6 = MP_DIGIT(a, 6); -+ a6b = a6 >> 32; -+ a6a_a5b = a6 << 32; -+ case 6: -+ a5 = MP_DIGIT(a, 5); -+ a5b = a5 >> 32; -+ a6a_a5b |= a5b; -+ a5b = a5b << 32; -+ a5a_a4b = a5 << 32; -+ a5a = a5 & 0xffffffff; -+ case 5: -+ a4 = MP_DIGIT(a, 4); -+ a5a_a4b |= a4 >> 32; -+ a4a_a3b = a4 << 32; -+ case 4: -+ a3b = MP_DIGIT(a, 3) >> 32; -+ a4a_a3b |= a3b; -+ a3b = a3b << 32; -+ } -+ -+ r3 = MP_DIGIT(a, 3) & 0xffffffff; -+ r2 = MP_DIGIT(a, 2); -+ r1 = MP_DIGIT(a, 1); -+ r0 = MP_DIGIT(a, 0); -+ -+ /* implement r = (a3a,a2,a1,a0) -+ +(a5a, a4,a3b, 0) -+ +( 0, a6,a5b, 0) -+ -( 0 0, 0|a6b, a6a|a5b ) -+ -( a6b, a6a|a5b, a5a|a4b, a4a|a3b ) */ -+ MP_ADD_CARRY_ZERO (r1, a3b, r1, carry); -+ MP_ADD_CARRY (r2, a4 , r2, carry, carry); -+ MP_ADD_CARRY (r3, a5a, r3, carry, carry); -+ MP_ADD_CARRY_ZERO (r1, a5b, r1, carry); -+ MP_ADD_CARRY (r2, a6 , r2, carry, carry); -+ MP_ADD_CARRY (r3, 0, r3, carry, carry); -+ -+ MP_SUB_BORROW(r0, a4a_a3b, r0, 0, carry); -+ MP_SUB_BORROW(r1, a5a_a4b, r1, carry, carry); -+ MP_SUB_BORROW(r2, a6a_a5b, r2, carry, carry); -+ MP_SUB_BORROW(r3, a6b , r3, carry, carry); -+ MP_SUB_BORROW(r0, a6a_a5b, r0, 0, carry); -+ MP_SUB_BORROW(r1, a6b , r1, carry, carry); -+ if (carry) { -+ MP_SUB_BORROW(r2, 0, r2, carry, carry); -+ MP_SUB_BORROW(r3, 0, r3, carry, carry); -+ } -+ -+ -+ /* if the value is negative, r3 has a 2's complement -+ * high value */ -+ r3b = (int)(r3 >>32); -+ while (r3b > 0) { -+ r3 &= 0xffffffff; -+ MP_ADD_CARRY_ZERO(r1,((mp_digit)r3b) << 32, r1, carry); -+ if (carry) { -+ MP_ADD_CARRY(r2, 0, r2, carry, carry); -+ MP_ADD_CARRY(r3, 0, r3, carry, carry); -+ } -+ MP_SUB_BORROW(r0, r3b, r0, 0, carry); -+ if (carry) { -+ MP_SUB_BORROW(r1, 0, r1, carry, carry); -+ MP_SUB_BORROW(r2, 0, r2, carry, carry); -+ MP_SUB_BORROW(r3, 0, r3, carry, carry); -+ } -+ r3b = (int)(r3 >>32); -+ } -+ -+ while (r3b < 0) { -+ MP_ADD_CARRY_ZERO (r0, 1, r0, carry); -+ MP_ADD_CARRY (r1, MP_DIGIT_MAX <<32, r1, carry, carry); -+ MP_ADD_CARRY (r2, MP_DIGIT_MAX, r2, carry, carry); -+ MP_ADD_CARRY (r3, MP_DIGIT_MAX >> 32, r3, carry, carry); -+ r3b = (int)(r3 >>32); -+ } -+ /* check for final reduction */ -+ /* now the only way we are over is if the top 4 words are all ones */ -+ if ((r3 == (MP_DIGIT_MAX >> 32)) && (r2 == MP_DIGIT_MAX) -+ && ((r1 & MP_DIGIT_MAX << 32)== MP_DIGIT_MAX << 32) && -+ ((r1 != MP_DIGIT_MAX << 32 ) || (r0 != 0)) ) { -+ /* one last subraction */ -+ MP_SUB_BORROW(r0, 1, r0, 0, carry); -+ MP_SUB_BORROW(r1, 0, r1, carry, carry); -+ r2 = r3 = 0; -+ } -+ -+ -+ if (a != r) { -+ MP_CHECKOK(s_mp_pad(r, 4)); -+ } -+ /* set the lower words of r */ -+ MP_SIGN(r) = MP_ZPOS; -+ MP_USED(r) = 4; -+ MP_DIGIT(r, 3) = r3; -+ MP_DIGIT(r, 2) = r2; -+ MP_DIGIT(r, 1) = r1; -+ MP_DIGIT(r, 0) = r0; -+#endif -+ } -+ -+ CLEANUP: -+ return res; -+} -+ -+/* Compute the square of polynomial a, reduce modulo p224. Store the -+ * result in r. r could be a. Uses optimized modular reduction for p224. -+ */ -+mp_err -+ec_GFp_nistp224_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ -+ MP_CHECKOK(mp_sqr(a, r)); -+ MP_CHECKOK(ec_GFp_nistp224_mod(r, r, meth)); -+ CLEANUP: -+ return res; -+} -+ -+/* Compute the product of two polynomials a and b, reduce modulo p224. -+ * Store the result in r. r could be a or b; a could be b. Uses -+ * optimized modular reduction for p224. */ -+mp_err -+ec_GFp_nistp224_mul(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ -+ MP_CHECKOK(mp_mul(a, b, r)); -+ MP_CHECKOK(ec_GFp_nistp224_mod(r, r, meth)); -+ CLEANUP: -+ return res; -+} -+ -+/* Divides two field elements. If a is NULL, then returns the inverse of -+ * b. */ -+mp_err -+ec_GFp_nistp224_div(const mp_int *a, const mp_int *b, mp_int *r, -+ const GFMethod *meth) -+{ -+ mp_err res = MP_OKAY; -+ mp_int t; -+ -+ /* If a is NULL, then return the inverse of b, otherwise return a/b. */ -+ if (a == NULL) { -+ return mp_invmod(b, &meth->irr, r); -+ } else { -+ /* MPI doesn't support divmod, so we implement it using invmod and -+ * mulmod. */ -+ MP_CHECKOK(mp_init(&t, FLAG(b))); -+ MP_CHECKOK(mp_invmod(b, &meth->irr, &t)); -+ MP_CHECKOK(mp_mul(a, &t, r)); -+ MP_CHECKOK(ec_GFp_nistp224_mod(r, r, meth)); -+ CLEANUP: -+ mp_clear(&t); -+ return res; -+ } -+} -+ -+/* Wire in fast field arithmetic and precomputation of base point for -+ * named curves. */ -+mp_err -+ec_group_set_gfp224(ECGroup *group, ECCurveName name) -+{ -+ if (name == ECCurve_NIST_P224) { -+ group->meth->field_mod = &ec_GFp_nistp224_mod; -+ group->meth->field_mul = &ec_GFp_nistp224_mul; -+ group->meth->field_sqr = &ec_GFp_nistp224_sqr; -+ group->meth->field_div = &ec_GFp_nistp224_div; -+ } -+ return MP_OKAY; -+} -diff --git a/jdk/src/share/native/sun/security/ec/impl/oid.c b/jdk/src/share/native/sun/security/ec/impl/oid.c -index e1e346ef..6239ec4d 100644 ---- a/jdk/src/share/native/sun/security/ec/impl/oid.c -+++ b/jdk/src/share/native/sun/security/ec/impl/oid.c -@@ -69,13 +69,71 @@ - /* NOTE: prime192v1 is the same as secp192r1, prime256v1 is the - * same as secp256r1 - */ -+CONST_OID ansiX962prime192v1[] = { ANSI_X962_GFp_OID, 0x01 }; -+CONST_OID ansiX962prime192v2[] = { ANSI_X962_GFp_OID, 0x02 }; -+CONST_OID ansiX962prime192v3[] = { ANSI_X962_GFp_OID, 0x03 }; -+CONST_OID ansiX962prime239v1[] = { ANSI_X962_GFp_OID, 0x04 }; -+CONST_OID ansiX962prime239v2[] = { ANSI_X962_GFp_OID, 0x05 }; -+CONST_OID ansiX962prime239v3[] = { ANSI_X962_GFp_OID, 0x06 }; - CONST_OID ansiX962prime256v1[] = { ANSI_X962_GFp_OID, 0x07 }; - - /* SECG prime curve OIDs */ -+CONST_OID secgECsecp112r1[] = { SECG_OID, 0x06 }; -+CONST_OID secgECsecp112r2[] = { SECG_OID, 0x07 }; -+CONST_OID secgECsecp128r1[] = { SECG_OID, 0x1c }; -+CONST_OID secgECsecp128r2[] = { SECG_OID, 0x1d }; -+CONST_OID secgECsecp160k1[] = { SECG_OID, 0x09 }; -+CONST_OID secgECsecp160r1[] = { SECG_OID, 0x08 }; -+CONST_OID secgECsecp160r2[] = { SECG_OID, 0x1e }; -+CONST_OID secgECsecp192k1[] = { SECG_OID, 0x1f }; -+CONST_OID secgECsecp224k1[] = { SECG_OID, 0x20 }; -+CONST_OID secgECsecp224r1[] = { SECG_OID, 0x21 }; - CONST_OID secgECsecp256k1[] = { SECG_OID, 0x0a }; - CONST_OID secgECsecp384r1[] = { SECG_OID, 0x22 }; - CONST_OID secgECsecp521r1[] = { SECG_OID, 0x23 }; - -+/* SECG characterisitic two curve OIDs */ -+CONST_OID secgECsect113r1[] = {SECG_OID, 0x04 }; -+CONST_OID secgECsect113r2[] = {SECG_OID, 0x05 }; -+CONST_OID secgECsect131r1[] = {SECG_OID, 0x16 }; -+CONST_OID secgECsect131r2[] = {SECG_OID, 0x17 }; -+CONST_OID secgECsect163k1[] = {SECG_OID, 0x01 }; -+CONST_OID secgECsect163r1[] = {SECG_OID, 0x02 }; -+CONST_OID secgECsect163r2[] = {SECG_OID, 0x0f }; -+CONST_OID secgECsect193r1[] = {SECG_OID, 0x18 }; -+CONST_OID secgECsect193r2[] = {SECG_OID, 0x19 }; -+CONST_OID secgECsect233k1[] = {SECG_OID, 0x1a }; -+CONST_OID secgECsect233r1[] = {SECG_OID, 0x1b }; -+CONST_OID secgECsect239k1[] = {SECG_OID, 0x03 }; -+CONST_OID secgECsect283k1[] = {SECG_OID, 0x10 }; -+CONST_OID secgECsect283r1[] = {SECG_OID, 0x11 }; -+CONST_OID secgECsect409k1[] = {SECG_OID, 0x24 }; -+CONST_OID secgECsect409r1[] = {SECG_OID, 0x25 }; -+CONST_OID secgECsect571k1[] = {SECG_OID, 0x26 }; -+CONST_OID secgECsect571r1[] = {SECG_OID, 0x27 }; -+ -+/* ANSI X9.62 characteristic two curve OIDs */ -+CONST_OID ansiX962c2pnb163v1[] = { ANSI_X962_GF2m_OID, 0x01 }; -+CONST_OID ansiX962c2pnb163v2[] = { ANSI_X962_GF2m_OID, 0x02 }; -+CONST_OID ansiX962c2pnb163v3[] = { ANSI_X962_GF2m_OID, 0x03 }; -+CONST_OID ansiX962c2pnb176v1[] = { ANSI_X962_GF2m_OID, 0x04 }; -+CONST_OID ansiX962c2tnb191v1[] = { ANSI_X962_GF2m_OID, 0x05 }; -+CONST_OID ansiX962c2tnb191v2[] = { ANSI_X962_GF2m_OID, 0x06 }; -+CONST_OID ansiX962c2tnb191v3[] = { ANSI_X962_GF2m_OID, 0x07 }; -+CONST_OID ansiX962c2onb191v4[] = { ANSI_X962_GF2m_OID, 0x08 }; -+CONST_OID ansiX962c2onb191v5[] = { ANSI_X962_GF2m_OID, 0x09 }; -+CONST_OID ansiX962c2pnb208w1[] = { ANSI_X962_GF2m_OID, 0x0a }; -+CONST_OID ansiX962c2tnb239v1[] = { ANSI_X962_GF2m_OID, 0x0b }; -+CONST_OID ansiX962c2tnb239v2[] = { ANSI_X962_GF2m_OID, 0x0c }; -+CONST_OID ansiX962c2tnb239v3[] = { ANSI_X962_GF2m_OID, 0x0d }; -+CONST_OID ansiX962c2onb239v4[] = { ANSI_X962_GF2m_OID, 0x0e }; -+CONST_OID ansiX962c2onb239v5[] = { ANSI_X962_GF2m_OID, 0x0f }; -+CONST_OID ansiX962c2pnb272w1[] = { ANSI_X962_GF2m_OID, 0x10 }; -+CONST_OID ansiX962c2pnb304w1[] = { ANSI_X962_GF2m_OID, 0x11 }; -+CONST_OID ansiX962c2tnb359v1[] = { ANSI_X962_GF2m_OID, 0x12 }; -+CONST_OID ansiX962c2pnb368w1[] = { ANSI_X962_GF2m_OID, 0x13 }; -+CONST_OID ansiX962c2tnb431r1[] = { ANSI_X962_GF2m_OID, 0x14 }; -+ - #define OI(x) { siDEROID, (unsigned char *)x, sizeof x } - #ifndef SECOID_NO_STRINGS - #define OD(oid,tag,desc,mech,ext) { OI(oid), tag, desc, mech, ext } -@@ -96,18 +154,30 @@ static SECOidData ANSI_prime_oids[] = { - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -+ OD( ansiX962prime192v1, ECCurve_NIST_P192, -+ "ANSI X9.62 elliptic curve prime192v1 (aka secp192r1, NIST P-192)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962prime192v2, ECCurve_X9_62_PRIME_192V2, -+ "ANSI X9.62 elliptic curve prime192v2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962prime192v3, ECCurve_X9_62_PRIME_192V3, -+ "ANSI X9.62 elliptic curve prime192v3", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962prime239v1, ECCurve_X9_62_PRIME_239V1, -+ "ANSI X9.62 elliptic curve prime239v1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962prime239v2, ECCurve_X9_62_PRIME_239V2, -+ "ANSI X9.62 elliptic curve prime239v2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962prime239v3, ECCurve_X9_62_PRIME_239V3, -+ "ANSI X9.62 elliptic curve prime239v3", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), - OD( ansiX962prime256v1, ECCurve_NIST_P256, - "ANSI X9.62 elliptic curve prime256v1 (aka secp256r1, NIST P-256)", - CKM_INVALID_MECHANISM, -@@ -118,24 +188,42 @@ static SECOidData SECG_oids[] = { - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -+ OD( secgECsect163k1, ECCurve_NIST_K163, -+ "SECG elliptic curve sect163k1 (aka NIST K-163)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect163r1, ECCurve_SECG_CHAR2_163R1, -+ "SECG elliptic curve sect163r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect239k1, ECCurve_SECG_CHAR2_239K1, -+ "SECG elliptic curve sect239k1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect113r1, ECCurve_SECG_CHAR2_113R1, -+ "SECG elliptic curve sect113r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect113r2, ECCurve_SECG_CHAR2_113R2, -+ "SECG elliptic curve sect113r2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp112r1, ECCurve_SECG_PRIME_112R1, -+ "SECG elliptic curve secp112r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp112r2, ECCurve_SECG_PRIME_112R2, -+ "SECG elliptic curve secp112r2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp160r1, ECCurve_SECG_PRIME_160R1, -+ "SECG elliptic curve secp160r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp160k1, ECCurve_SECG_PRIME_160K1, -+ "SECG elliptic curve secp160k1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), - OD( secgECsecp256k1, ECCurve_SECG_PRIME_256K1, - "SECG elliptic curve secp256k1", - CKM_INVALID_MECHANISM, -@@ -148,6 +236,18 @@ static SECOidData SECG_oids[] = { - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -+ OD( secgECsect163r2, ECCurve_NIST_B163, -+ "SECG elliptic curve sect163r2 (aka NIST B-163)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect283k1, ECCurve_NIST_K283, -+ "SECG elliptic curve sect283k1 (aka NIST K-283)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect283r1, ECCurve_NIST_B283, -+ "SECG elliptic curve sect283r1 (aka NIST B-283)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - { { siDEROID, NULL, 0 }, ECCurve_noName, -@@ -156,36 +256,54 @@ static SECOidData SECG_oids[] = { - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -+ OD( secgECsect131r1, ECCurve_SECG_CHAR2_131R1, -+ "SECG elliptic curve sect131r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect131r2, ECCurve_SECG_CHAR2_131R2, -+ "SECG elliptic curve sect131r2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect193r1, ECCurve_SECG_CHAR2_193R1, -+ "SECG elliptic curve sect193r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect193r2, ECCurve_SECG_CHAR2_193R2, -+ "SECG elliptic curve sect193r2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect233k1, ECCurve_NIST_K233, -+ "SECG elliptic curve sect233k1 (aka NIST K-233)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect233r1, ECCurve_NIST_B233, -+ "SECG elliptic curve sect233r1 (aka NIST B-233)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp128r1, ECCurve_SECG_PRIME_128R1, -+ "SECG elliptic curve secp128r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp128r2, ECCurve_SECG_PRIME_128R2, -+ "SECG elliptic curve secp128r2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp160r2, ECCurve_SECG_PRIME_160R2, -+ "SECG elliptic curve secp160r2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp192k1, ECCurve_SECG_PRIME_192K1, -+ "SECG elliptic curve secp192k1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp224k1, ECCurve_SECG_PRIME_224K1, -+ "SECG elliptic curve secp224k1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsecp224r1, ECCurve_NIST_P224, -+ "SECG elliptic curve secp224r1 (aka NIST P-224)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), - OD( secgECsecp384r1, ECCurve_NIST_P384, - "SECG elliptic curve secp384r1 (aka NIST P-384)", - CKM_INVALID_MECHANISM, -@@ -194,14 +312,22 @@ static SECOidData SECG_oids[] = { - "SECG elliptic curve secp521r1 (aka NIST P-521)", - CKM_INVALID_MECHANISM, - INVALID_CERT_EXTENSION ), -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION } -+ OD( secgECsect409k1, ECCurve_NIST_K409, -+ "SECG elliptic curve sect409k1 (aka NIST K-409)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect409r1, ECCurve_NIST_B409, -+ "SECG elliptic curve sect409r1 (aka NIST B-409)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect571k1, ECCurve_NIST_K571, -+ "SECG elliptic curve sect571k1 (aka NIST K-571)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( secgECsect571r1, ECCurve_NIST_B571, -+ "SECG elliptic curve sect571r1 (aka NIST B-571)", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ) - }; - - static SECOidData ANSI_oids[] = { -@@ -209,46 +335,78 @@ static SECOidData ANSI_oids[] = { - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - - /* ANSI X9.62 named elliptic curves (characteristic two field) */ -+ OD( ansiX962c2pnb163v1, ECCurve_X9_62_CHAR2_PNB163V1, -+ "ANSI X9.62 elliptic curve c2pnb163v1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2pnb163v2, ECCurve_X9_62_CHAR2_PNB163V2, -+ "ANSI X9.62 elliptic curve c2pnb163v2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2pnb163v3, ECCurve_X9_62_CHAR2_PNB163V3, -+ "ANSI X9.62 elliptic curve c2pnb163v3", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2pnb176v1, ECCurve_X9_62_CHAR2_PNB176V1, -+ "ANSI X9.62 elliptic curve c2pnb176v1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb191v1, ECCurve_X9_62_CHAR2_TNB191V1, -+ "ANSI X9.62 elliptic curve c2tnb191v1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb191v2, ECCurve_X9_62_CHAR2_TNB191V2, -+ "ANSI X9.62 elliptic curve c2tnb191v2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb191v3, ECCurve_X9_62_CHAR2_TNB191V3, -+ "ANSI X9.62 elliptic curve c2tnb191v3", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -+ OD( ansiX962c2pnb208w1, ECCurve_X9_62_CHAR2_PNB208W1, -+ "ANSI X9.62 elliptic curve c2pnb208w1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb239v1, ECCurve_X9_62_CHAR2_TNB239V1, -+ "ANSI X9.62 elliptic curve c2tnb239v1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb239v2, ECCurve_X9_62_CHAR2_TNB239V2, -+ "ANSI X9.62 elliptic curve c2tnb239v2", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb239v3, ECCurve_X9_62_CHAR2_TNB239V3, -+ "ANSI X9.62 elliptic curve c2tnb239v3", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, - { { siDEROID, NULL, 0 }, ECCurve_noName, - "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, -- { { siDEROID, NULL, 0 }, ECCurve_noName, -- "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION } -+ OD( ansiX962c2pnb272w1, ECCurve_X9_62_CHAR2_PNB272W1, -+ "ANSI X9.62 elliptic curve c2pnb272w1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2pnb304w1, ECCurve_X9_62_CHAR2_PNB304W1, -+ "ANSI X9.62 elliptic curve c2pnb304w1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb359v1, ECCurve_X9_62_CHAR2_TNB359V1, -+ "ANSI X9.62 elliptic curve c2tnb359v1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2pnb368w1, ECCurve_X9_62_CHAR2_PNB368W1, -+ "ANSI X9.62 elliptic curve c2pnb368w1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ), -+ OD( ansiX962c2tnb431r1, ECCurve_X9_62_CHAR2_TNB431R1, -+ "ANSI X9.62 elliptic curve c2tnb431r1", -+ CKM_INVALID_MECHANISM, -+ INVALID_CERT_EXTENSION ) - }; - - SECOidData * diff --git a/jdk/src/solaris/bin/loongarch64/jvm.cfg b/jdk/src/solaris/bin/loongarch64/jvm.cfg new file mode 100644 index 00000000..42a06755 @@ -172713,7 +167186,7 @@ index 00000000..42a06755 +-server KNOWN +-client IGNORE diff --git a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java -index d6a026b2..b6548602 100644 +index 17c8419c..a8b76cb7 100644 --- a/jdk/test/jdk/jfr/event/os/TestCPUInformation.java +++ b/jdk/test/jdk/jfr/event/os/TestCPUInformation.java @@ -54,8 +54,8 @@ public class TestCPUInformation { @@ -172735,19 +167208,6 @@ diff --git a/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher new file mode 100644 index 00000000..5c8385ca Binary files /dev/null and b/jdk/test/sun/management/jmxremote/bootstrap/linux-mips64el/launcher differ -diff --git a/jdk/test/sun/security/ec/TestEC.java b/jdk/test/sun/security/ec/TestEC.java -index f234a0a0..08bc929c 100644 ---- a/jdk/test/sun/security/ec/TestEC.java -+++ b/jdk/test/sun/security/ec/TestEC.java -@@ -36,7 +36,7 @@ - * @library ../../../java/security/testlibrary - * @library ../../../javax/net/ssl/TLSCommon - * @compile -XDignore.symbol.file TestEC.java -- * @run main/othervm -Djdk.tls.namedGroups="secp256r1" TestEC -+ * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" TestEC - */ - - import java.security.NoSuchProviderException; diff --git a/jdk/test/sun/security/pkcs11/PKCS11Test.java b/jdk/test/sun/security/pkcs11/PKCS11Test.java index 5fc9c605..9db6a17d 100644 --- a/jdk/test/sun/security/pkcs11/PKCS11Test.java @@ -172774,104 +167234,6 @@ index 5fc9c605..9db6a17d 100644 osMap.put("Windows-x86-32", new String[]{ PKCS11_BASE + "/nss/lib/windows-i586/".replace('/', SEP)}); osMap.put("Windows-amd64-64", new String[]{ -diff --git a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java -index ea14d672..717590f6 100644 ---- a/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java -+++ b/jdk/test/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java -@@ -33,7 +33,7 @@ - * @author Andreas Sterbenz - * @library /lib .. ../../../../javax/net/ssl/TLSCommon - * @library ../../../../java/security/testlibrary -- * @run main/othervm -Djdk.tls.namedGroups="secp256r1" -+ * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" - * ClientJSSEServerJSSE - * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" - * ClientJSSEServerJSSE sm policy -diff --git a/langtools/THIRD_PARTY_README b/langtools/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 ---- a/langtools/THIRD_PARTY_README -+++ b/langtools/THIRD_PARTY_README -@@ -7,7 +7,7 @@ OpenJDK 8. - - --- begin of LICENSE --- - --Copyright (c) 2000-2011 France Télécom -+Copyright (c) 2000-2011 France T??l??com - All rights reserved. - - Redistribution and use in source and binary forms, with or without -@@ -1035,7 +1035,7 @@ JRE 8, JDK 8, and OpenJDK 8. - --- begin of LICENSE --- - - Copyright notice --Copyright © 2011 Ecma International -+Copyright ?? 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. - Unicode Terms of Use - - For the general privacy policy governing access to this site, see the Unicode --Privacy Policy. For trademark usage, see the Unicode® Consortium Name and -+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and - Trademark Usage Policy. - - A. Unicode Copyright. -- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. -+ 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. - - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative -- works conforming to the Unicode® Standard, subject to Terms and -+ works conforming to the Unicode?? Standard, subject to Terms and - Conditions herein. - - 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, -- Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of -+ Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of - Unicode, Inc. Use of the information and materials found on this -- website indicates your acknowledgement of Unicode, Inc.’s exclusive -+ website indicates your acknowledgement of Unicode, Inc.???s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - -- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark -- Policy”) are incorporated herein by reference and you agree to abide by -+ 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark -+ Policy???) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - -@@ -2632,12 +2632,12 @@ Miscellaneous. - - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not -- assign any part of this Agreement without Unicode’s prior written -+ assign any part of this Agreement without Unicode???s prior written - consent. - - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on -- Unicode’s net income. -+ Unicode???s net income. - - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - --Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the -+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/langtools/test/tools/javadoc/api/basic/TagletPathTest.java b/langtools/test/tools/javadoc/api/basic/TagletPathTest.java new file mode 100644 index 00000000..52dd5c81 @@ -173142,88 +167504,3 @@ index 00000000..426b0db8 + } +} + -diff --git a/nashorn/THIRD_PARTY_README b/nashorn/THIRD_PARTY_README -index 64bb0ff9..d19de8ae 100644 ---- a/nashorn/THIRD_PARTY_README -+++ b/nashorn/THIRD_PARTY_README -@@ -7,7 +7,7 @@ OpenJDK 8. - - --- begin of LICENSE --- - --Copyright (c) 2000-2011 France Télécom -+Copyright (c) 2000-2011 France T??l??com - All rights reserved. - - Redistribution and use in source and binary forms, with or without -@@ -1035,7 +1035,7 @@ JRE 8, JDK 8, and OpenJDK 8. - --- begin of LICENSE --- - - Copyright notice --Copyright © 2011 Ecma International -+Copyright ?? 2011 Ecma International - Ecma International - Rue du Rhone 114 - CH-1204 Geneva -@@ -2527,16 +2527,16 @@ which may be included with JRE 8, JDK 8, and OpenJDK 8. - Unicode Terms of Use - - For the general privacy policy governing access to this site, see the Unicode --Privacy Policy. For trademark usage, see the Unicode® Consortium Name and -+Privacy Policy. For trademark usage, see the Unicode?? Consortium Name and - Trademark Usage Policy. - - A. Unicode Copyright. -- 1. Copyright © 1991-2013 Unicode, Inc. All rights reserved. -+ 1. Copyright ?? 1991-2013 Unicode, Inc. All rights reserved. - - 2. Certain documents and files on this website contain a legend indicating - that "Modification is permitted." Any person is hereby authorized, - without fee, to modify such documents and files to create derivative -- works conforming to the Unicode® Standard, subject to Terms and -+ works conforming to the Unicode?? Standard, subject to Terms and - Conditions herein. - - 3. Any person is hereby authorized, without fee, to view, use, reproduce, -@@ -2602,14 +2602,14 @@ D. Waiver of Damages. In no event shall Unicode or its licensors be liable for - - E.Trademarks & Logos. - 1. The Unicode Word Mark and the Unicode Logo are trademarks of Unicode, -- Inc. “The Unicode Consortium” and “Unicode, Inc.” are trade names of -+ Inc. ???The Unicode Consortium??? and ???Unicode, Inc.??? are trade names of - Unicode, Inc. Use of the information and materials found on this -- website indicates your acknowledgement of Unicode, Inc.’s exclusive -+ website indicates your acknowledgement of Unicode, Inc.???s exclusive - worldwide rights in the Unicode Word Mark, the Unicode Logo, and the - Unicode trade names. - -- 2. The Unicode Consortium Name and Trademark Usage Policy (“Trademark -- Policy”) are incorporated herein by reference and you agree to abide by -+ 2. The Unicode Consortium Name and Trademark Usage Policy (???Trademark -+ Policy???) are incorporated herein by reference and you agree to abide by - the provisions of the Trademark Policy, which may be changed from time - to time in the sole discretion of Unicode, Inc. - -@@ -2632,12 +2632,12 @@ Miscellaneous. - - 2. Modification by Unicode. Unicode shall have the right to modify this - Agreement at any time by posting it to this site. The user may not -- assign any part of this Agreement without Unicode’s prior written -+ assign any part of this Agreement without Unicode???s prior written - consent. - - 3. Taxes. The user agrees to pay any taxes arising from access to this - website or use of the information herein, except for those based on -- Unicode’s net income. -+ Unicode???s net income. - - 4. Severability. If any provision of this Agreement is declared invalid or - unenforceable, the remaining provisions of this Agreement shall remain -@@ -2666,7 +2666,7 @@ SOFTWARE. - - COPYRIGHT AND PERMISSION NOTICE - --Copyright © 1991-2012 Unicode, Inc. All rights reserved. Distributed under the -+Copyright ?? 1991-2012 Unicode, Inc. All rights reserved. Distributed under the - Terms of Use in http://www.unicode.org/copyright.html. - - Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/download b/download index ce783ef3aedf1bcb64e580f816fedb549667d54c..f8f11963dcfaa942fecb6b9d6e8ac5f196ff1756 100644 --- a/download +++ b/download @@ -1,2 +1,2 @@ -e6158e3dc90222cf4685c9966992e977 openjdk-shenandoah-jdk8u-shenandoah-jdk8u372-b07-4curve.tar.xz +0121b29ded144a2d4b2ca8c194c5ce4e shenandoah8u432-b06.tar.xz 870d829d8e1c38e251cc7498032a768a tapsets-icedtea-3.15.0.tar.xz diff --git a/java-1.8.0-openjdk.spec b/java-1.8.0-openjdk.spec index c161aea63da5f238c804f334fd5f4250d0cd84cf..22f6f893fd212592ed4953726f079dbb1c6750bc 100644 --- a/java-1.8.0-openjdk.spec +++ b/java-1.8.0-openjdk.spec @@ -13,7 +13,7 @@ # Only produce a release build on x86_64: # $ rhpkg mockbuild --without slowdebug --without fastdebug # -%global anolis_release 2 +%global anolis_release 1 # Enable fastdebug builds by default on relevant arches. %bcond_without fastdebug # Enable slowdebug builds by default on relevant arches. @@ -101,9 +101,8 @@ # Set of architectures with a Just-In-Time (JIT) compiler %global jit_arches loongarch64 # Set of architectures which use the Zero assembler port (!jit_arches) -%global zero_arches %{arm} # Set of architectures which run a full bootstrap cycle -%global bootstrap_arches %{jit_arches} %{zero_arches} +%global bootstrap_arches %{jit_arches} # Set of architectures which support SystemTap tapsets %global systemtap_arches %{jit_arches} # Set of architectures which support the serviceability agent @@ -115,9 +114,8 @@ # Set of architectures which support Java Flight Recorder (JFR) %global jfr_arches %{jit_arches} # Set of architectures for which alt-java has SSB mitigation -%global ssbd_arches x86_64 # Set of architectures where we verify backtraces with gdb -%global gdb_arches %{jit_arches} %{zero_arches} +%global gdb_arches %{jit_arches} # By default, we build a debug build during main build on JIT architectures %if %{with slowdebug} @@ -232,7 +230,7 @@ # Standard JPackage naming and versioning defines %global origin openjdk %global origin_nice OpenJDK -%global top_level_dir_name %{origin} +%global top_level_dir_name %{shenandoah_revision} # Settings for local security configuration %global security_file %{top_level_dir_name}/jdk/src/share/lib/security/java.security-%{_target_os} @@ -245,13 +243,11 @@ %global oj_vendor_bug_url https://bugzilla.redhat.com/enter_bug.cgi # note, following three variables are sedded from update_sources if used correctly. Hardcode them rather there. -%global shenandoah_project openjdk -%global shenandoah_repo shenandoah-jdk8u -%global openjdk_revision jdk8u372-b07 -%global shenandoah_revision shenandoah-%{openjdk_revision} +%global project openjdk +%global repo shenandoah-jdk8u +%global openjdk_revision 8u432-b06 +%global shenandoah_revision shenandoah%{openjdk_revision} # Define old aarch64/jdk8u tree variables for compatibility -%global project %{shenandoah_project} -%global repo %{shenandoah_repo} %global revision %{shenandoah_revision} # Define IcedTea version used for SystemTap tapsets and desktop files %global icedteaver 3.15.0 @@ -268,13 +264,13 @@ %ifnarch loongarch64 %global updatever %(VERSION=%{whole_update}; echo ${VERSION##*u}) %else -%global updatever 372 +%global updatever 432 %endif # eg jdk8u60-b27 -> b27 %ifnarch loongarch64 %global buildver %(VERSION=%{version_tag}; echo ${VERSION##*-}) %else -%global buildver b07 +%global buildver b06 %endif # Define milestone (EA for pre-releases, GA ("fcs") for releases) # Release will be (where N is usually a number starting at 1): @@ -838,10 +834,8 @@ exit 0 %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libnio.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libnpt.so %ifarch %{sa_arches} -%ifnarch %{zero_arches} %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libsaproc.so %endif -%endif %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libsctp.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libsunec.so %{_jvmdir}/%{jredir -- %{?1}}/lib/%{archinstall}/libsystemconf.so @@ -962,10 +956,8 @@ exit 0 %{_jvmdir}/%{sdkdir -- %{?1}}/lib/jconsole.jar %{_jvmdir}/%{sdkdir -- %{?1}}/lib/orb.idl %ifarch %{sa_arches} -%ifnarch %{zero_arches} %{_jvmdir}/%{sdkdir -- %{?1}}/lib/sa-jdi.jar %endif -%endif %{_jvmdir}/%{sdkdir -- %{?1}}/lib/dt.jar %{_jvmdir}/%{sdkdir -- %{?1}}/lib/jexec %{_jvmdir}/%{sdkdir -- %{?1}}/lib/tools.jar @@ -1221,7 +1213,7 @@ URL: http://openjdk.java.net/ # FILE_NAME_ROOT=%%{shenandoah_project}-%%{shenandoah_repo}-${VERSION} # REPO_ROOT= generate_source_tarball.sh # where the source is obtained from http://hg.openjdk.java.net/%%{project}/%%{repo} -Source0: %{shenandoah_project}-%{shenandoah_repo}-%{shenandoah_revision}-4curve.tar.xz +Source0: %{shenandoah_revision}.tar.xz # Custom README for -src subpackage Source2: README.md @@ -1466,9 +1458,6 @@ BuildRequires: unzip # Require a boot JDK which doesn't fail due to RH1482244 BuildRequires: java-%{buildjdkver}-openjdk-devel >= 1.7.0.151-2.6.11.3 # Zero-assembler build requirement -%ifarch %{zero_arches} -BuildRequires: libffi-devel -%endif # 2022g required as of JDK-8297804 BuildRequires: tzdata-java >= 2022g # Earlier versions have a bug in tree vectorization on PPC @@ -1772,6 +1761,7 @@ if [ $prioritylength -ne 7 ] ; then fi # For old patches ln -s %{top_level_dir_name} jdk8 +ln -s %{top_level_dir_name} openjdk cp %{SOURCE2} . @@ -1799,9 +1789,11 @@ sh %{SOURCE12} %patch204 %endif +%ifnarch loongarch64 %patch1 %patch3 %patch5 +%endif %ifnarch loongarch64 # s390 build fixes @@ -1813,9 +1805,12 @@ sh %{SOURCE12} # AArch64 fixes # x86 fixes +%ifnarch loongarch64 %patch105 +%endif # Upstreamable fixes +%ifnarch loongarch64 %patch502 %patch512 %patch523 @@ -1824,6 +1819,7 @@ sh %{SOURCE12} %patch574 %patch112 %patch581 +%endif pushd %{top_level_dir_name} # Add crypto policy and FIPS support @@ -1838,8 +1834,8 @@ pushd %{top_level_dir_name} popd # RPM-only fixes -%patch600 -%patch1003 +%patch -P600 +%patch -P1003 # Shenandoah patches @@ -1958,9 +1954,6 @@ function buildjdk() { --enable-jfr \ %else --disable-jfr \ -%endif -%ifarch %{zero_arches} - --with-jvm-variants=zero \ %endif --with-native-debug-symbols=internal \ --with-milestone=%{milestone} \ @@ -2139,29 +2132,29 @@ $JAVA_HOME/bin/java $(echo $(basename %{SOURCE14})|sed "s|\.java||") # Check system crypto (policy) is active and can be disabled # Test takes a single argument - true or false - to state whether system # security properties are enabled or not. +%ifnarch loongarch64 $JAVA_HOME/bin/javac -d . %{SOURCE15} export PROG=$(echo $(basename %{SOURCE15})|sed "s|\.java||") export SEC_DEBUG="-Djava.security.debug=properties" $JAVA_HOME/bin/java ${SEC_DEBUG} ${PROG} true $JAVA_HOME/bin/java ${SEC_DEBUG} -Djava.security.disableSystemPropertiesFile=true ${PROG} false +%endif # Check java launcher has no SSB mitigation if ! nm $JAVA_HOME/bin/java | grep set_speculation ; then true ; else false; fi # Check alt-java launcher has SSB mitigation on supported architectures -%ifarch %{ssbd_arches} -nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation -%else if ! nm $JAVA_HOME/bin/%{alt_java_name} | grep set_speculation ; then true ; else false; fi -%endif # Check correct vendor values have been set $JAVA_HOME/bin/javac -d . %{SOURCE16} $JAVA_HOME/bin/java $(echo $(basename %{SOURCE16})|sed "s|\.java||") "%{oj_vendor}" %{oj_vendor_url} %{oj_vendor_bug_url} # Check translations are available for new timezones +%ifnarch loongarch64 $JAVA_HOME/bin/javac -d . %{SOURCE18} $JAVA_HOME/bin/java $(echo $(basename %{SOURCE18})|sed "s|\.java||") JRE +%endif # Check debug symbols are present and can identify code find "$JAVA_HOME" -iname '*.so' -print0 | while read -d $'\0' lib @@ -2640,6 +2633,9 @@ cjc.mainProgram(args) %endif %changelog +* Thu Nov 14 2024 Pan Xuefeng - 1:1.8.0.432.b06-1 +- update LoongArch port jdk8u432-b06 + * Tue Nov 07 2023 Leslie Zhai - 1:1.8.0.372.b07-2 - Change openjdk_revision - Drop jdk8275535-rh2053256-ldap_auth.patch