jets: fix urcrypt jets to build with current interpreter, add sha and ed to hot state

This commit is contained in:
Edward Amsden 2023-11-09 22:46:22 -06:00
parent dc07e21f18
commit e4ab772998
10 changed files with 292 additions and 242 deletions

291
rust/ares/Cargo.lock generated
View File

@ -2,6 +2,15 @@
# It is not intended for manual editing.
version = 3
[[package]]
name = "aho-corasick"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
dependencies = [
"memchr",
]
[[package]]
name = "anes"
version = "0.1.6"
@ -38,7 +47,7 @@ name = "ares_macros"
version = "0.1.0"
dependencies = [
"quote",
"syn 1.0.98",
"syn 1.0.109",
]
[[package]]
@ -53,7 +62,7 @@ version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi 0.1.19",
"hermit-abi",
"libc",
"winapi",
]
@ -79,7 +88,7 @@ version = "0.68.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "726e4313eb6ec35d2730258ad4e15b547ee75d6afaa1361a922e78e59b7d8078"
dependencies = [
"bitflags 2.4.0",
"bitflags 2.4.1",
"cexpr",
"clang-sys",
"lazy_static",
@ -92,7 +101,7 @@ dependencies = [
"regex",
"rustc-hash",
"shlex",
"syn 2.0.37",
"syn 2.0.39",
"which",
]
@ -104,15 +113,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.4.0"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635"
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
[[package]]
name = "bitvec"
version = "1.0.0"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1489fcb93a5bb47da0462ca93ad252ad6af2145cce58d10d46a83931ba9f016b"
checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c"
dependencies = [
"funty",
"radium",
@ -122,9 +131,9 @@ dependencies = [
[[package]]
name = "bumpalo"
version = "3.12.0"
version = "3.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535"
checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
[[package]]
name = "cast"
@ -134,9 +143,12 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5"
[[package]]
name = "cc"
version = "1.0.79"
version = "1.0.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0"
dependencies = [
"libc",
]
[[package]]
name = "cexpr"
@ -155,9 +167,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]]
name = "ciborium"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f"
checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926"
dependencies = [
"ciborium-io",
"ciborium-ll",
@ -166,15 +178,15 @@ dependencies = [
[[package]]
name = "ciborium-io"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369"
checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656"
[[package]]
name = "ciborium-ll"
version = "0.2.0"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b"
checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b"
dependencies = [
"ciborium-io",
"half",
@ -193,9 +205,9 @@ dependencies = [
[[package]]
name = "clap"
version = "3.2.23"
version = "3.2.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5"
checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123"
dependencies = [
"bitflags 1.3.2",
"clap_lex",
@ -248,21 +260,11 @@ dependencies = [
"itertools",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521"
dependencies = [
"cfg-if",
"crossbeam-utils",
]
[[package]]
name = "crossbeam-deque"
version = "0.8.2"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc"
checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef"
dependencies = [
"cfg-if",
"crossbeam-epoch",
@ -271,9 +273,9 @@ dependencies = [
[[package]]
name = "crossbeam-epoch"
version = "0.9.13"
version = "0.9.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "01a9af1f4c2ef74bb8aa1f7e19706bc72d03598c8a570bb5de72243c7a9d9d5a"
checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7"
dependencies = [
"autocfg",
"cfg-if",
@ -284,9 +286,9 @@ dependencies = [
[[package]]
name = "crossbeam-utils"
version = "0.8.14"
version = "0.8.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f"
checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294"
dependencies = [
"cfg-if",
]
@ -299,25 +301,14 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
[[package]]
name = "errno"
version = "0.3.3"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd"
checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e"
dependencies = [
"errno-dragonfly",
"libc",
"windows-sys",
]
[[package]]
name = "errno-dragonfly"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
dependencies = [
"cc",
"libc",
]
[[package]]
name = "funty"
version = "2.0.0"
@ -351,15 +342,6 @@ dependencies = [
"libc",
]
[[package]]
name = "hermit-abi"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
dependencies = [
"libc",
]
[[package]]
name = "home"
version = "0.5.5"
@ -381,9 +363,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "1.9.2"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
@ -406,15 +388,15 @@ dependencies = [
[[package]]
name = "itoa"
version = "1.0.5"
version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
[[package]]
name = "js-sys"
version = "0.3.60"
version = "0.3.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8"
dependencies = [
"wasm-bindgen",
]
@ -439,9 +421,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
version = "0.2.148"
version = "0.2.150"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
[[package]]
name = "libloading"
@ -455,24 +437,21 @@ dependencies = [
[[package]]
name = "linux-raw-sys"
version = "0.4.7"
version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"
checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829"
[[package]]
name = "log"
version = "0.4.17"
version = "0.4.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
"cfg-if",
]
checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
[[package]]
name = "memchr"
version = "2.6.3"
version = "2.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c"
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
[[package]]
name = "memmap"
@ -486,9 +465,9 @@ dependencies = [
[[package]]
name = "memoffset"
version = "0.7.1"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4"
checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c"
dependencies = [
"autocfg",
]
@ -522,33 +501,23 @@ checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.98",
"syn 1.0.109",
]
[[package]]
name = "num-traits"
version = "0.2.16"
version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2"
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
dependencies = [
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
dependencies = [
"hermit-abi 0.2.6",
"libc",
]
[[package]]
name = "once_cell"
version = "1.17.0"
version = "1.18.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66"
checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
[[package]]
name = "oorandom"
@ -558,9 +527,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
[[package]]
name = "os_str_bytes"
version = "6.4.1"
version = "6.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee"
checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1"
[[package]]
name = "peeking_take_while"
@ -576,9 +545,9 @@ checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964"
[[package]]
name = "plotters"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97"
checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45"
dependencies = [
"num-traits",
"plotters-backend",
@ -589,15 +558,15 @@ dependencies = [
[[package]]
name = "plotters-backend"
version = "0.3.4"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142"
checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609"
[[package]]
name = "plotters-svg"
version = "0.3.3"
version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f"
checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab"
dependencies = [
"plotters-backend",
]
@ -609,14 +578,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d"
dependencies = [
"proc-macro2",
"syn 2.0.37",
"syn 2.0.39",
]
[[package]]
name = "proc-macro2"
version = "1.0.67"
version = "1.0.69"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328"
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
dependencies = [
"unicode-ident",
]
@ -653,9 +622,9 @@ checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
[[package]]
name = "rayon"
version = "1.6.1"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6db3a213adf02b3bcfd2d3846bb41cb22857d131789e01df434fb7e7bc0759b7"
checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1"
dependencies = [
"either",
"rayon-core",
@ -663,30 +632,42 @@ dependencies = [
[[package]]
name = "rayon-core"
version = "1.10.2"
version = "1.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "356a0625f1954f730c0201cdab48611198dc6ce21f4acff55089b5a78e6e835b"
checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed"
dependencies = [
"crossbeam-channel",
"crossbeam-deque",
"crossbeam-utils",
"num_cpus",
]
[[package]]
name = "regex"
version = "1.7.1"
version = "1.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733"
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.6.28"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848"
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "rustc-hash"
@ -696,11 +677,11 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustix"
version = "0.38.14"
version = "0.38.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f"
checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3"
dependencies = [
"bitflags 2.4.0",
"bitflags 2.4.1",
"errno",
"libc",
"linux-raw-sys",
@ -709,9 +690,9 @@ dependencies = [
[[package]]
name = "ryu"
version = "1.0.12"
version = "1.0.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
[[package]]
name = "same-file"
@ -724,35 +705,35 @@ dependencies = [
[[package]]
name = "scopeguard"
version = "1.1.0"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
[[package]]
name = "serde"
version = "1.0.147"
version = "1.0.192"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"
checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
version = "1.0.147"
version = "1.0.192"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852"
checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.98",
"syn 2.0.39",
]
[[package]]
name = "serde_json"
version = "1.0.91"
version = "1.0.108"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883"
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
dependencies = [
"itoa",
"ryu",
@ -785,7 +766,6 @@ dependencies = [
]
[[package]]
>>>>>>> status
name = "static_assertions"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@ -793,9 +773,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]]
name = "syn"
version = "1.0.98"
version = "1.0.109"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd"
checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
dependencies = [
"proc-macro2",
"quote",
@ -804,9 +784,9 @@ dependencies = [
[[package]]
name = "syn"
version = "2.0.37"
version = "2.0.39"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8"
checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a"
dependencies = [
"proc-macro2",
"quote",
@ -837,15 +817,13 @@ dependencies = [
[[package]]
name = "unicode-ident"
version = "1.0.1"
version = "1.0.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c"
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
[[package]]
name = "urcrypt-sys"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6d606218c5f9c049898a879b9e7ee8efa8622bba56585e1a7651dc0b31273d25"
dependencies = [
"bindgen",
"pkg-config",
@ -853,20 +831,19 @@ dependencies = [
[[package]]
name = "walkdir"
version = "2.3.2"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee"
dependencies = [
"same-file",
"winapi",
"winapi-util",
]
[[package]]
name = "wasm-bindgen"
version = "0.2.83"
version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce"
dependencies = [
"cfg-if",
"wasm-bindgen-macro",
@ -874,24 +851,24 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
version = "0.2.83"
version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217"
dependencies = [
"bumpalo",
"log",
"once_cell",
"proc-macro2",
"quote",
"syn 1.0.98",
"syn 2.0.39",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-macro"
version = "0.2.83"
version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@ -899,28 +876,28 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.83"
version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.98",
"syn 2.0.39",
"wasm-bindgen-backend",
"wasm-bindgen-shared",
]
[[package]]
name = "wasm-bindgen-shared"
version = "0.2.83"
version = "0.2.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"
checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b"
[[package]]
name = "web-sys"
version = "0.3.60"
version = "0.3.65"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85"
dependencies = [
"js-sys",
"wasm-bindgen",
@ -956,9 +933,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.5"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
dependencies = [
"winapi",
]
@ -1037,9 +1014,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
[[package]]
name = "wyz"
version = "0.5.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30b31594f29d27036c383b53b59ed3476874d518f0efb151b27a4c275141390e"
checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed"
dependencies = [
"tap",
]

View File

@ -13,7 +13,8 @@ edition = "2018"
[dependencies]
ares_macros = { path = "../ares_macros" }
assert_no_alloc = "1.1.2"
urcrypt-sys = "0.1.0"
#urcrypt-sys = "0.1.0"
urcrypt-sys = { path = "../../../urcrypt-sys" }
# use this when debugging requires allocation (e.g. eprintln)
# assert_no_alloc = {version="1.1.2", features=["warn_debug"]}
bitvec = "1.0.0"

View File

@ -208,6 +208,16 @@ const TRUE_HOT_STATE: &[(&[Either<&[u8], (u64, u64)>], u64, Jet)] = &[
jet_jam,
),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"shal")], 1, jet_shal ),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"sha1")], 1, jet_sha1 ),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"shas")], 1, jet_shas ),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"shax")], 1, jet_shax ),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"shay")], 1, jet_shay ),
//
(
&[
K_139,
@ -358,6 +368,14 @@ const TRUE_HOT_STATE: &[(&[Either<&[u8], (u64, u64)>], u64, Jet)] = &[
1,
jet_ut_rest,
),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"qua"), Left(b"pen"), Left(b"hex"), Left(b"coed"), Left(b"ed"), Left(b"sign")], 1, jet_sign),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"qua"), Left(b"pen"), Left(b"hex"), Left(b"coed"), Left(b"ed"), Left(b"veri")], 1, jet_veri),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"qua"), Left(b"pen"), Left(b"hex"), Left(b"coed"), Left(b"ed"), Left(b"shar")], 1, jet_shar),
//
( &[K_139, Left(b"one"), Left(b"two"), Left(b"tri"), Left(b"qua"), Left(b"pen"), Left(b"hex"), Left(b"coed"), Left(b"ed"), Left(b"puck")], 1, jet_puck),
];
#[derive(Copy, Clone)]

View File

@ -1,23 +1,23 @@
use crate::jets::util::{met, slot};
use crate::jets::{JetErr, Result};
use crate::mem::NockStack;
use crate::newt::Newt;
use crate::noun::{IndirectAtom, Noun};
use crate::jets::util::slot;
use crate::jets::bits::util::met;
use crate::jets::{JetErr, Result, Error};
use crate::noun::{IndirectAtom, Noun, D};
use crate::interpreter::Context;
use urcrypt_sys::*;
crate::gdb!();
pub fn jet_sivc_en(stack: &mut NockStack,
_newt: &mut Option<&mut Newt>,
pub fn jet_sivc_en(context: &mut Context,
subject: Noun
) -> Result {
let stack = &mut context.stack;
let txt = slot(subject, 6)?.as_atom()?;
let key = slot(subject, 60)?.as_atom()?;
let atoms = slot(subject, 61)?;
if (met(3, key) as usize) > 64 {
// XX vere punts; we should do the same in the future
Err(JetErr::NonDeterministic)
Err(JetErr::Punt)
} else {
unsafe {
let (mut _key_ida, key_bytes) = IndirectAtom::new_raw_mut_bytes(stack, 64);
@ -33,10 +33,10 @@ pub fn jet_sivc_en(stack: &mut NockStack,
}
}
pub fn jet_sivc_de(stack: &mut NockStack,
_newt: &mut Option<&mut Newt>,
pub fn jet_sivc_de(context: &mut Context,
subject: Noun
) -> Result {
let stack = &mut context.stack;
let iv = slot(subject, 12)?.as_atom()?;
let len = slot(subject, 26)?.as_atom()?;
let txt = slot(subject, 27)?.as_atom()?;
@ -57,17 +57,17 @@ pub fn jet_sivc_de(stack: &mut NockStack,
}
}
pub fn jet_sivb_en(stack: &mut NockStack,
_newt: &mut Option<&mut Newt>,
pub fn jet_sivb_en(context: &mut Context,
subject: Noun
) -> Result {
let stack = &mut context.stack;
let txt = slot(subject, 6)?.as_atom()?;
let key = slot(subject, 60)?.as_atom()?;
let atoms = slot(subject, 61)?;
if (met(3, key) as usize) > 48 {
// XX vere punts; we should do the same in the future
Err(JetErr::NonDeterministic)
Err(JetErr::Fail(Error::NonDeterministic(D(0))))
} else {
unsafe {
let (mut _key_ida, key_bytes) = IndirectAtom::new_raw_mut_bytes(stack, 48);
@ -83,10 +83,10 @@ pub fn jet_sivb_en(stack: &mut NockStack,
}
}
pub fn jet_sivb_de(stack: &mut NockStack,
_newt: &mut Option<&mut Newt>,
pub fn jet_sivb_de(context: &mut Context,
subject: Noun
) -> Result {
let stack = &mut context.stack;
let iv = slot(subject, 12)?.as_atom()?;
let len = slot(subject, 26)?.as_atom()?;
let txt = slot(subject, 27)?.as_atom()?;
@ -107,17 +107,17 @@ pub fn jet_sivb_de(stack: &mut NockStack,
}
}
pub fn jet_siva_en(stack: &mut NockStack,
_newt: &mut Option<&mut Newt>,
pub fn jet_siva_en(context: &mut Context,
subject: Noun
) -> Result {
let stack = &mut context.stack;
let txt = slot(subject, 6)?.as_atom()?;
let key = slot(subject, 60)?.as_atom()?;
let atoms = slot(subject, 61)?;
if (met(3, key) as usize) > 32 {
// XX vere punts; we should do the same in the future
Err(JetErr::NonDeterministic)
Err(JetErr::Punt)
} else {
unsafe {
let (mut _key_ida, key_bytes) = IndirectAtom::new_raw_mut_bytes(stack, 32);
@ -133,10 +133,10 @@ pub fn jet_siva_en(stack: &mut NockStack,
}
}
pub fn jet_siva_de(stack: &mut NockStack,
_newt: &mut Option<&mut Newt>,
pub fn jet_siva_de(context: &mut Context,
subject: Noun
) -> Result {
let stack = &mut context.stack;
let iv = slot(subject, 12)?.as_atom()?;
let len = slot(subject, 26)?.as_atom()?;
let txt = slot(subject, 27)?.as_atom()?;
@ -160,7 +160,7 @@ pub fn jet_siva_de(stack: &mut NockStack,
mod util {
use crate::mem::NockStack;
use crate::noun::{Atom, D, T, Noun, IndirectAtom};
use crate::jets::util::met;
use crate::jets::bits::util::met;
use urcrypt_sys::urcrypt_aes_siv_data;
use std::ptr::null_mut;

View File

@ -1,13 +1,14 @@
use crate::jets::util::{met, slot};
use crate::jets::util::slot;
use crate::jets::bits::util::met;
use crate::jets::{JetErr, Result};
use crate::mem::NockStack;
use crate::newt::Newt;
use crate::noun::{IndirectAtom, Noun, YES, NO};
use crate::noun::{IndirectAtom, Noun, YES, NO, D};
use crate::interpreter::{Context, Error};
use urcrypt_sys::*;
crate::gdb!();
pub fn jet_sign(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_sign(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sam = slot(subject, 6)?;
let msg = slot(sam, 2)?.as_atom()?;
let sed = slot(sam, 3)?.as_atom()?;
@ -17,7 +18,7 @@ pub fn jet_sign(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
let sed_bytes = sed.as_bytes();
let (mut _seed_ida, seed) = IndirectAtom::new_raw_mut_bytes(stack, 32);
if sed_bytes.len() > 32 { return Err(JetErr::Deterministic) };
if sed_bytes.len() > 32 { return Err(JetErr::Fail(Error::Deterministic(D(0)))) };
seed.copy_from_slice(sed_bytes);
let (mut sig_ida, sig) = IndirectAtom::new_raw_mut_bytes(stack, 64);
@ -28,7 +29,8 @@ pub fn jet_sign(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
}
}
pub fn jet_veri(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_veri(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sig = slot(subject, 12)?.as_atom()?;
let msg = slot(subject, 26)?.as_atom()?;
let puk = slot(subject, 27)?.as_atom()?;
@ -37,13 +39,13 @@ pub fn jet_veri(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
let (mut _sig_ida, signature) = IndirectAtom::new_raw_mut_bytes(stack, 64);
let sig_bytes = sig.as_bytes();
// vere punts; we should do the same in the future
if sig_bytes.len() > 64 { return Err(JetErr::NonDeterministic) };
if sig_bytes.len() > 64 { return Err(JetErr::Punt) };
signature.copy_from_slice(sig_bytes);
let (mut _pub_ida, public_key) = IndirectAtom::new_raw_mut_bytes(stack, 32);
let pub_bytes = puk.as_bytes();
// vere punts; we should do the same in the future
if pub_bytes.len() > 32 { return Err(JetErr::NonDeterministic) };
if pub_bytes.len() > 32 { return Err(JetErr::Punt) };
public_key.copy_from_slice(pub_bytes);
let message = &(msg.as_bytes())[0..met(3, msg)]; // drop trailing zeros
@ -54,16 +56,17 @@ pub fn jet_veri(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
}
}
pub fn jet_shar(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_shar(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let pub_key = slot(subject, 12)?.as_direct()?;
let sec_key = slot(subject, 13)?.as_direct()?;
if sec_key.bit_size() > 32 {
return Err(JetErr::Deterministic);
return Err(JetErr::Fail(Error::Deterministic(D(0))));
}
if pub_key.bit_size() > 32 {
// vere punts; we should do the same in the future
return Err(JetErr::NonDeterministic);
return Err(JetErr::Punt);
}
unsafe {
@ -83,11 +86,12 @@ pub fn jet_shar(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
}
}
pub fn jet_puck(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_puck(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sed = slot(subject, 6)?.as_direct()?;
if sed.bit_size() > 32 {
return Err(JetErr::Deterministic);
return Err(JetErr::Fail(Error::Deterministic(D(0))));
}
unsafe {
@ -107,92 +111,92 @@ mod tests {
use super::*;
use ibig::ubig;
use crate::noun::{D, T};
use crate::jets::util::test::{A, assert_jet, init_stack, assert_jet_err};
use crate::jets::util::test::{A, assert_jet, init_context, assert_jet_err};
#[test]
fn test_puck() {
let s = &mut init_stack();
let c = &mut init_context();
let ret = A(s, &ubig!(_0xfb099b0acc4d1ce37f9982a2ed331245e0cdfdf6979364b7676a142b8233e53b));
assert_jet(s, jet_puck, D(32), ret);
let ret = A(c.stack, &ubig!(_0xfb099b0acc4d1ce37f9982a2ed331245e0cdfdf6979364b7676a142b8233e53b));
assert_jet(c, jet_puck, D(32), ret);
let sam = A(s, &ubig!(_0xfb099b0acc4d1ce37f9982a2ed331245e0cdfdf6979364b7676a142b8233e53b));
assert_jet_err(s, jet_puck, sam, JetErr::Deterministic);
let sam = A(c.stack, &ubig!(_0xfb099b0acc4d1ce37f9982a2ed331245e0cdfdf6979364b7676a142b8233e53b));
assert_jet_err(s, jet_puck, sam, JetErr::Fail(Error::Deterministic(D(0))));
}
#[test]
fn test_shar() {
let s = &mut init_stack();
let c = &mut init_context();
let sam = T(s, &[D(234), D(234)]);
let ret = A(s, &ubig!(_0x6ecd5779a47841207a2cd0c9d085796aa646842885a332adac540027d768c1c5));
let sam = T(c.stack, &[D(234), D(234)]);
let ret = A(c.stack, &ubig!(_0x6ecd5779a47841207a2cd0c9d085796aa646842885a332adac540027d768c1c5));
assert_jet(s, jet_shar, sam, ret);
let sam = A(s, &ubig!(_0xfb099b0acc4d1ce37f9982a2ed331245e0cdfdf6979364b7676a142b8233e53b));
assert_jet_err(s, jet_shar, sam, JetErr::Deterministic);
assert_jet_err(s, jet_shar, sam, JetErr::Fail(Error::Deterministic(D(0))));
}
#[test]
fn test_veri() {
let s = &mut init_stack();
let c = &mut init_context();
unsafe {
let sig_ubig = ubig!(_0x92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00);
let sig_bytes = sig_ubig.to_be_bytes();
let signature = IndirectAtom::new_raw_bytes(s, sig_bytes.len(), sig_bytes.as_ptr()).as_noun();
let signature = IndirectAtom::new_raw_bytes(c.stack, sig_bytes.len(), sig_bytes.as_ptr()).as_noun();
let message = D(0x72);
let pub_ubig = ubig!(_0x3d4017c3e843895a92b70aa74d1b7ebc9c982ccf2ec4968cc0cd55f12af4660c);
let pub_bytes = pub_ubig.to_be_bytes();
let public_key = IndirectAtom::new_raw_bytes(s, pub_bytes.len(), pub_bytes.as_ptr()).as_noun();
let public_key = IndirectAtom::new_raw_bytes(c.stack, pub_bytes.len(), pub_bytes.as_ptr()).as_noun();
let sam = T(s, &[signature, message, public_key]);
assert_jet(s, jet_veri, sam, YES);
let sam = T(c.stack, &[signature, message, public_key]);
assert_jet(c, jet_veri, sam, YES);
let sig_ubig = ubig!(_0x6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a);
let sig_bytes = sig_ubig.to_be_bytes();
let signature = IndirectAtom::new_raw_bytes(s, sig_bytes.len(), sig_bytes.as_ptr()).as_noun();
let signature = IndirectAtom::new_raw_bytes(c.stack, sig_bytes.len(), sig_bytes.as_ptr()).as_noun();
let msg_ubig = ubig!(0xaf82);
let msg_bytes = msg_ubig.to_be_bytes();
let message = IndirectAtom::new_raw_bytes(s, msg_bytes.len(), msg_bytes.as_ptr()).as_noun();
let message = IndirectAtom::new_raw_bytes(c.stack, msg_bytes.len(), msg_bytes.as_ptr()).as_noun();
let pub_ubig = ubig!(_0xfc51cd8e6218a1a38da47ed00230f0580816ed13ba3303ac5deb911548908025);
let pub_bytes = pub_ubig.to_be_bytes();
let public_key = IndirectAtom::new_raw_bytes(s, pub_bytes.len(), pub_bytes.as_ptr()).as_noun();
let public_key = IndirectAtom::new_raw_bytes(c.stack, pub_bytes.len(), pub_bytes.as_ptr()).as_noun();
let sam = T(s, &[signature, message, public_key]);
assert_jet(s, jet_veri, sam, YES);
assert_jet(c, jet_veri, sam, YES);
}
}
#[test]
fn test_sign() {
let s = &mut init_stack();
let c = &mut init_context();
unsafe {
let message = D(0x72);
let sed_ubig = ubig!(_0x4ccd089b28ff96da9db6c346ec114e0f5b8a319f35aba624da8cf6ed4fb8a6fb);
let sed_bytes = sed_ubig.to_be_bytes();
let seed = IndirectAtom::new_raw_bytes(s, sed_bytes.len(), sed_bytes.as_ptr()).as_noun();
let seed = IndirectAtom::new_raw_bytes(c.stack, sed_bytes.len(), sed_bytes.as_ptr()).as_noun();
let sam = T(s, &[message, seed]);
let ret = A(s, &ubig!(_0x92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00));
assert_jet(s, jet_sign, sam, ret);
let sam = T(c.stack, &[message, seed]);
let ret = A(c.stack, &ubig!(_0x92a009a9f0d4cab8720e820b5f642540a2b27b5416503f8fb3762223ebdb69da085ac1e43e15996e458f3613d0f11d8c387b2eaeb4302aeeb00d291612bb0c00));
assert_jet(c, jet_sign, sam, ret);
let msg_ubig = ubig!(_0xaf82);
let msg_bytes = msg_ubig.to_be_bytes();
let message = IndirectAtom::new_raw_bytes(s, msg_bytes.len(), msg_bytes.as_ptr()).as_noun();
let message = IndirectAtom::new_raw_bytes(c.stack, msg_bytes.len(), msg_bytes.as_ptr()).as_noun();
let sed_ubig = ubig!(_0xc5aa8df43f9f837bedb7442f31dcb7b166d38535076f094b85ce3a2e0b4458f7);
let sed_bytes = sed_ubig.to_be_bytes();
let seed = IndirectAtom::new_raw_bytes(s, sed_bytes.len(), sed_bytes.as_ptr()).as_noun();
let seed = IndirectAtom::new_raw_bytes(c.stack, sed_bytes.len(), sed_bytes.as_ptr()).as_noun();
let sam = T(s, &[message, seed]);
let ret = A(s, &ubig!(_0x6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a));
assert_jet(s, jet_sign, sam, ret);
let sam = T(c.stack, &[message, seed]);
let ret = A(c.stack, &ubig!(_0x6291d657deec24024827e69c3abe01a30ce548a284743a445e3680d7db5ac3ac18ff9b538d16f290ae67f760984dc6594a7c15e9716ed28dc027beceea1ec40a));
assert_jet(c, jet_sign, sam, ret);
}
}
}

View File

@ -1,20 +1,21 @@
use crate::jets::util::{met, slot};
use crate::jets::util::slot;
use crate::jets::bits::util::met;
use crate::jets::{JetErr, Result};
use crate::mem::NockStack;
use crate::newt::Newt;
use crate::noun::{IndirectAtom, Noun};
use crate::interpreter::{Context, Error};
use crate::noun::{IndirectAtom, Noun, D};
use urcrypt_sys::*;
crate::gdb!();
pub fn jet_sha1(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_sha1(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sam = slot(subject, 6)?;
let wid = slot(sam, 2)?.as_atom()?;
let dat = slot(sam, 3)?.as_atom()?;
let width = match wid.as_direct() {
Ok(direct) => direct.data() as usize,
Err(_) => return Err(JetErr::NonDeterministic),
Err(_) => return Err(JetErr::Fail(Error::NonDeterministic(D(0)))),
};
unsafe {
@ -28,14 +29,16 @@ pub fn jet_sha1(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
}
}
pub fn jet_shal(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_shal(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sam = slot(subject, 6)?;
let wid = slot(sam, 2)?.as_atom()?;
let dat = slot(sam, 3)?.as_atom()?;
let width = match wid.as_direct() {
Ok(direct) => direct.data() as usize,
Err(_) => return Err(JetErr::NonDeterministic),
Err(_) => return Err(JetErr::Fail(Error::NonDeterministic(D(0)))),
};
let message = &(dat.as_bytes())[0..met(3, dat)]; // drop trailing zeros
@ -47,7 +50,8 @@ pub fn jet_shal(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
}
}
pub fn jet_shas(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_shas(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sam = slot(subject, 6)?;
let sal = slot(sam, 2)?.as_atom()?;
let ruz= slot(sam, 3)?.as_atom()?;
@ -65,7 +69,8 @@ pub fn jet_shas(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
}
}
pub fn jet_shax(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_shax(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sam = slot(subject, 6)?;
let msg = sam.as_atom()?;
let len = met(3, msg);
@ -77,14 +82,15 @@ pub fn jet_shax(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: N
}
}
pub fn jet_shay(stack: &mut NockStack, _newt: &mut Option<&mut Newt>, subject: Noun) -> Result {
pub fn jet_shay(context: &mut Context, subject: Noun) -> Result {
let stack = &mut context.stack;
let sam = slot(subject, 6)?;
let wid = slot(sam, 2)?.as_atom()?;
let dat = slot(sam, 3)?.as_atom()?;
let width = match wid.as_direct() {
Ok(direct) => direct.data() as usize,
Err(_) => return Err(JetErr::NonDeterministic),
Err(_) => return Err(JetErr::Fail(Error::NonDeterministic(D(0)))),
};
let message = dat.as_bytes();
@ -127,12 +133,12 @@ mod tests {
let big = DIRECT_MAX + 1;
let ida = unsafe { IndirectAtom::new_raw_bytes(s, 8, &big as *const u64 as *const u8) };
let sam = T(s, &[ida.as_noun(), D(478560413032)]);
assert_jet_err(s, jet_shay, sam, JetErr::NonDeterministic);
assert_jet_err(s, jet_shay, sam, JetErr::Fail(Error::NonDeterministic(D(0))));
let big: u128 = (DIRECT_MAX as u128) << 64;
let ida = unsafe { IndirectAtom::new_raw_bytes(s, 8, &big as *const u128 as *const u8) };
let sam = T(s, &[ida.as_noun(), D(478560413032)]);
assert_jet_err(s, jet_shay, sam, JetErr::NonDeterministic);
assert_jet_err(s, jet_shay, sam, JetErr::Fail(Error::NonDeterministic(D(0))));
}
#[test]
@ -228,7 +234,7 @@ mod tests {
s,
jet_shal,
sam,
JetErr::NonDeterministic
JetErr::Fail(Error::NonDeterministic(D(0)))
);
let wid = A(s, &ubig!(_0xa1d6eb6ef33f233ae6980ca7c4fc65f90fe1bdee11c730d41607b4747c83de72));
@ -237,7 +243,7 @@ mod tests {
s,
jet_shal,
sam,
JetErr::NonDeterministic
JetErr::Fail(Error::NonDeterministic(D(0)))
);
}
@ -268,7 +274,7 @@ mod tests {
s,
jet_sha1,
sam,
JetErr::NonDeterministic
JetErr::Fail(Error::NonDeterministic(D(0)))
);
let wid = A(s, &ubig!(_0xa1d6eb6ef33f233ae6980ca7c4fc65f90fe1bdee11c730d41607b4747c83de72));
@ -277,7 +283,7 @@ mod tests {
s,
jet_sha1,
sam,
JetErr::NonDeterministic
JetErr::Fail(Error::NonDeterministic(D(0)))
);
}
}

17
rust/nix/libaes_siv.nix Normal file
View File

@ -0,0 +1,17 @@
{stdenv, fetchFromGitHub, cmake, asciidoc, openssl, libxml2, libxslt, docbook_xml_dtd_45, docbook_xsl}:
stdenv.mkDerivation {
pname = "libaes_siv";
version = "1.latest";
src = fetchFromGitHub {
owner = "dfoxfranke";
repo = "libaes_siv";
rev = "9681279cfaa6e6399bb7ca3afbbc27fc2e19df4b";
hash = "sha256:1g4wy0m5wpqx7z6nillppkh5zki9fkx9rdw149qcxh7mc5vlszzi";
};
buildInputs = [cmake openssl];
cmakeFlags = [ "DDISABLE_DOCS" ];
}

4
rust/nix/overlay.nix Normal file
View File

@ -0,0 +1,4 @@
self: super: {
libaes_siv = self.callPackage ./libaes_siv.nix {};
urcrypt = self.callPackage ./urcrypt.nix {};
}

20
rust/nix/urcrypt.nix Normal file
View File

@ -0,0 +1,20 @@
{ stdenv, fetchFromGitHub, autoreconfHook, pkg-config, openssl, cryptopp, secp256k1, libaes_siv }:
let rev = "375fa7e6a730d8aa517ca981b2b7b505bf4e1103";
in stdenv.mkDerivation {
pname = "urcrypt";
version = "git-${rev}";
src = fetchFromGitHub {
inherit rev;
owner = "urbit";
repo = "urcrypt";
hash = "sha256:1c3cqmwr5mys4v9y0834hxqfr6aynm2gav7730bjzfvrdc21ijqa";
};
preConfigure = ''
./autogen.sh
'';
nativeBuildInputs = [autoreconfHook pkg-config];
buildInputs = [openssl cryptopp secp256k1 libaes_siv];
}

View File

@ -1,9 +1,10 @@
{ sources ? import ./nix/sources.nix,
pkgs ? import sources.nixpkgs {
overlays = [ (import "${sources.fenix}/overlay.nix") ];
overlays = [ (import "${sources.fenix}/overlay.nix") (import ./nix/overlay.nix) ];
}
}:
pkgs.mkShell {
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
packages = with pkgs; [
(fenix.stable.withComponents [
"cargo"
@ -14,6 +15,8 @@ pkgs.mkShell {
])
cargo-watch
gdb
secp256k1
urcrypt
pkg-config
llvmPackages.clang
];
}