Skip to content

Commit

Permalink
internal/chacha20: fix minor naming issue
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
laboger committed Nov 6, 2019
1 parent 057f033 commit de30f0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/chacha20/asm_ppc64le.s
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ DATA consts<>+0x90(SB)/8, $0x0000000100000000
DATA consts<>+0x98(SB)/8, $0x0000000300000002
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
MOVD out+0(FP), OUT
MOVD inp+8(FP), INP
MOVD len+16(FP), LEN
MOVD key+24(FP), KEY
MOVD cnt+32(FP), CNT
MOVD counter+32(FP), CNT

// Addressing for constants
MOVD $consts<>+0x00(SB), CONSTBASE
Expand Down
7 changes: 4 additions & 3 deletions internal/chacha20/chacha_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"encoding/binary"
)

var haveAsm = true

const bufSize = 256
const (
bufSize = 256
haveAsm = true
)

//go:noescape
func chaCha20_ctr32_vsx(out, inp *byte, len int, key *[8]uint32, counter *uint32)
Expand Down

0 comments on commit de30f0b

Please sign in to comment.