internal/chacha20: fix minor naming issue

This corrects a compile error due to a mismatch between function
description and the assembler code that first appeared when running
TryBots on the change to vendor this code. This fixes that problem
and adds and minor change based on a comment in CL 195959.

Change-Id: I42cbd3f75e281913f12f74850deaedf14eb21989
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/205659
Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
Lynn Boger
2019-11-06 20:26:28 +00:00
parent c7e5f84aec
commit ed6320f186
2 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -72,13 +72,13 @@ DATA consts<>+0x90(SB)/8, $0x0000000100000000
DATA consts<>+0x98(SB)/8, $0x0000000300000002 DATA consts<>+0x98(SB)/8, $0x0000000300000002
GLOBL consts<>(SB), RODATA, $0xa0 GLOBL consts<>(SB), RODATA, $0xa0
//func chaCha20_ctr32_vsx(out, inp []byte, len int, key *[32]byte, counter *[16]byte) //func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32)
TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40 TEXT ·chaCha20_ctr32_vsx(SB),NOSPLIT,$64-40
MOVD out+0(FP), OUT MOVD out+0(FP), OUT
MOVD inp+8(FP), INP MOVD inp+8(FP), INP
MOVD len+16(FP), LEN MOVD len+16(FP), LEN
MOVD key+24(FP), KEY MOVD key+24(FP), KEY
MOVD cnt+32(FP), CNT MOVD counter+32(FP), CNT
// Addressing for constants // Addressing for constants
MOVD $consts<>+0x00(SB), CONSTBASE MOVD $consts<>+0x00(SB), CONSTBASE
+4 -3
View File
@@ -10,9 +10,10 @@ import (
"encoding/binary" "encoding/binary"
) )
var haveAsm = true const (
bufSize = 256
const bufSize = 256 haveAsm = true
)
//go:noescape //go:noescape
func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32) func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32)