Re: Request for review of JDK-8251548

2020-09-20 Thread David Holmes

On 18/09/2020 5:15 pm, Сергей Цыпанов wrote:

Hi,


Did you not follow these instructions to get your github account
connected to your OCA record:


Those are for "OpenJDK Author, Committer or Reviewer", but I'm only a 
contributor,
i.e. I cannot file an issue or commit directly. My previous contributions were 
shipped as *.patch
files in mail attachments.


Ah sorry I overlooked that bit.


Anyway, OCA was approved again and the PR 
(https://github.com/openjdk/jdk/pull/218) is ready for review :)


It wasn't necessary to re-do the OCA, but glad it is now sorted.

David
-


Cheers,
Sergey

17.09.2020, 14:11, "David Holmes" :

On 17/09/2020 7:24 pm, Сергей Цыпанов wrote:

  Hi David,

  thanks for pointing this out!

  I've created a PR there [1], but GitHub for some reason wants me to sign OCA,
  which I have already signed in 2017. I've redone the procedure and now I'm 
waiting
  for verification.


Did you not follow these instructions to get your github account
connected to your OCA record:

"If you already are an OpenJDK Author, Committer or Reviewer, please
click here[1] to open a new issue so that we can record that fact.
Please use "Add GitHub user stsypanov" as summary for the issue."

[1]
https://bugs.openjdk.java.net/secure/CreateIssue.jspa?pid=11300&issuetype=1

Cheers,
David
-


  Regards,
  Sergey

  1. https://github.com/openjdk/jdk/pull/218

  17.09.2020, 09:22, "David Holmes" :

  Hi Sergey,

  Since OpenJDK has moved to git/github, this needs to reformulated as a
  Pull Request (PR).

  Cheers,
  David

  On 17/09/2020 5:19 pm, Сергей Цыпанов wrote:

    Hello,

    is it possible to have a code review for the changes proposed in 
JDK-8251548?

    Sean Mullan has created an issue and web-review and can sponsor the patch
    as soos as it gets properly reviewed.

    As Doug Lea claims in 
http://cs.oswego.edu/pipermail/concurrency-interest/2015-December/014770.html


    there is never any reason to explicitly initialize fields to 
0/0.0/false/null


    so I believe the patch is harmless.

    Issue: https://bugs.openjdk.java.net/browse/JDK-8251548
    Webrev: https://cr.openjdk.java.net/~mullan/webrevs/8251548/

    Thanks,
    Sergey Tsypanov


Re: RFR: 8252523: Add ASN1 Formatter to work with HexPrinter [v2]

2020-09-20 Thread Roger Riggs
> # JDK-8252523: Add ASN.1 Formatter to work with test utility HexPrinter
> 
> Debugging functions that utilize ASN.1, DER, and BER encoded streams is
> difficult without test utilities to show the contents.
> The ASN.1 formatter reads a stream and produces annotated output of the
> tags, values, and structures.
> When used with the test library jdk.test.lib.hexdump.HexPrinter the 
> annotations are synchronized
> with the hex formatted output.
> 
> Small changes to HexPrinter are included to improve the output readability.
> 
> 
> Example decoding of a .pem certificate:
> SEQUENCE [910]
>   SEQUENCE [630]
> CONTEXT cons 0 [3]
>   BYTE 2,
> BYTE 3,
> SEQUENCE [13]
>   OBJECT ID  [9] 1.2.840.113549.1.1.11 (SHA256withRSA)
>   NULL
> SEQUENCE [76]
>   SET [11]
> SEQUENCE [9]
>   OBJECT ID  [3] 2.5.4.6 (CountryName)
>   'IN'
>   ...
>   SET [16]
> SEQUENCE [14]
>   OBJECT ID  [3] 2.5.4.3 (CommonName)
>   Client1
> SEQUENCE [30]
>   UTCTIME  [13] '150526221718Z'
>   UTCTIME  [13] '250523221718Z'
> ...
> SEQUENCE [290]
>   SEQUENCE [13]
> OBJECT ID  [9] 1.2.840.113549.1.1.1 (RSA)
> NULL
>   BIT STRING  [271]
>   CONTEXT cons 3 [123]
> SEQUENCE [121]
>   SEQUENCE [9]
> OBJECT ID  [3] 2.5.29.19 (BasicConstraints)
> OCTET STRING  [2] 
>   SEQUENCE [44]
> OBJECT ID  [9] 2.16.840.1.113730.1.13
> OCTET STRING  [31] '..OpenSSL Generated Certificate'
>   SEQUENCE [29]
> OBJECT ID  [3] 2.5.29.14 (SubjectKeyID)
> OCTET STRING  [22] 
>   SEQUENCE [31]
> OBJECT ID  [3] 2.5.29.35 (AuthorityKeyID)
> OCTET STRING  [24] 
>   SEQUENCE [13]
> OBJECT ID  [9] 1.2.840.113549.1.1.11 (SHA256withRSA)
> NULL
>   BIT STRING  [257]
> When used with the HexPrinter test utility, the formatting of the
> hexadecimal values is selected with the parameters to HexPrinter.
> 
> : 30 82 03 8e ; SEQUENCE [910]
> 0004: 30 82 02 76 ;   SEQUENCE [630]
> 0008: a0 03   ; CONTEXT cons 
> 0 [3]
> 000a:   02 01 02  ;   BYTE 2,
> 000d:02 01 03 ; BYTE 3,
> 0010: 30 0d   ; SEQUENCE [13]
> 0012:   06 09 2a 86 48 86 f7 0d 01 01 0b  ;   OBJECT ID  
> [9] 1.2.840.113549.1.1.11 (SHA256withRSA)
> 001d:05 00;   NULL
> 001f:  30 ; SEQUENCE [76]
> 0020: 4c  ;
> 0021:31 0b;   SET [11]
> 0023:  30 09  ; SEQUENCE 
> [9]
> 0025:06 03 55 04 06   ;   OBJECT 
> ID  [3] 2.5.4.6 (CountryName)
> 002a:   13 02 49 4e   ;   'IN'
> 
> ...   ...
> 
> 005b:  31 10  ;   SET [16]
> 005d:30 0e; SEQUENCE 
> [14]
> 005f:  06 ;   OBJECT 
> ID  [3] 2.5.4.3 (CommonName)
> 0060: 03 55 04 03 ;
> 0064: 0c 07 43 6c 69 65 6e 74 31  ;   Client1
> 006d:30 1e; SEQUENCE [30]
> 006f:  17 ;   UTCTIME  
> [13] '150526221718Z'
> 0070: 0d 31 35 30 35 32 36 32 32 31 37 31 38 5a   ;
> 007e:   17 0d ;   UTCTIME  
> [13] '250523221718Z'
> 0080: 32 35 30 35 32 33 32 32 31 37 31 38 5a  ;
> 
> ... ...
> 
> 00db:  30 82 01 22; SEQUENCE [290]
> 00df:  30 ;   SEQUENCE 
> [13]
> 00e0: 0d  ;
> 00e1:06 09 2a 86 48 86 f7 0d 01 01 01 ; OBJECT ID 
>  [9] 1.2.840.113549.1.1.1 (RSA)
> 00ec: 05 00   ; NULL
> 00ee:   03 82 ;   BIT STRING  
> [271]
> 00f0: 01 0f 00 30 82 01 0a 02 82 01 01 00 d8 70 03 54 ;
> 
> ...
> 
> 01f0: 0a 2d f5 de 59 3e d9 5e 74 93 d2 45 02 03 01 00 ;
> 0200: 01  ;
> 0201:a3 7b; 

RFR: 8252523: Add ASN1 Formatter to work with HexPrinter

2020-09-20 Thread Roger Riggs
# JDK-8252523: Add ASN.1 Formatter to work with test utility HexPrinter

Debugging functions that utilize ASN.1, DER, and BER encoded streams is
difficult without test utilities to show the contents.
The ASN.1 formatter reads a stream and produces annotated output of the
tags, values, and structures.
When used with the test library jdk.test.lib.hexdump.HexPrinter the annotations 
are synchronized
with the hex formatted output.

Small changes to HexPrinter are included to improve the output readability.


Example decoding of a .pem certificate:
SEQUENCE [910]
  SEQUENCE [630]
CONTEXT cons 0 [3]
  BYTE 2,
BYTE 3,
SEQUENCE [13]
  OBJECT ID  [9] 1.2.840.113549.1.1.11 (SHA256withRSA)
  NULL
SEQUENCE [76]
  SET [11]
SEQUENCE [9]
  OBJECT ID  [3] 2.5.4.6 (CountryName)
  'IN'
  ...
  SET [16]
SEQUENCE [14]
  OBJECT ID  [3] 2.5.4.3 (CommonName)
  Client1
SEQUENCE [30]
  UTCTIME  [13] '150526221718Z'
  UTCTIME  [13] '250523221718Z'
...
SEQUENCE [290]
  SEQUENCE [13]
OBJECT ID  [9] 1.2.840.113549.1.1.1 (RSA)
NULL
  BIT STRING  [271]
  CONTEXT cons 3 [123]
SEQUENCE [121]
  SEQUENCE [9]
OBJECT ID  [3] 2.5.29.19 (BasicConstraints)
OCTET STRING  [2] 
  SEQUENCE [44]
OBJECT ID  [9] 2.16.840.1.113730.1.13
OCTET STRING  [31] '..OpenSSL Generated Certificate'
  SEQUENCE [29]
OBJECT ID  [3] 2.5.29.14 (SubjectKeyID)
OCTET STRING  [22] 
  SEQUENCE [31]
OBJECT ID  [3] 2.5.29.35 (AuthorityKeyID)
OCTET STRING  [24] 
  SEQUENCE [13]
OBJECT ID  [9] 1.2.840.113549.1.1.11 (SHA256withRSA)
NULL
  BIT STRING  [257]
When used with the HexPrinter test utility, the formatting of the
hexadecimal values is selected with the parameters to HexPrinter.

: 30 82 03 8e ; SEQUENCE [910]
0004: 30 82 02 76 ;   SEQUENCE [630]
0008: a0 03   ; CONTEXT cons 0 
[3]
000a:   02 01 02  ;   BYTE 2,
000d:02 01 03 ; BYTE 3,
0010: 30 0d   ; SEQUENCE [13]
0012:   06 09 2a 86 48 86 f7 0d 01 01 0b  ;   OBJECT ID  
[9] 1.2.840.113549.1.1.11 (SHA256withRSA)
001d:05 00;   NULL
001f:  30 ; SEQUENCE [76]
0020: 4c  ;
0021:31 0b;   SET [11]
0023:  30 09  ; SEQUENCE [9]
0025:06 03 55 04 06   ;   OBJECT ID 
 [3] 2.5.4.6 (CountryName)
002a:   13 02 49 4e   ;   'IN'

...   ...

005b:  31 10  ;   SET [16]
005d:30 0e; SEQUENCE 
[14]
005f:  06 ;   OBJECT ID 
 [3] 2.5.4.3 (CommonName)
0060: 03 55 04 03 ;
0064: 0c 07 43 6c 69 65 6e 74 31  ;   Client1
006d:30 1e; SEQUENCE [30]
006f:  17 ;   UTCTIME  [13] 
'150526221718Z'
0070: 0d 31 35 30 35 32 36 32 32 31 37 31 38 5a   ;
007e:   17 0d ;   UTCTIME  [13] 
'250523221718Z'
0080: 32 35 30 35 32 33 32 32 31 37 31 38 5a  ;

... ...

00db:  30 82 01 22; SEQUENCE [290]
00df:  30 ;   SEQUENCE [13]
00e0: 0d  ;
00e1:06 09 2a 86 48 86 f7 0d 01 01 01 ; OBJECT ID  
[9] 1.2.840.113549.1.1.1 (RSA)
00ec: 05 00   ; NULL
00ee:   03 82 ;   BIT STRING  
[271]
00f0: 01 0f 00 30 82 01 0a 02 82 01 01 00 d8 70 03 54 ;

...

01f0: 0a 2d f5 de 59 3e d9 5e 74 93 d2 45 02 03 01 00 ;
0200: 01  ;
0201:a3 7b;   CONTEXT cons 
3 [123]
0203:  30 79  ; SEQUENCE 
[121]
0205:30 09;   SEQUENCE 
[9]
0207:  06 03 5

Re: RFR: 8252204: AArch64: Implement SHA3 accelerator/intrinsic [v4]

2020-09-20 Thread Fei Yang
> Contributed-by: ard.biesheu...@linaro.org, dong...@huawei.com
> 
> This added an intrinsic for SHA3 using aarch64 v8.2 SHA3 Crypto Extensions.
> Reference implementation for core SHA-3 transform using ARMv8.2 Crypto 
> Extensions:
> https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/arch/arm64/crypto/sha3-ce-core.S?h=v5.4.52
> 
> Trivial adaptation in SHA3. implCompress is needed for the purpose of adding 
> the intrinsic.
> For SHA3, we need to pass one extra parameter "digestLength" to the stub for 
> the calculation of block size.
> "digestLength" is also used in for the EOR loop before keccak to 
> differentiate different SHA3 variants.
> 
> We added jtreg tests for SHA3 and used QEMU system emulator which supports 
> SHA3 instructions to test the functionality.
> Patch passed jtreg tier1-3 tests with QEMU system emulator.
> Also verified with jtreg tier1-3 tests without SHA3 instructions on 
> aarch64-linux-gnu and x86_64-linux-gnu, to make
> sure that there's no regression.
> We used one existing JMH test for performance test: 
> test/micro/org/openjdk/bench/java/security/MessageDigests.java
> We measured the performance benefit with an aarch64 cycle-accurate simulator.
> Patch delivers 20% - 40% performance improvement depending on specific SHA3 
> digest length and size of the message.
> 
> For now, this feature will not be enabled automatically for aarch64. We can 
> auto-enable this when it is fully tested on
> real hardware.  But for the above testing purposes, this is auto-enabled when 
> the corresponding hardware feature is
> detected.

Fei Yang has updated the pull request incrementally with one additional commit 
since the last revision:

  Add sha3 instructions to cpu/aarch64/aarch64-asmtest.py and regenerate the 
test in assembler_aarch64.cpp:asm_check

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/207/files
  - new: https://git.openjdk.java.net/jdk/pull/207/files/3e155193..04bdb42e

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=207&range=03
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=207&range=02-03

  Stats: 474 lines in 2 files changed: 61 ins; 9 del; 404 mod
  Patch: https://git.openjdk.java.net/jdk/pull/207.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/207/head:pull/207

PR: https://git.openjdk.java.net/jdk/pull/207