Re: sync rijndael-alg-fst.c with OpenBSD
Taylor R Campbell <[email protected]> Sat, 1 Oct 2016 20:13:19 +0000
| Newsgroups | gmane.os.netbsd.devel.crypto |
|---|---|
| Message-ID | <[email protected]> |
Date: Sat, 1 Oct 2016 20:26:18 +0100 From: Alexander Nasonov <[email protected]> If the goal is switching cgd to opencrypto, this is where all self-tests should be implemented. That was a goal a long time ago. It's not clear to me that opencrypto is the way to go, though -- opencrypto was designed for an era when hardware acceleration meant issuing asynchronous I/O requests over a PCI bus, not when hardware acceleration meant executing a CPU instruction. In any case, it should be easy to add a self-test to cgd_cipher_aes_init which panics if it fails. Failure means kernel memory or the CPU or something is screwy, so panicking is a reasonable course of action. This would be localized to cgd_crypto.c and require no API changes. I expect it should add at most a couple dozen lines of code, mainly for the test vector itself.