aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / native / omega / allen / tests / tls-crypto-fixture.om
| 1 | note SPDX-License-Identifier: AGPL-3.0-or-later |
| 2 | note Shared fixture support, concatenate before exactly one tls-crypto-{sha,x25519,aead,poly}.om. |
| 3 | note RFC vectors: RFC4231 M.Nystrom (2005 Internet Society), RFC5869 H.Krawczyk/P.Eronen, |
| 4 | note RFC7748 A.Langley/M.Hamburg/S.Turner, RFC8439 Y.Nir/A.Langley. |
| 5 | note RFC5869/7748/8439 Copyright (c) 2010/2016/2018 IETF Trust and identified authors. |
| 6 | note All rights reserved. Source URLs are included in the individual fixtures. |
| 7 | note RFC Code Components carry the IETF Trust Simplified BSD License: |
| 8 | note Redistribution and use in source and binary forms, with or without modification, are |
| 9 | note permitted provided that the following conditions are met: |
| 10 | note 1. Redistributions of source code must retain the above copyright notice, this list of |
| 11 | note conditions and the following disclaimer. |
| 12 | note 2. Redistributions in binary form must reproduce the above copyright notice, this list of |
| 13 | note conditions and the following disclaimer in the documentation and/or other materials |
| 14 | note provided with the distribution. |
| 15 | note THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY |
| 16 | note EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
| 17 | note MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL |
| 18 | note THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 19 | note SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT |
| 20 | note OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
| 21 | note HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
| 22 | note OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 23 | note SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | note This harness is first-party Omega. No fixture executes external code or substitutes runtime bytes. |
| 25 | |
| 26 | fn tvcheck ok bool code int to void |
| 27 | if not ok |
| 28 | exit code |
| 29 | end |
| 30 | end |
| 31 | |
| 32 | fn tvnib c uchar to uchar |
| 33 | if and ge c 48 le c 57 |
| 34 | ret sub c 48 |
| 35 | end |
| 36 | if and ge c 97 le c 102 |
| 37 | ret sub c 87 |
| 38 | end |
| 39 | tvcheck false 99 |
| 40 | ret 0 |
| 41 | end |
| 42 | |
| 43 | fn tvbyte a uchar b uchar to uchar |
| 44 | ret or shl tvnib a 4 tvnib b |
| 45 | end |
| 46 | |
| 47 | fn tvscrub to void |
| 48 | for i ulong 8 |
| 49 | tvcheck eq get H i 0 91 |
| 50 | tvcheck eq get Vv i 0 91 |
| 51 | end |
| 52 | for i ulong 64 |
| 53 | tvcheck eq get W i 0 91 |
| 54 | tvcheck eq get Hb i 0 91 |
| 55 | tvcheck eq get Tccblk i 0 92 |
| 56 | end |
| 57 | for i ulong 32 |
| 58 | tvcheck eq get Tchi i 0 91 |
| 59 | tvcheck eq get Hash i 0 91 |
| 60 | tvcheck eq get Tcxsc i 0 93 |
| 61 | tvcheck eq get Tcxres i 0 93 |
| 62 | tvcheck eq get Tcxt i 0 93 |
| 63 | tvcheck eq get Tcmkey i 0 92 |
| 64 | end |
| 65 | for i ulong 176 |
| 66 | tvcheck eq get Tcxf i 0 93 |
| 67 | end |
| 68 | for i ulong 16 |
| 69 | tvcheck eq get Tccs i 0 92 |
| 70 | tvcheck eq get Tccw i 0 92 |
| 71 | tvcheck eq get Tcmblk i 0 92 |
| 72 | tvcheck eq get Tcmtag i 0 92 |
| 73 | end |
| 74 | for i ulong 10 |
| 75 | tvcheck eq get Tcmr i 0 92 |
| 76 | tvcheck eq get Tcmh i 0 92 |
| 77 | tvcheck eq get Tcmt i 0 92 |
| 78 | tvcheck eq get Tcmg i 0 92 |
| 79 | end |
| 80 | tvcheck eq get Hs 0 0 91 |
| 81 | tvcheck eq get Hs 1 0 91 |
| 82 | end |