encryptDeterministic encrypts bytes using AES-SIV
(data []byte, key *[keySize]byte, additionalData []byte)
| 458 | |
| 459 | // encryptDeterministic encrypts bytes using AES-SIV |
| 460 | func encryptDeterministic(data []byte, key *[keySize]byte, additionalData []byte) []byte { |
| 461 | aead, err := miscreant.NewAEAD(miscreantAlgo, key[:], 0) |
| 462 | if err != nil { |
| 463 | panic("cipher failure: " + err.Error()) |
| 464 | } |
| 465 | return aead.Seal(nil, nil, data, additionalData) |
| 466 | } |
| 467 | |
| 468 | // decryptDeterministic decrypts bytes using AES-SIV |
| 469 | func decryptDeterministic(data []byte, key *[keySize]byte, additionalData []byte) ([]byte, error) { |