Sync aesp8-ppc.pl with upstream.

This pulls in the following commits from upstream:
5dcfd6c50a216f81bf43e1f21bc5f3fc517ba47a,
41013cd63c068e2f271fabc92702ee67d800f0cb,
83cf7abf8e9abbd4d0b68c63dc1cb43374aafe63, and
13f6857db107b1b6f68daa7fc4a6dd1293428bb1. Of these, the first fixes a bug:

commit 5dcfd6c50a216f81bf43e1f21bc5f3fc517ba47a
Author: Daniel Axtens <dja@axtens.net>
Date:   Mon Mar 18 10:22:44 2019 +1100

    PPC assembly pack: fix copy-paste error in CTR mode

    There are two copy-paste errors in handling CTR mode. When dealing
    with a 2 or 3 block tail, the code branches to the CBC decryption exit
    path, rather than to the CTR exit path.

    This can lead to data corruption: in the Linux kernel we have a copy
    of this file, and the bug leads to corruption of the IV, which leads
    to data corruption when we call the encryption function again later to
    encrypt subsequent blocks.

    Originally reported to the Linux kernel by Ondrej Mosnáček <omosnacek@gmail.com>

This bug does not appear to have practical impact the way the function is used
in BoringSSL/OpenSSL. Unlike the CBC functions, the CTR32 functions do not
update the IV, which is the only difference between their epilogs. However, all
the callers either use a temporary buffer for the IV or clobber the counter
portion of the IV with an updated value anyway. (Confirmed that
CipherTest.TestVectors hits this case with AES-GCM and that the clobbered IV
matches in all but the counter portion.)

Change-Id: I25b781152c578155e0bcb0ee1c6d967e9e8cea88
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/36104
Commit-Queue: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/fipsmodule/aes/asm/aesp8-ppc.pl b/crypto/fipsmodule/aes/asm/aesp8-ppc.pl
index 7f06720..62d4842 100644
--- a/crypto/fipsmodule/aes/asm/aesp8-ppc.pl
+++ b/crypto/fipsmodule/aes/asm/aesp8-ppc.pl
@@ -1,5 +1,5 @@
 #! /usr/bin/env perl
-# Copyright 2014-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2014-2018 The OpenSSL Project Authors. All Rights Reserved.
 #
 # Licensed under the OpenSSL license (the "License").  You may not use
 # this file except in compliance with the License.  You can obtain a copy
@@ -40,6 +40,8 @@
 #		CBC en-/decrypt	CTR	XTS
 # POWER8[le]	3.96/0.72	0.74	1.1
 # POWER8[be]	3.75/0.65	0.66	1.0
+# POWER9[le]	4.02/0.86	0.84	1.05
+# POWER9[be]	3.99/0.78	0.79	0.97
 
 $flavour = shift;
 
@@ -1827,7 +1829,7 @@
 	stvx_u		$out1,$x10,$out
 	stvx_u		$out2,$x20,$out
 	addi		$out,$out,0x30
-	b		Lcbc_dec8x_done
+	b		Lctr32_enc8x_done
 
 .align	5
 Lctr32_enc8x_two:
@@ -1839,7 +1841,7 @@
 	stvx_u		$out0,$x00,$out
 	stvx_u		$out1,$x10,$out
 	addi		$out,$out,0x20
-	b		Lcbc_dec8x_done
+	b		Lctr32_enc8x_done
 
 .align	5
 Lctr32_enc8x_one: