Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(399)

Delta Between Two Patch Sets: poly1305/sum_amd64.go

Issue 7319045: code review 7319045: go.crypto/{curve25519,poly1305,salsa20/salsa}: add //go... (Closed)
Left Patch Set: diff -r 75e869cbf335 https://code.google.com/p/go.crypto Created 11 years, 1 month ago
Right Patch Set: diff -r 75e869cbf335 https://code.google.com/p/go.crypto Created 11 years, 1 month ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « curve25519/mont25519_amd64.go ('k') | salsa20/salsa/salsa20_amd64.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 // Copyright 2012 The Go Authors. All rights reserved. 1 // Copyright 2012 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 // +build amd64,!gccgo 5 // +build amd64,!gccgo
6 6
7 package poly1305 7 package poly1305
8 8
9 // This function is implemented in poly1305_amd64.s 9 // This function is implemented in poly1305_amd64.s
10
10 //go:noescape 11 //go:noescape
12
11 func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte) 13 func poly1305(out *[16]byte, m *byte, mlen uint64, key *[32]byte)
12 14
13 // Sum generates an authenticator for m using a one-time key and puts the 15 // Sum generates an authenticator for m using a one-time key and puts the
14 // 16-byte result into out. Authenticating two different messages with the same 16 // 16-byte result into out. Authenticating two different messages with the same
15 // key allows an attacker to forge messages at will. 17 // key allows an attacker to forge messages at will.
16 func Sum(out *[16]byte, m []byte, key *[32]byte) { 18 func Sum(out *[16]byte, m []byte, key *[32]byte) {
17 var mPtr *byte 19 var mPtr *byte
18 if len(m) > 0 { 20 if len(m) > 0 {
19 mPtr = &m[0] 21 mPtr = &m[0]
20 } 22 }
21 poly1305(out, mPtr, uint64(len(m)), key) 23 poly1305(out, mPtr, uint64(len(m)), key)
22 } 24 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b