tpm2/create_salt.go
raw| 1 | package tpm2 |
| 2 | |
| 3 | import "io" |
| 4 | |
| 5 | var ( |
| 6 | labelSecret = "SECRET" |
| 7 | ) |
| 8 | |
| 9 | // CreateEncryptedSalt encrypts a random salt for secure session establishment. |
| 10 | func CreateEncryptedSalt(rand io.Reader, pub LabeledEncapsulationKey) (salt []byte, encSecret []byte, err error) { |
| 11 | // The salt value is directly used from the Labeled Key Encapsulation operation. |
| 12 | // See Part 1, "Salted and Bound Session Key Generation" |
| 13 | return pub.Encapsulate(rand, labelSecret) |
| 14 | } |