hkdfExpand computes the first 16 bytes of the HKDF-expand function defined in RFC5869.
(key, info []byte)
| 124 | // hkdfExpand computes the first 16 bytes of the HKDF-expand function |
| 125 | // defined in RFC5869. |
| 126 | func hkdfExpand(key, info []byte) []byte { |
| 127 | mac := hmac.New(sha256.New, key) |
| 128 | mac.Write(info) |
| 129 | mac.Write([]byte{0x01}[:]) |
| 130 | return mac.Sum(nil)[:aeadKeyLen] |
| 131 | } |