WIP [VOL-2811] - Incorporate preliminary onu-adapter-go code into opencord repo

- reason "discovery-mibsync-complete" reached (via full MibUpload only, received data won't be stored yet)
- first review comments of patchset #4 considered
 (please have a look into our inline-comments in Gerrit to know more about the current state)
- no refactoring done yet

Change-Id: Iac47817f8ce4bd28dd8132f530b0570d57ae99b8
Signed-off-by: Holger Hildebrandt <holger.hildebrandt@adtran.com>
diff --git a/vendor/github.com/aead/cmac/aes/aes-cmac.go b/vendor/github.com/aead/cmac/aes/aes-cmac.go
new file mode 100644
index 0000000..5ca3c6c
--- /dev/null
+++ b/vendor/github.com/aead/cmac/aes/aes-cmac.go
@@ -0,0 +1,49 @@
+// Copyright (c) 2016 Andreas Auernhammer. All rights reserved.
+// Use of this source code is governed by a license that can be
+// found in the LICENSE file.
+
+// Package aes implements the CMAC MAC with the AES.
+// AES-CMAC is specified in RFC 4493 and RFC 4494.
+package aes // import "github.com/aead/cmac/aes"
+
+import (
+	aesCipher "crypto/aes"
+	"hash"
+
+	"github.com/aead/cmac"
+)
+
+// Sum computes the AES-CMAC checksum with the given tagsize of msg using the cipher.Block.
+func Sum(msg, key []byte, tagsize int) ([]byte, error) {
+	c, err := aesCipher.NewCipher(key)
+	if err != nil {
+		return nil, err
+	}
+	return cmac.Sum(msg, c, tagsize)
+}
+
+// Verify computes the AES-CMAC checksum with the given tagsize of msg and compares
+// it with the given mac. This functions returns true if and only if the given mac
+// is equal to the computed one.
+func Verify(mac, msg, key []byte, tagsize int) bool {
+	c, err := aesCipher.NewCipher(key)
+	if err != nil {
+		return false
+	}
+	return cmac.Verify(mac, msg, c, tagsize)
+}
+
+// New returns a hash.Hash computing the AES-CMAC checksum.
+func New(key []byte) (hash.Hash, error) {
+	return NewWithTagSize(key, aesCipher.BlockSize)
+}
+
+// NewWithTagSize returns a hash.Hash computing the AES-CMAC checksum with the
+// given tag size. The tag size must between the 1 and the cipher's block size.
+func NewWithTagSize(key []byte, tagsize int) (hash.Hash, error) {
+	c, err := aesCipher.NewCipher(key)
+	if err != nil {
+		return nil, err
+	}
+	return cmac.NewWithTagSize(c, tagsize)
+}