interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / aienux / allen / tests / tls-crypto-fixture.om

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