mirror of
https://github.com/emmansun/gmsm.git
synced 2025-04-26 20:26:19 +08:00
MAGIC - add license
This commit is contained in:
parent
85b3ecb129
commit
513b786694
@ -127,8 +127,8 @@ func (c *ccm) auth(nonce, plaintext, additionalData []byte, tagMask *[ccmBlockSi
|
||||
if len(additionalData) > 0 {
|
||||
out[0] = 1 << 6 // 64*Adata
|
||||
}
|
||||
out[0] |= byte(c.tagSize-2) << 2
|
||||
out[0] |= byte(14 - c.nonceSize)
|
||||
out[0] |= byte(c.tagSize-2) << 2 // M' = ((tagSize - 2) / 2)*8
|
||||
out[0] |= byte(14 - c.nonceSize) // L'
|
||||
binary.BigEndian.PutUint64(out[ccmBlockSize-8:], uint64(len(plaintext)))
|
||||
copy(out[1:], nonce)
|
||||
c.cipher.Encrypt(out[:], out[:])
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
// https://tools.ietf.org/html/rfc3610, 8. Test Vectors
|
||||
var aesCCMTests = []struct {
|
||||
key, nonce, plaintext, ad, result string
|
||||
tagSize int
|
||||
|
@ -1,3 +1,7 @@
|
||||
// Copyright 2018 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.
|
||||
|
||||
package cipher
|
||||
|
||||
// XorBytes xors the bytes in a and b. The destination should have enough
|
||||
|
@ -1,3 +1,7 @@
|
||||
// Copyright 2018 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.
|
||||
|
||||
#include "textflag.h"
|
||||
|
||||
// func xorBytesSSE2(dst, a, b *byte, n int)
|
||||
|
@ -1,3 +1,7 @@
|
||||
// Copyright 2013 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.
|
||||
|
||||
// +build !amd64
|
||||
|
||||
package cipher
|
||||
|
Loading…
x
Reference in New Issue
Block a user