// Copyright 2012 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file.//go:build gc && !purego// +build gc,!puregopackage poly1305//go:noescapefunc ( *macState, []byte)// mac is a wrapper for macGeneric that redirects calls that would have gone to// updateGeneric to update.//// Its Write and Sum methods are otherwise identical to the macGeneric ones, but// using function pointers would carry a major performance cost.typemacstruct{ macGeneric }func ( *mac) ( []byte) (int, error) { := len()if .offset > 0 { := copy(.buffer[.offset:], )if .offset+ < TagSize { .offset += return , nil } = [:] .offset = 0update(&.macState, .buffer[:]) }if := len() - (len() % TagSize); > 0 {update(&.macState, [:]) = [:] }iflen() > 0 { .offset += copy(.buffer[.offset:], ) }return , nil}func ( *mac) ( *[16]byte) { := .macStateif .offset > 0 {update(&, .buffer[:.offset]) }finalize(, &.h, &.s)}
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.