Просмотр исходного кода

Merge branch 'halo2-integration'

lunar-mining 4 лет назад
Родитель
Сommit
fe0cc7f08f
100 измененных файлов с 23875 добавлено и 5692 удалено
  1. 332 226
      Cargo.lock
  2. 72 52
      Cargo.toml
  3. 9 12
      Makefile
  4. 0 0
      example/halo2/.gitignore
  5. 577 214
      example/halo2/Cargo.lock
  6. 17 42
      example/halo2/Cargo.toml
  7. 0 0
      example/halo2/Makefile
  8. 0 6
      example/halo2/README.md
  9. 303 0
      example/halo2/src/bin/anonvote.rs
  10. 0 73
      example/halo2/src/bin/burn.rs
  11. 299 224
      example/halo2/src/bin/mint.rs
  12. 53 199
      example/halo2/src/bin/poseidon.rs
  13. 8 28
      example/halo2/src/bin/poseidon_add.rs
  14. 0 130
      example/halo2/src/bin/simple3.rs
  15. 0 267
      example/halo2/src/bin/simple4.rs
  16. 0 16
      example/halo2/src/circuit.rs
  17. 0 0
      example/halo2/src/constants.rs
  18. 0 0
      example/halo2/src/constants/fixed_bases.rs
  19. 0 0
      example/halo2/src/constants/fixed_bases/commit_ivk_r.rs
  20. 0 0
      example/halo2/src/constants/fixed_bases/note_commit_r.rs
  21. 0 0
      example/halo2/src/constants/fixed_bases/nullifier_k.rs
  22. 0 0
      example/halo2/src/constants/fixed_bases/spend_auth_g.rs
  23. 0 0
      example/halo2/src/constants/fixed_bases/value_commit_r.rs
  24. 0 0
      example/halo2/src/constants/fixed_bases/value_commit_v.rs
  25. 0 0
      example/halo2/src/constants/sinsemilla.rs
  26. 0 0
      example/halo2/src/constants/util.rs
  27. 0 0
      example/halo2/src/crypto.rs
  28. 137 0
      example/halo2/src/endian.rs
  29. 113 0
      example/halo2/src/error.rs
  30. 7 19
      example/halo2/src/lib.rs
  31. 0 0
      example/halo2/src/proof.rs
  32. 870 0
      example/halo2/src/serial.rs
  33. 0 0
      example/halo2/src/spec.rs
  34. 17 4
      example/vm/Cargo.toml
  35. 22 0
      example/vm/src/lib.rs
  36. 0 1531
      examples/halo2/Cargo.lock
  37. 0 455
      examples/halo2/src/bin/mint.rs
  38. 0 4
      examples/halo2/src/lib.rs
  39. 56 0
      proof/burn.zk
  40. 46 0
      proof/mint.zk
  41. 7 0
      run_burn_zk.sh
  42. 7 0
      run_mint_zk.sh
  43. 187 0
      script/research/halo/plonk_kate.sage
  44. 33 0
      script/research/rsa_accum.sage
  45. 5 0
      script/to_html.sh
  46. 41 0
      script/zk.vim
  47. 402 0
      script/zkas.py
  48. 0 0
      script/zkas/__init__.py
  49. 50 0
      script/zkas/bincode_output.py
  50. 21 0
      script/zkas/text_output.py
  51. 77 0
      script/zkas/types.py
  52. 1 1
      src/async_serial.rs
  53. 157 29
      src/bin/burn.rs
  54. 0 1
      src/bin/darkfid.rs
  55. 495 69
      src/bin/mint.rs
  56. 180 0
      src/bin/tx2.rs
  57. 153 0
      src/bin/vm2.rs
  58. 210 0
      src/bin/vm2_burn.rs
  59. 1 1
      src/blockchain/rocks.rs
  60. 392 143
      src/circuit/mint_contract.rs
  61. 494 453
      src/circuit/spend_contract.rs
  62. 4 0
      src/client.rs
  63. 208 0
      src/crypto/arith_chip.rs
  64. 24 14
      src/crypto/coin.rs
  65. 11 0
      src/crypto/constants.rs
  66. 214 0
      src/crypto/constants/fixed_bases.rs
  67. 2965 0
      src/crypto/constants/fixed_bases/commit_ivk_r.rs
  68. 2965 0
      src/crypto/constants/fixed_bases/note_commit_r.rs
  69. 2963 0
      src/crypto/constants/fixed_bases/nullifier_k.rs
  70. 2965 0
      src/crypto/constants/fixed_bases/spend_auth_g.rs
  71. 2965 0
      src/crypto/constants/fixed_bases/value_commit_r.rs
  72. 818 0
      src/crypto/constants/fixed_bases/value_commit_v.rs
  73. 261 0
      src/crypto/constants/sinsemilla.rs
  74. 31 0
      src/crypto/constants/util.rs
  75. 4 3
      src/crypto/diffie_hellman.rs
  76. 102 410
      src/crypto/merkle.rs
  77. 453 0
      src/crypto/merkle_old.rs
  78. 96 127
      src/crypto/mint_proof.rs
  79. 16 29
      src/crypto/mod.rs
  80. 36 27
      src/crypto/note.rs
  81. 30 14
      src/crypto/nullifier.rs
  82. 31 7
      src/crypto/pasta_serial.rs
  83. 109 0
      src/crypto/proof.rs
  84. 42 20
      src/crypto/schnorr.rs
  85. 136 223
      src/crypto/spend_proof.rs
  86. 33 2
      src/crypto/util.rs
  87. 224 110
      src/error.rs
  88. 3 110
      src/lib.rs
  89. 20 25
      src/serial.rs
  90. 8 8
      src/service/bridge.rs
  91. 5 5
      src/service/btc.rs
  92. 106 205
      src/service/eth.rs
  93. 2 3
      src/service/gateway.rs
  94. 0 1
      src/service/mod.rs
  95. 4 5
      src/service/reqrep.rs
  96. 6 8
      src/service/sol.rs
  97. 44 14
      src/state.rs
  98. 49 65
      src/tx/builder.rs
  99. 55 43
      src/tx/mod.rs
  100. 16 15
      src/tx/partial.rs

Разница между файлами не показана из-за своего большого размера
+ 332 - 226
Cargo.lock


+ 72 - 52
Cargo.toml

@@ -1,6 +1,6 @@
 [package]
 name = "darkfi"
-version = "0.0.1"
+version = "0.2.0"
 homepage = "https://dark.fi"
 description = "Anonymous. Uncensored. Sovereign."
 authors = ["darkfi <dev@dark.fi>"]
@@ -11,77 +11,97 @@ edition = "2021"
 [lib]
 name = "drk"
 
+[dependencies.halo2]
+version = "=0.1.0-beta.1"
+features = ["dev-graph", "gadget-traces", "sanity-checks"]
+
+[dependencies.halo2_gadgets]
+git = "https://github.com/parazyd/halo2_gadgets.git"
+rev = "8238cb3471b798c76dd53b278524fc80685c7d4f"
+features = ["dev-graph", "test-dependencies"]
+
+[dependencies.incrementalmerkletree]
+git = "https://github.com/zcash/incrementalmerkletree.git"
+rev = "b7bd6246122a6e9ace8edb51553fbf5228906cbb"
+
+[dependencies.rocksdb]
+# TODO: Revert to upstream after bd966750ec861d687913d59a9939a1408ac53131 is merged.
+git = "https://github.com/parazyd/rust-rocksdb"
+rev = "bd966750ec861d687913d59a9939a1408ac53131"
+default-features = false
+features = ["lz4"]
+
 [dependencies]
-ff = "0.8"
-group = "0.8"
-bellman = { version = "0.8", default-features = false, features = ["groth16"] }
-bls12_381 = "0.3.1"
-jubjub = "0.5.1"
-zcash_primitives = "0.5.0"
-zcash_proofs = "0.5.0"
-rand = "0.7.3"
-rand_core = "0.5.1"
+# Crypto
+pasta_curves = "0.2.1"
+rand = "0.8.4"
+num-bigint = {version = "0.4.2", features = ["rand"]}
+blake2b_simd = "0.5.11"
+blake2s_simd = "0.5.11"
+group = "0.11.0"
+crypto_api_chachapoly = "0.5.0"
+arrayvec = "0.7.0"
 sha2 = "0.9.8"
 ripemd160 = "0.9.1"
-blake2s_simd = "0.5"
-blake2b_simd = "0.5.11"
-crypto_api_chachapoly = "0.4"
-bitvec = "0.18"
-bimap = "0.5.2"
-hex = "0.4.2"
+# Constant time options which is used for MerkleNode incrementalmerkletree
+subtle = "2.3"
+
+# Encoding and parsing
 bs58 = "0.4.0"
-prettytable-rs = "0.8"
-num_cpus = "1.13.0"
-num-bigint = {version = "0.3.2", features = ["rand", "serde"]}
+bytes = "1.1.0"
+hex = "0.4.3"
+toml = "0.5.8"
+url = "2.2.2"
+serde_json = "1.0.68"
+serde = {version = "1.0.130", features = ["derive"]}
 
-smol = "1.2.5"
-futures = "0.3.17"
-async-channel = "1.6.1"
-async-trait = "0.1.51"
-async-executor = "1.4.1"
+# Async
 async-std = "1.10.0"
-async-native-tls = "0.3.3"
+async-trait = "0.1.51"
+async-channel = "1.6.1"
 native-tls = "0.2.8"
-easy-parallel = "3.1.0"
-
-tungstenite = "0.15.0"
-async-tungstenite = "0.15.0"
+async-native-tls = "0.3.3"
+async-executor = "1.4.1"
+futures = "0.3.17"
+smol = "1.2.5"
 
-simple_logger = "1.13.0"
-log = "0.4.14"
-clap = "2.33.3"
-toml = "0.5.8"
+# Utilities
+anyhow = "1.0.44"
 dirs = "4.0.0"
-url = "2.2.2"
-serde = {version = "1.0.130", features = ["derive"]}
-serde_json = "1.0.68"
-bytes = "1.0.1"
+failure = "0.1.8"
+lazy_static = "1.4.0"
+log = "0.4.14"
+num_cpus = "1.13.0"
+simple_logger = "1.13.0"
 signal-hook = "0.3.10"
 signal-hook-async-std = "0.2.1"
-lazy_static = "1.4.0"
-thiserror = "1.0.30"
 
-rocksdb = {version = "0.16.0", default-features = false, features = ["lz4"]}
-zeromq = {version = "0.2.2", default-features = false, features = ["async-std-runtime", "all-transport"]}
-rusqlite = {version = "0.26.0", features = ["bundled-sqlcipher"]}
+# Used for Websockets client implementation.
+async-tungstenite = "0.15.0"
+tungstenite = "0.15.0"
 
-## Cashier Solana Dependencies
-solana-sdk = {version = "1.8.1", optional = true}
-solana-client = {version = "1.8.1", optional = true}
-spl-token = {version = "3.2.0", features = ["no-entrypoint"], optional = true}
-spl-associated-token-account = {version = "1.0.3", features = ["no-entrypoint"], optional = true}
+# Used for wallet management.
+rusqlite = {version = "0.26.1", features = ["bundled-sqlcipher"]}
 
-## Cashier Bitcoin Dependencies
-anyhow = "1.0.44"
+# Used for gatewayd network transport.
+zeromq = {version = "0.3.0", default-features = false, features = ["async-std-runtime", "all-transport"]}
+
+# Cashier Bitcoin dependencies
 bdk = {version = "0.12.0", optional = true}
-bitcoin = {version = "0.27.0", optional = true }
+bitcoin = {version = "0.27.0", optional = true}
 secp256k1 = {version = "0.20.3", default-features = false, features = ["rand-std"], optional = true}
 
-## Cashier Ethereum Dependencies
+# Cashier Ethereum dependencies
 hash-db = {version = "0.15.2", optional = true}
 keccak-hasher = {version = "0.15.3", optional = true}
 
+# Cashier Solana dependencies
+solana-client = {version = "1.8.2", optional = true}
+solana-sdk = {version = "1.8.2", optional = true}
+spl-associated-token-account = {version = "1.0.3", features = ["no-entrypoint"], optional = true}
+spl-token = {version = "3.2.0", features = ["no-entrypoint"], optional = true}
+
 [features]
 btc = ["bdk", "bitcoin", "secp256k1"]
-sol = ["solana-sdk", "solana-client", "spl-token", "spl-associated-token-account"]
 eth = ["keccak-hasher", "hash-db"]
+sol = ["solana-sdk", "solana-client", "spl-token", "spl-associated-token-account"]

+ 9 - 12
Makefile

@@ -1,14 +1,13 @@
 .POSIX:
 
+# Install prefix
 PREFIX = /usr/local
-DLURL = https://testnet.cashier.dark.fi
 
+# Cargo binary
 CARGO = cargo
-DLTOOL = wget -nv --show-progress -O-
-#DLTOOL = curl
 
 # Here it's possible to append "cashierd" and "gatewayd".
-BINS = drk darkfid
+BINS = drk darkfid cashierd gatewayd
 
 # Dependencies which should force the binaries to be rebuilt
 BINDEPS = \
@@ -17,23 +16,22 @@ BINDEPS = \
 	$(shell find token -type f) \
 	$(shell find sql -type f)
 
-all: $(BINS) mint.params spend.params
+#all: $(BINS)
+all:
+	cargo build --release --all-features --lib
 
 $(BINS): $(BINDEPS)
 	$(CARGO) build --release --all-features --bin $@
 	cp target/release/$@ $@
 
-%.params:
-	$(DLTOOL) $(DLURL)/$@ > $@
-
 test:
-	$(CARGO) test --release --all-features
+	$(CARGO) test --release --all-features --lib
 
 fix:
 	$(CARGO) fix --release --all-features --allow-dirty
 
 clippy:
-	$(CARGO) clippy --release --all-features
+	$(CARGO) clippy --release --all-features --lib
 
 install: all
 	mkdir -p $(DESTDIR)$(PREFIX)/bin
@@ -44,7 +42,6 @@ install: all
 	do \
 		cp -f example/config/$$i.toml $(DESTDIR)$(PREFIX)/share/doc/darkfi; \
 	done;
-	cp -f mint.params spend.params $(DESTDIR)$(PREFIX)/share/darkfi
 
 uninstall:
 	for i in $(BINS); \
@@ -55,7 +52,7 @@ uninstall:
 	rm -rf $(DESTDIR)$(PREFIX)/share/darkfi
 
 clean:
-	rm -f $(BINS) mint.params spend.params
+	rm -f $(BINS)
 
 distclean: clean
 	rm -rf target

+ 0 - 0
examples/halo2/.gitignore → example/halo2/.gitignore


Разница между файлами не показана из-за своего большого размера
+ 577 - 214
example/halo2/Cargo.lock


+ 17 - 42
example/halo2/Cargo.toml

@@ -1,47 +1,22 @@
 [package]
-name = "halo2_examples"
+name = "drk_halo2"
 version = "0.1.0"
-authors = ["narodnik <x@x.org>"]
-edition = "2018"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+authors = ["Ivan Jelincic <parazyd@dyne.org>"]
+edition = "2021"
 
 [dependencies]
-ff = "0.10"
-group = "0.10"
-pasta_curves = "0.1.2"
-bitvec = "0.22"
 rand = "0.8.4"
-arrayvec = "0.7.0"
-lazy_static = "1"
-bigint = "4"
-subtle = "2.3"
-halo2 = "0.0"
-
-[patch.crates-io]
-halo2 = { git = "https://github.com/zcash/halo2.git", rev = "27c4187673a9c6ade13fbdbd4f20955530c22d7f" }
-
-[dependencies.halo2_poseidon]
-git = "https://github.com/parazyd/orchard.git"
-#rev = "0d14f2390734e4710fc24a976f037dae3a6e7ac8"
-rev = "f9cc01c21010b31988129f9cbc2ca8c0bdbf2ee9"
-features = ["halo2"]
-
-[dependencies.halo2_utilities]
-git = "https://github.com/parazyd/orchard.git"
-#rev = "0d14f2390734e4710fc24a976f037dae3a6e7ac8"
-rev = "f9cc01c21010b31988129f9cbc2ca8c0bdbf2ee9"
-
-[dependencies.halo2_ecc]
-git = "https://github.com/parazyd/orchard.git"
-#rev = "0d14f2390734e4710fc24a976f037dae3a6e7ac8"
-rev = "f9cc01c21010b31988129f9cbc2ca8c0bdbf2ee9"
-
-[dependencies.sinsemilla]
-git = "https://github.com/parazyd/orchard.git"
-#rev = "0d14f2390734e4710fc24a976f037dae3a6e7ac8"
-rev = "f9cc01c21010b31988129f9cbc2ca8c0bdbf2ee9"
-
- [dependencies.orchard]
-git = "https://github.com/parazyd/orchard.git"
-rev = "f9cc01c21010b31988129f9cbc2ca8c0bdbf2ee9"
+ff = "0.11.0"
+pasta_curves = "0.2.1"
+hex = "0.4.3"
+failure = "0.1.8"
+anyhow = "1.0.44"
+
+[dependencies.halo2]
+version = "=0.1.0-beta.1"
+features = ["dev-graph", "gadget-traces", "sanity-checks"]
+
+[dependencies.halo2_gadgets]
+git = "https://github.com/parazyd/halo2_gadgets.git"
+rev = "b45c527276bb2309f3b256eb5f45ccdcc5bd8c0f"
+features = ["dev-graph", "test-dependencies"]

+ 0 - 0
examples/halo2/Makefile → example/halo2/Makefile


+ 0 - 6
example/halo2/README.md

@@ -1,6 +0,0 @@
-Always use the --release flag otherwise it's too slow:
-
-```
-cargo run --release --bin simple3
-```
-

+ 303 - 0
example/halo2/src/bin/anonvote.rs

@@ -0,0 +1,303 @@
+// https://docs.vocdoni.io/architecture/protocol/anonymous-voting/zk-census-proof.html#protocol-design
+use anyhow::Result;
+use halo2::{
+    circuit::{Layouter, SimpleFloorPlanner},
+    plonk::{Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn},
+};
+use halo2_gadgets::{
+    ecc::chip::{EccChip, EccConfig},
+    poseidon::{Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig},
+    primitives,
+    primitives::poseidon::{ConstantLength, P128Pow5T3},
+    sinsemilla::{
+        chip::{SinsemillaChip, SinsemillaConfig},
+        merkle::chip::{MerkleChip, MerkleConfig},
+    },
+    utilities::{lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions},
+};
+use pasta_curves::{
+    arithmetic::{CurveAffine, Field},
+    group::{ff::PrimeFieldBits, Curve},
+    pallas,
+};
+use rand::rngs::OsRng;
+
+use drk_halo2::{
+    constants::{
+        sinsemilla::{OrchardCommitDomains, OrchardHashDomains, MERKLE_CRH_PERSONALIZATION},
+        OrchardFixedBases,
+    },
+    crypto::pedersen_commitment,
+    spec::i2lebsp,
+};
+
+#[derive(Clone, Debug)]
+struct VoteConfig {
+    primary: Column<InstanceColumn>,
+    advices: [Column<Advice>; 10],
+    ecc_config: EccConfig,
+    merkle_config_1: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    merkle_config_2: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_1:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_2:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    poseidon_config: PoseidonConfig<pallas::Base>,
+}
+
+impl VoteConfig {
+    fn ecc_chip(&self) -> EccChip<OrchardFixedBases> {
+        EccChip::construct(self.ecc_config.clone())
+    }
+
+    fn sinsemilla_chip_1(
+        &self,
+    ) -> SinsemillaChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        SinsemillaChip::construct(self.sinsemilla_config_1.clone())
+    }
+
+    fn sinsemilla_chip_2(
+        &self,
+    ) -> SinsemillaChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        SinsemillaChip::construct(self.sinsemilla_config_2.clone())
+    }
+
+    fn merkle_chip_1(
+        &self,
+    ) -> MerkleChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        MerkleChip::construct(self.merkle_config_1.clone())
+    }
+
+    fn merkle_chip_2(
+        &self,
+    ) -> MerkleChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        MerkleChip::construct(self.merkle_config_2.clone())
+    }
+
+    fn poseidon_chip(&self) -> PoseidonChip<pallas::Base> {
+        PoseidonChip::construct(self.poseidon_config.clone())
+    }
+}
+
+// The public input array offsets
+const VOTE_MERKLE_ROOT_OFFSET: usize = 0;
+const VOTE_NULLIFIER_OFFSET: usize = 1;
+const VOTE_PROCESS_ID_OFFSET: usize = 2;
+const VOTE_COMMITX_OFFSET: usize = 3;
+const VOTE_COMMITY_OFFSET: usize = 4;
+
+#[derive(Default, Debug)]
+struct VoteCircuit {
+    index: Option<pallas::Base>,
+    secret_key: Option<pallas::Base>,
+    merkle_proof: Option<pallas::Base>,
+}
+
+impl UtilitiesInstructions<pallas::Base> for VoteCircuit {
+    type Var = CellValue<pallas::Base>;
+}
+
+impl Circuit<pallas::Base> for VoteCircuit {
+    type Config = VoteConfig;
+    type FloorPlanner = SimpleFloorPlanner;
+
+    fn without_witnesses(&self) -> Self {
+        Self::default()
+    }
+
+    fn configure(meta: &mut ConstraintSystem<pallas::Base>) -> Self::Config {
+        // Advice columns used in the circuit
+        let advices = [
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+        ];
+
+        // Fixed columns for the Sinsemilla generator lookup table
+        let table_idx = meta.lookup_table_column();
+        let lookup = (
+            table_idx,
+            meta.lookup_table_column(),
+            meta.lookup_table_column(),
+        );
+
+        // Instance column used for public inputs
+        let primary = meta.instance_column();
+        meta.enable_equality(primary.into());
+
+        // Permutation over all advice columns
+        for advice in advices.iter() {
+            meta.enable_equality((*advice).into());
+        }
+
+        // Poseidon requires four advice columns, while ECC incomplete addition
+        // requires six. We can reduce the proof size by sharing fixed columns
+        // between the ECC and Poseidon chips.
+        // TODO: For multiple invocations they could/should be configured in
+        // parallel rather than sharing perhaps?
+        let lagrange_coeffs = [
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+        ];
+        let rc_a = lagrange_coeffs[2..5].try_into().unwrap();
+        let rc_b = lagrange_coeffs[5..8].try_into().unwrap();
+
+        // Also use the first Lagrange coefficient column for loading global constants.
+        meta.enable_constant(lagrange_coeffs[0]);
+
+        // Use one of the right-most advice columns for all of our range checks.
+        let range_check = LookupRangeCheckConfig::configure(meta, advices[9], table_idx);
+
+        // Configuration for curve point operations.
+        // This uses 10 advice columns and spans the whole circuit.
+        let ecc_config = EccChip::<OrchardFixedBases>::configure(
+            meta,
+            advices,
+            lagrange_coeffs,
+            range_check.clone(),
+        );
+
+        // Configuration for the Poseidon hash
+        let poseidon_config = PoseidonChip::configure(
+            meta,
+            P128Pow5T3,
+            advices[6..9].try_into().unwrap(),
+            advices[5],
+            rc_a,
+            rc_b,
+        );
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_1, merkle_config_1) = {
+            let sinsemilla_config_1 = SinsemillaChip::configure(
+                meta,
+                advices[..5].try_into().unwrap(),
+                advices[6],
+                lagrange_coeffs[0],
+                lookup,
+                range_check.clone(),
+            );
+            let merkle_config_1 = MerkleChip::configure(meta, sinsemilla_config_1.clone());
+            (sinsemilla_config_1, merkle_config_1)
+        };
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_2, merkle_config_2) = {
+            let sinsemilla_config_2 = SinsemillaChip::configure(
+                meta,
+                advices[5..].try_into().unwrap(),
+                advices[7],
+                lagrange_coeffs[1],
+                lookup,
+                range_check,
+            );
+            let merkle_config_2 = MerkleChip::configure(meta, sinsemilla_config_2.clone());
+
+            (sinsemilla_config_2, merkle_config_2)
+        };
+
+        VoteConfig {
+            primary,
+            advices,
+            ecc_config,
+            merkle_config_1,
+            merkle_config_2,
+            sinsemilla_config_1,
+            sinsemilla_config_2,
+            poseidon_config,
+        }
+    }
+
+    fn synthesize(
+        &self,
+        config: Self::Config,
+        mut layouter: impl Layouter<pallas::Base>,
+    ) -> Result<(), Error> {
+        // Load the Sinsemilla generator lookup table used by the whole circuit.
+        SinsemillaChip::load(config.sinsemilla_config_1.clone(), &mut layouter)?;
+
+        Ok(())
+    }
+}
+
+fn root(path: [pallas::Base; 32], leaf_pos: u32, leaf: pallas::Base) -> pallas::Base {
+    let domain = primitives::sinsemilla::HashDomain::new(MERKLE_CRH_PERSONALIZATION);
+
+    let pos_bool = i2lebsp::<32>(leaf_pos as u64);
+
+    let mut node = leaf;
+    for (l, (sibling, pos)) in path.iter().zip(pos_bool.iter()).enumerate() {
+        let (left, right) = if *pos {
+            (*sibling, node)
+        } else {
+            (node, *sibling)
+        };
+
+        let l_star = i2lebsp::<10>(l as u64);
+        let left: Vec<_> = left.to_le_bits().iter().by_val().take(255).collect();
+        let right: Vec<_> = right.to_le_bits().iter().by_val().take(255).collect();
+
+        let mut message = l_star.to_vec();
+        message.extend_from_slice(&left);
+        message.extend_from_slice(&right);
+
+        node = domain.hash(message.into_iter()).unwrap();
+    }
+    node
+}
+
+fn main() -> Result<()> {
+    // The number of rows in our circuit cannot exceed 2^k
+    // let k: u32 = 11;
+
+    // Voter is the owner of the secret key corresponding to a certain zkCensusKey.
+    let secret_key = pallas::Base::random(&mut OsRng);
+    let zk_census_key =
+        primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<1>).hash([secret_key]);
+
+    // Voter's zkCensusKey is included in the census Merkle Tree
+    let leaf = zk_census_key.clone();
+    let pos = rand::random::<u32>();
+    let path: Vec<_> = (0..32).map(|_| pallas::Base::random(&mut OsRng)).collect();
+    let merkle_root = root(path.clone().try_into().unwrap(), pos, leaf);
+
+    // The nullifier provided by Voter uniquely corresponds to their secret
+    // key and the process ID for a specific voting process.
+    let process_id = pallas::Base::from(42);
+    let nullifier = primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>)
+        .hash([secret_key, process_id]);
+
+    // The vote itself
+    let vote_blind = pallas::Scalar::random(&mut OsRng);
+    let vote = pedersen_commitment(1, vote_blind);
+    let vote_coords = vote.to_affine().coordinates().unwrap();
+
+    let _public_inputs = [
+        merkle_root,
+        nullifier,
+        process_id,
+        *vote_coords.x(),
+        *vote_coords.y(),
+    ];
+
+    Ok(())
+}

+ 0 - 73
example/halo2/src/bin/burn.rs

@@ -1,73 +0,0 @@
-use std::iter;
-
-use group::{ff::PrimeFieldBits, Curve};
-use halo2::{
-    arithmetic::{CurveAffine, Field, FieldExt},
-    pasta::{Fp, Fq},
-};
-use halo2_ecc::gadget::FixedPoints;
-use halo2_poseidon::primitive::{ConstantLength, Hash, P128Pow5T3 as OrchardNullifier};
-use orchard::constants::{fixed_bases::OrchardFixedBases, sinsemilla::MERKLE_CRH_PERSONALIZATION};
-use rand::rngs::OsRng;
-use sinsemilla::primitive::{CommitDomain, HashDomain};
-
-use halo2_examples::pedersen_commitment;
-
-fn main() {
-    let secret_key = Fq::random(&mut OsRng);
-    let serial = Fp::random(&mut OsRng);
-
-    // Sinsemilla hash
-    let domain = HashDomain::new(MERKLE_CRH_PERSONALIZATION);
-    let nullifier = domain
-        .hash(
-            iter::empty()
-                .chain(secret_key.to_le_bits().iter().by_val())
-                .chain(serial.to_le_bits().iter().by_val()),
-        )
-        .unwrap();
-
-    let public_key = OrchardFixedBases::SpendAuthG.generator() * secret_key;
-    let coords = public_key.to_affine().coordinates().unwrap();
-
-    let value = 110;
-    let asset = 1;
-
-    let value_blind = Fq::random(&mut OsRng);
-    let asset_blind = Fq::random(&mut OsRng);
-
-    let coin_blind = Fp::random(&mut OsRng);
-
-    // FIXME:
-    let messages = [
-        [*coords.x(), *coords.y()],
-        [Fp::from(value), Fp::from(asset)],
-        [serial, coin_blind],
-    ];
-    let mut coin = Fp::zero();
-    for msg in messages.iter() {
-        coin += Hash::init(OrchardNullifier, ConstantLength::<2>).hash(*msg);
-    }
-
-    // TODO: Merkle
-
-    let value_commit = pedersen_commitment(value, value_blind);
-    let asset_commit = pedersen_commitment(asset, asset_blind);
-    let value_coords = value_commit.to_affine().coordinates().unwrap();
-    let asset_coords = value_commit.to_affine().coordinates().unwrap();
-
-    let sig_secret = Fq::random(&mut OsRng);
-    let sig_pubkey = OrchardFixedBases::SpendAuthG.generator() * sig_secret;
-    let sig_pk_coords = sig_pubkey.to_affine().coordinates().unwrap();
-
-    let mut public_inputs = vec![
-        nullifier,
-        *value_coords.x(),
-        *value_coords.y(),
-        *asset_coords.x(),
-        *asset_coords.y(),
-        // merkle_root,
-        *sig_pk_coords.x(),
-        *sig_pk_coords.y(),
-    ];
-}

+ 299 - 224
example/halo2/src/bin/mint.rs

@@ -1,58 +1,106 @@
-use std::{convert::TryInto, time::Instant};
+use std::time::Instant;
 
-use group::{ff::Field, Curve, Group};
 use halo2::{
-    arithmetic::CurveAffine,
-    circuit::{floor_planner, Layouter},
+    circuit::{Layouter, SimpleFloorPlanner},
     dev::MockProver,
-    pasta::{vesta, Ep, Fp, Fq},
-    plonk,
-    plonk::{Circuit, ConstraintSystem, Error},
-    poly::commitment,
-    transcript::{Blake2bRead, Blake2bWrite},
+    plonk::{
+        Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector,
+    },
+    poly::Rotation,
 };
-use halo2_ecc::{chip::EccChip, gadget::FixedPoint};
-use halo2_poseidon::{
-    gadget::{Hash as PoseidonHash, Word},
-    pow5t3::{Pow5T3Chip as PoseidonChip, StateWord},
-    primitive::{ConstantLength, Hash, P128Pow5T3 as OrchardNullifier},
+use halo2_gadgets::{
+    ecc::{
+        chip::{EccChip, EccConfig},
+        FixedPoint,
+    },
+    poseidon::{
+        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
+        StateWord, Word,
+    },
+    primitives,
+    primitives::poseidon::{ConstantLength, P128Pow5T3},
+    sinsemilla::{
+        chip::{SinsemillaChip, SinsemillaConfig},
+        merkle::chip::{MerkleChip, MerkleConfig},
+    },
+    utilities::{
+        copy, lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
+    },
 };
-use halo2_utilities::{
-    lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
+use pasta_curves::{
+    arithmetic::{CurveAffine, Field},
+    group::{Curve, Group},
+    pallas,
 };
-use orchard::constants::fixed_bases::OrchardFixedBases;
 use rand::rngs::OsRng;
 
-use halo2_examples::{circuit::Config, pedersen_commitment};
+use drk_halo2::{
+    constants::{
+        sinsemilla::{OrchardCommitDomains, OrchardHashDomains},
+        OrchardFixedBases,
+    },
+    crypto::pedersen_commitment,
+    proof::{Proof, ProvingKey, VerifyingKey},
+};
+
+#[derive(Clone, Debug)]
+struct MintConfig {
+    primary: Column<InstanceColumn>,
+    q_add: Selector,
+    advices: [Column<Advice>; 10],
+    ecc_config: EccConfig,
+    merkle_config_1: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    merkle_config_2: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_1:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_2:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    poseidon_config: PoseidonConfig<pallas::Base>,
+}
+
+impl MintConfig {
+    fn ecc_chip(&self) -> EccChip<OrchardFixedBases> {
+        EccChip::construct(self.ecc_config.clone())
+    }
+
+    fn poseidon_chip(&self) -> PoseidonChip<pallas::Base> {
+        PoseidonChip::construct(self.poseidon_config.clone())
+    }
+}
 
-const K: u32 = 9;
+// The public input array offsets
+const MINT_COIN_OFFSET: usize = 0;
+const MINT_VALCOMX_OFFSET: usize = 1;
+const MINT_VALCOMY_OFFSET: usize = 2;
+const MINT_ASSCOMX_OFFSET: usize = 3;
+const MINT_ASSCOMY_OFFSET: usize = 4;
 
 #[derive(Default, Debug)]
 struct MintCircuit {
-    pub_x: Option<Fp>,       // x coordinate for pubkey
-    pub_y: Option<Fp>,       // y coordinate for pubkey
-    value: Option<Fp>,       // The value of this coin
-    asset: Option<Fp>,       // The asset ID
-    serial: Option<Fp>,      // Unique serial number corresponding to this coin
-    coin_blind: Option<Fp>,  // Random blinding factor for coin
-    value_blind: Option<Fq>, // Random blinding factor for value commitment
-    asset_blind: Option<Fq>, // Random blinding factor for the asset ID
+    pub_x: Option<pallas::Base>,         // x coordinate for pubkey
+    pub_y: Option<pallas::Base>,         // y coordinate for pubkey
+    value: Option<pallas::Base>,         // The value of this coin
+    asset: Option<pallas::Base>,         // The asset ID
+    serial: Option<pallas::Base>,        // Unique serial number corresponding to this coin
+    coin_blind: Option<pallas::Base>,    // Random blinding factor for coin
+    value_blind: Option<pallas::Scalar>, // Random blinding factor for value commitment
+    asset_blind: Option<pallas::Scalar>, // Random blinding factor for the asset ID
 }
 
-impl UtilitiesInstructions<Fp> for MintCircuit {
-    type Var = CellValue<Fp>;
+impl UtilitiesInstructions<pallas::Base> for MintCircuit {
+    type Var = CellValue<pallas::Base>;
 }
 
-impl Circuit<Fp> for MintCircuit {
-    type Config = Config;
-    type FloorPlanner = floor_planner::V1;
-    //type FloorPlanner = SimpleFloorPlanner;
+impl Circuit<pallas::Base> for MintCircuit {
+    type Config = MintConfig;
+    type FloorPlanner = SimpleFloorPlanner;
 
     fn without_witnesses(&self) -> Self {
         Self::default()
     }
 
-    fn configure(meta: &mut ConstraintSystem<Fp>) -> Self::Config {
+    fn configure(meta: &mut ConstraintSystem<pallas::Base>) -> Self::Config {
+        // Advice columns used in the circuit
         let advices = [
             meta.advice_column(),
             meta.advice_column(),
@@ -66,24 +114,51 @@ impl Circuit<Fp> for MintCircuit {
             meta.advice_column(),
         ];
 
+        // Addition of two field elements
+        /*
+        let q_add = meta.selector();
+        meta.create_gate("poseidon_hash(a, b) + c", |meta| {
+            let q_add = meta.query_selector(q_add);
+            let sum = meta.query_advice(advices[6], Rotation::cur());
+            let hash = meta.query_advice(advices[7], Rotation::cur());
+            let c = meta.query_advice(advices[8], Rotation::cur());
+
+            vec![q_add * (hash + c - sum)]
+        });
+        */
         let q_add = meta.selector();
+        meta.create_gate("a+b+c", |meta| {
+            let q_add = meta.query_selector(q_add);
+            let sum = meta.query_advice(advices[5], Rotation::cur());
+            let a = meta.query_advice(advices[6], Rotation::cur());
+            let b = meta.query_advice(advices[7], Rotation::cur());
+            let c = meta.query_advice(advices[8], Rotation::cur());
 
-        let table_idx = meta.lookup_table_column();
+            vec![q_add * (a + b + c - sum)]
+        });
 
-        // let lookup = (
-        // table_idx,
-        // meta.lookup_table_column(),
-        // meta.lookup_table_column(),
-        // );
+        // Fixed columns for the Sinsemilla generator lookup table
+        let table_idx = meta.lookup_table_column();
+        let lookup = (
+            table_idx,
+            meta.lookup_table_column(),
+            meta.lookup_table_column(),
+        );
 
+        // Instance column used for public inputs
         let primary = meta.instance_column();
-
         meta.enable_equality(primary.into());
 
+        // Permutation over all advice columns
         for advice in advices.iter() {
             meta.enable_equality((*advice).into());
         }
 
+        // Poseidon requires four advice columns, while ECC incomplete addition
+        // requires six. We can reduce the proof size by sharing fixed columns
+        // between the ECC and Poseidon chips.
+        // TODO: For multiple invocations they could/should be configured in
+        // parallel rather than sharing perhaps?
         let lagrange_coeffs = [
             meta.fixed_column(),
             meta.fixed_column(),
@@ -94,14 +169,17 @@ impl Circuit<Fp> for MintCircuit {
             meta.fixed_column(),
             meta.fixed_column(),
         ];
-
         let rc_a = lagrange_coeffs[2..5].try_into().unwrap();
         let rc_b = lagrange_coeffs[5..8].try_into().unwrap();
 
+        // Also use the first Lagrange coefficient column for loading global constants.
         meta.enable_constant(lagrange_coeffs[0]);
 
+        // Use one of the right-most advice columns for all of our range checks.
         let range_check = LookupRangeCheckConfig::configure(meta, advices[9], table_idx);
 
+        // Configuration for curve point operations.
+        // This uses 10 advice columns and spans the whole circuit.
         let ecc_config = EccChip::<OrchardFixedBases>::configure(
             meta,
             advices,
@@ -109,20 +187,60 @@ impl Circuit<Fp> for MintCircuit {
             range_check.clone(),
         );
 
+        // Configuration for the Poseidon hash
         let poseidon_config = PoseidonChip::configure(
             meta,
-            OrchardNullifier,
+            P128Pow5T3,
             advices[6..9].try_into().unwrap(),
             advices[5],
             rc_a,
             rc_b,
         );
 
-        Config {
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_1, merkle_config_1) = {
+            let sinsemilla_config_1 = SinsemillaChip::configure(
+                meta,
+                advices[..5].try_into().unwrap(),
+                advices[6],
+                lagrange_coeffs[0],
+                lookup,
+                range_check.clone(),
+            );
+            let merkle_config_1 = MerkleChip::configure(meta, sinsemilla_config_1.clone());
+            (sinsemilla_config_1, merkle_config_1)
+        };
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_2, merkle_config_2) = {
+            let sinsemilla_config_2 = SinsemillaChip::configure(
+                meta,
+                advices[5..].try_into().unwrap(),
+                advices[7],
+                lagrange_coeffs[1],
+                lookup,
+                range_check,
+            );
+            let merkle_config_2 = MerkleChip::configure(meta, sinsemilla_config_2.clone());
+
+            (sinsemilla_config_2, merkle_config_2)
+        };
+
+        MintConfig {
             primary,
             q_add,
             advices,
             ecc_config,
+            merkle_config_1,
+            merkle_config_2,
+            sinsemilla_config_1,
+            sinsemilla_config_2,
             poseidon_config,
         }
     }
@@ -130,120 +248,142 @@ impl Circuit<Fp> for MintCircuit {
     fn synthesize(
         &self,
         config: Self::Config,
-        mut layouter: impl Layouter<Fp>,
+        mut layouter: impl Layouter<pallas::Base>,
     ) -> Result<(), Error> {
-        // Construct the ECC chip.
-        let ecc_chip = EccChip::construct(config.ecc_config.clone());
+        // Load the Sinsemilla generator lookup table used by the whole circuit.
+        SinsemillaChip::load(config.sinsemilla_config_1.clone(), &mut layouter)?;
+
+        let ecc_chip = config.ecc_chip();
 
         let pub_x = self.load_private(
             layouter.namespace(|| "load pubkey x"),
             config.advices[0],
             self.pub_x,
         )?;
+
         let pub_y = self.load_private(
             layouter.namespace(|| "load pubkey y"),
             config.advices[0],
             self.pub_y,
         )?;
+
         let value = self.load_private(
             layouter.namespace(|| "load value"),
             config.advices[0],
             self.value,
         )?;
+
         let asset = self.load_private(
             layouter.namespace(|| "load asset"),
             config.advices[0],
             self.asset,
         )?;
+
         let serial = self.load_private(
             layouter.namespace(|| "load serial"),
             config.advices[0],
             self.serial,
         )?;
+
         let coin_blind = self.load_private(
             layouter.namespace(|| "load coin_blind"),
             config.advices[0],
             self.coin_blind,
         )?;
 
-        // =============
-        // = Coin hash =
-        // =============
-
-        // TODO: This is a hack until issue is resolved in poseidon gadget
-        let mut coin = Fp::zero();
+        // =========
+        // Coin hash
+        // =========
         let messages = [[pub_x, pub_y], [value, asset], [serial, coin_blind]];
-        //let messages = [[pub_x, pub_y], [value, asset]];
-        //let messages = [[pub_x, pub_y]];
-        for msg in messages.iter() {
-            let poseidon_message = layouter.assign_region(
-                || "load message",
-                |mut region| {
-                    let mut message_word = |i: usize| {
-                        let val = msg[i].value();
-                        let var = region.assign_advice(
-                            || format!("load message_{}", i),
-                            config.poseidon_config.state()[i],
-                            0,
-                            || val.ok_or(Error::SynthesisError),
-                        )?;
-                        region.constrain_equal(var, msg[i].cell())?;
-                        Ok(Word::<_, _, OrchardNullifier, 3, 2>::from_inner(
-                            StateWord::new(var, val),
-                        ))
-                    };
-                    Ok([message_word(0)?, message_word(1)?])
-                },
-            )?;
-
-            let poseidon_hasher = PoseidonHash::init(
-                PoseidonChip::construct(config.poseidon_config.clone()),
-                layouter.namespace(|| "Poseidon init"),
-                ConstantLength::<2>,
-            )?;
-
-            let poseidon_output =
-                poseidon_hasher.hash(layouter.namespace(|| "Poseidon hash"), poseidon_message)?;
-
-            let poseidon_output: CellValue<Fp> = poseidon_output.inner().into();
-
-            if !poseidon_output.value().is_none() {
-                coin += poseidon_output.value().unwrap();
-            }
+        let mut hashes = vec![];
+
+        for message in messages.iter() {
+            let hash = {
+                let poseidon_message = layouter.assign_region(
+                    || "load message",
+                    |mut region| {
+                        let mut message_word = |i: usize| {
+                            let value = message[i].value();
+                            let var = region.assign_advice(
+                                || format!("load message_{}", i),
+                                config.poseidon_config.state()[i],
+                                0,
+                                || value.ok_or(Error::SynthesisError),
+                            )?;
+                            region.constrain_equal(var, message[i].cell())?;
+                            Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
+                                var, value,
+                            )))
+                        };
+                        Ok([message_word(0)?, message_word(1)?])
+                    },
+                )?;
+
+                let poseidon_hasher = PoseidonHash::init(
+                    config.poseidon_chip(),
+                    layouter.namespace(|| "Poseidon init"),
+                    ConstantLength::<2>,
+                )?;
+
+                let poseidon_output = poseidon_hasher.hash(
+                    layouter.namespace(|| "Poseidon hash (a, b)"),
+                    poseidon_message,
+                )?;
+
+                let poseidon_output: CellValue<pallas::Base> = poseidon_output.inner().into();
+                poseidon_output
+            };
+
+            hashes.push(hash);
         }
 
-        // if coin != Fp::zero() {
-        // println!("circuit hash: {:?}", coin);
-        // }
-
-        let hash = self.load_private(
-            layouter.namespace(|| "load hash"),
-            config.advices[0],
-            Some(coin),
+        let coin = layouter.assign_region(
+            || " `coin` = hash(a,b) + hash(c, d) + hash(e, f)",
+            |mut region| {
+                config.q_add.enable(&mut region, 0)?;
+
+                copy(&mut region, || "copy ab", config.advices[6], 0, &hashes[0])?;
+                copy(&mut region, || "copy cd", config.advices[7], 0, &hashes[1])?;
+                copy(&mut region, || "copy ef", config.advices[8], 0, &hashes[2])?;
+
+                let scalar_val = hashes[0]
+                    .value()
+                    .zip(hashes[1].value())
+                    .zip(hashes[2].value())
+                    .map(|(abcd, ef)| abcd.0 + abcd.1 + ef);
+
+                let cell = region.assign_advice(
+                    || "hash(a,b)+hash(c,d)+hash(e,f)",
+                    config.advices[5],
+                    0,
+                    || scalar_val.ok_or(Error::SynthesisError),
+                )?;
+                Ok(CellValue::new(cell, scalar_val))
+            },
         )?;
 
-        // Constrain the coin C; index in public values is 0
-        layouter.constrain_instance(hash.cell(), config.primary, 0)?;
+        // Constrain the coin C
+        layouter.constrain_instance(coin.cell(), config.primary, MINT_COIN_OFFSET)?;
 
-        // ====================
-        // = Value commitment =
-        // ====================
+        // ================
+        // Value commitment
+        // ================
 
-        // This constant one is used for multiplication
-        let one = self.load_constant(
-            layouter.namespace(|| "constant one"),
+        // This constant one is used for short multiplication
+        let one = self.load_private(
+            layouter.namespace(|| "load constant one"),
             config.advices[0],
-            Fp::one(),
+            Some(pallas::Base::one()),
         )?;
 
-        // v*G_1
+        // v * G_1
         let (commitment, _) = {
             let value_commit_v = OrchardFixedBases::ValueCommitV;
             let value_commit_v = FixedPoint::from_inner(ecc_chip.clone(), value_commit_v);
             value_commit_v.mul_short(layouter.namespace(|| "[value] ValueCommitV"), (value, one))?
         };
 
-        // r_V*G_2
+        // r_V * G_2
         let (blind, _rcv) = {
             let rcv = self.value_blind;
             let value_commit_r = OrchardFixedBases::ValueCommitR;
@@ -251,137 +391,83 @@ impl Circuit<Fp> for MintCircuit {
             value_commit_r.mul(layouter.namespace(|| "[value_blind] ValueCommitR"), rcv)?
         };
 
-        // Constrain the x and y; indexes in public values are 1 and 2
+        // Constrain the value commitment coordinates
         let value_commit = commitment.add(layouter.namespace(|| "valuecommit"), &blind)?;
-        layouter.constrain_instance(value_commit.inner().x().cell(), config.primary, 1)?;
-        layouter.constrain_instance(value_commit.inner().y().cell(), config.primary, 2)?;
-
-        // ====================
-        // = Asset commitment =
-        // ====================
+        layouter.constrain_instance(
+            value_commit.inner().x().cell(),
+            config.primary,
+            MINT_VALCOMX_OFFSET,
+        )?;
+        layouter.constrain_instance(
+            value_commit.inner().y().cell(),
+            config.primary,
+            MINT_VALCOMY_OFFSET,
+        )?;
 
-        // a*G_1
+        // ================
+        // Asset commitment
+        // ================
+        // a * G_1
         let (commitment, _) = {
             let asset_commit_v = OrchardFixedBases::ValueCommitV;
             let asset_commit_v = FixedPoint::from_inner(ecc_chip.clone(), asset_commit_v);
             asset_commit_v.mul_short(layouter.namespace(|| "[asset] ValueCommitV"), (asset, one))?
         };
 
-        // r_A*G_2
+        // r_A * G_2
         let (blind, _rca) = {
             let rca = self.asset_blind;
             let asset_commit_r = OrchardFixedBases::ValueCommitR;
-            let asset_commit_r = FixedPoint::from_inner(ecc_chip.clone(), asset_commit_r);
+            let asset_commit_r = FixedPoint::from_inner(ecc_chip, asset_commit_r);
             asset_commit_r.mul(layouter.namespace(|| "[asset_blind] ValueCommitR"), rca)?
         };
 
-        // Constrain the x and y; indexes in public values are 3 and 4
+        // Constrain the asset commitment coordinates
         let asset_commit = commitment.add(layouter.namespace(|| "assetcommit"), &blind)?;
-        layouter.constrain_instance(asset_commit.inner().x().cell(), config.primary, 3)?;
-        layouter.constrain_instance(asset_commit.inner().y().cell(), config.primary, 4)?;
-
-        Ok(())
-    }
-}
-
-#[derive(Debug)]
-struct VerifyingKey {
-    params: commitment::Params<vesta::Affine>,
-    vk: plonk::VerifyingKey<vesta::Affine>,
-}
-
-impl VerifyingKey {
-    fn build() -> Self {
-        let params = commitment::Params::new(K);
-        let circuit: MintCircuit = Default::default();
-
-        let vk = plonk::keygen_vk(&params, &circuit).unwrap();
-
-        VerifyingKey { params, vk }
-    }
-}
-
-#[derive(Debug)]
-struct ProvingKey {
-    params: commitment::Params<vesta::Affine>,
-    pk: plonk::ProvingKey<vesta::Affine>,
-}
-
-impl ProvingKey {
-    fn build() -> Self {
-        let params = commitment::Params::new(K);
-        let circuit: MintCircuit = Default::default();
-
-        let vk = plonk::keygen_vk(&params, &circuit).unwrap();
-        let pk = plonk::keygen_pk(&params, vk, &circuit).unwrap();
-
-        ProvingKey { params, pk }
-    }
-}
-
-#[derive(Clone, Debug)]
-struct Proof(Vec<u8>);
-
-impl AsRef<[u8]> for Proof {
-    fn as_ref(&self) -> &[u8] {
-        &self.0
-    }
-}
-
-impl Proof {
-    fn create(pk: &ProvingKey, circuits: &[MintCircuit], pubinputs: &[Fp]) -> Result<Self, Error> {
-        let mut transcript = Blake2bWrite::<_, vesta::Affine, _>::init(vec![]);
-        plonk::create_proof(
-            &pk.params,
-            &pk.pk,
-            circuits,
-            &[&[pubinputs]],
-            &mut transcript,
+        layouter.constrain_instance(
+            asset_commit.inner().x().cell(),
+            config.primary,
+            MINT_ASSCOMX_OFFSET,
+        )?;
+        layouter.constrain_instance(
+            asset_commit.inner().y().cell(),
+            config.primary,
+            MINT_ASSCOMY_OFFSET,
         )?;
-        Ok(Proof(transcript.finalize()))
-    }
 
-    fn verify(&self, vk: &VerifyingKey, pubinputs: &[Fp]) -> Result<(), plonk::Error> {
-        let msm = vk.params.empty_msm();
-        let mut transcript = Blake2bRead::init(&self.0[..]);
-        let guard = plonk::verify_proof(&vk.params, &vk.vk, msm, &[&[pubinputs]], &mut transcript)?;
-        let msm = guard.clone().use_challenges();
-        if msm.eval() {
-            Ok(())
-        } else {
-            Err(Error::ConstraintSystemFailure)
-        }
+        // At this point we've enforced all of our public inputs.
+        Ok(())
     }
-
-    // fn new(bytes: Vec<u8>) -> Self {
-    // Proof(bytes)
-    // }
 }
 
 fn main() {
-    let pubkey = Ep::random(&mut OsRng);
+    // The number of rows in our circuit cannot exceed 2^k
+    let k: u32 = 11;
+
+    let pubkey = pallas::Point::random(&mut OsRng);
     let coords = pubkey.to_affine().coordinates().unwrap();
 
-    let value = 110;
+    let value = 42;
     let asset = 1;
 
-    let value_blind = Fq::random(&mut OsRng);
-    let asset_blind = Fq::random(&mut OsRng);
+    let value_blind = pallas::Scalar::random(&mut OsRng);
+    let asset_blind = pallas::Scalar::random(&mut OsRng);
 
-    let serial = Fp::random(&mut OsRng);
-    let coin_blind = Fp::random(&mut OsRng);
+    let serial = pallas::Base::random(&mut OsRng);
+    let coin_blind = pallas::Base::random(&mut OsRng);
 
-    let mut coin = Fp::zero();
+    // poseidon_hash(x, y) + poseidon_hash(value, asset) + poseidon_hash(serial, coin_blind)
+    let mut coin = pallas::Base::zero();
 
     let messages = [
         [*coords.x(), *coords.y()],
-        [Fp::from(value), Fp::from(asset)],
+        [pallas::Base::from(value), pallas::Base::from(asset)],
         [serial, coin_blind],
     ];
 
-    // TODO: This is a hack until issue is fixed in poseidon gadget
     for msg in messages.iter() {
-        coin += Hash::init(OrchardNullifier, ConstantLength::<2>).hash(*msg);
+        let hash = primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(*msg);
+        coin += hash;
     }
 
     let value_commit = pedersen_commitment(value, value_blind);
@@ -390,7 +476,7 @@ fn main() {
     let asset_commit = pedersen_commitment(asset, asset_blind);
     let asset_coords = asset_commit.to_affine().coordinates().unwrap();
 
-    let mut public_inputs = vec![
+    let public_inputs = vec![
         coin,
         *value_coords.x(),
         *value_coords.y(),
@@ -401,33 +487,22 @@ fn main() {
     let circuit = MintCircuit {
         pub_x: Some(*coords.x()),
         pub_y: Some(*coords.y()),
-        value: Some(vesta::Scalar::from(value)),
-        asset: Some(vesta::Scalar::from(asset)),
+        value: Some(pallas::Base::from(value)),
+        asset: Some(pallas::Base::from(asset)),
         serial: Some(serial),
         coin_blind: Some(coin_blind),
         value_blind: Some(value_blind),
         asset_blind: Some(asset_blind),
     };
 
-    // Valid MockProver
-    let prover = MockProver::run(K, &circuit, vec![public_inputs.clone()]).unwrap();
+    let prover = MockProver::run(k, &circuit, vec![public_inputs.clone()]).unwrap();
     assert_eq!(prover.verify(), Ok(()));
 
-    // Add 1 to break the public inputs
-    public_inputs[0] += Fp::from(0xdeadbeef);
-
-    // Invalid MockProver
-    let prover = MockProver::run(K, &circuit, vec![public_inputs.clone()]).unwrap();
-    assert!(prover.verify().is_err());
-
-    // Remove 1 to make the public inputs valid again
-    public_inputs[0] -= Fp::from(0xdeadbeef);
-
     // Actual ZK proof
     let start = Instant::now();
-    let vk = VerifyingKey::build();
-    let pk = ProvingKey::build();
-    println!("\nSetup: [{:?}]", start.elapsed());
+    let vk = VerifyingKey::build(k, MintCircuit::default());
+    let pk = ProvingKey::build(k, MintCircuit::default());
+    println!("Setup: [{:?}]", start.elapsed());
 
     let start = Instant::now();
     let proof = Proof::create(&pk, &[circuit], &public_inputs).unwrap();

+ 53 - 199
example/halo2/src/bin/poseidon.rs

@@ -1,80 +1,58 @@
-use std::convert::TryInto;
-use std::time::Instant;
-
 use halo2::{
-    circuit::{floor_planner, Layouter},
-    pasta::{vesta, Fp},
-    plonk,
-    plonk::{
-        Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector,
-    },
-    poly::{commitment, Rotation},
-    transcript::{Blake2bRead, Blake2bWrite},
+    circuit::{Layouter, SimpleFloorPlanner},
+    dev::MockProver,
+    plonk::{Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn},
 };
-
-use halo2_poseidon::{
-    gadget::{Hash as PoseidonHash, Word},
-    pow5t3::{Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig, StateWord},
-    primitive::{ConstantLength, Hash, P128Pow5T3 as OrchardNullifier},
+use halo2_gadgets::{
+    poseidon::{Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig},
+    primitives,
+    primitives::poseidon::{ConstantLength, P128Pow5T3},
+    utilities::{CellValue, UtilitiesInstructions, Var},
 };
-use halo2_utilities::{copy, CellValue, UtilitiesInstructions, Var};
-
-const K: u32 = 6;
+use pasta_curves::pallas;
 
-#[derive(Clone, Debug)]
+#[derive(Clone)]
 struct Config {
     primary: Column<InstanceColumn>,
-    q_add: Selector,
-    advices: [Column<Advice>; 10],
-    poseidon_config: PoseidonConfig<Fp>,
+    advices: [Column<Advice>; 5],
+    poseidon_config: PoseidonConfig<pallas::Base>,
+}
+
+impl Config {
+    fn poseidon_chip(&self) -> PoseidonChip<pallas::Base> {
+        PoseidonChip::construct(self.poseidon_config.clone())
+    }
 }
 
-#[derive(Default, Debug)]
+#[derive(Default)]
 struct HashCircuit {
-    a: Option<Fp>, // First input for hash
-    b: Option<Fp>, // Second input for hash
-    c: Option<Fp>, // c is summed with hash
+    a: Option<pallas::Base>,
+    b: Option<pallas::Base>,
+    c: Option<pallas::Base>,
+    d: Option<pallas::Base>,
 }
 
-impl UtilitiesInstructions<Fp> for HashCircuit {
-    type Var = CellValue<Fp>;
+impl UtilitiesInstructions<pallas::Base> for HashCircuit {
+    type Var = CellValue<pallas::Base>;
 }
 
-impl Circuit<Fp> for HashCircuit {
+impl Circuit<pallas::Base> for HashCircuit {
     type Config = Config;
-    type FloorPlanner = floor_planner::V1;
+    type FloorPlanner = SimpleFloorPlanner;
 
     fn without_witnesses(&self) -> Self {
         Self::default()
     }
 
-    fn configure(meta: &mut ConstraintSystem<Fp>) -> Self::Config {
-        // 10 advice columns
+    fn configure(meta: &mut ConstraintSystem<pallas::Base>) -> Self::Config {
         let advices = [
             meta.advice_column(),
             meta.advice_column(),
             meta.advice_column(),
             meta.advice_column(),
             meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
         ];
 
-        // Addition of two field elements: poseidon_hash(a, b) + c
-        let q_add = meta.selector();
-
-        meta.create_gate("poseidon_hash(a, b) + c", |meta| {
-            let q_add = meta.query_selector(q_add);
-            let sum = meta.query_advice(advices[6], Rotation::cur());
-            let hash = meta.query_advice(advices[7], Rotation::cur());
-            let c = meta.query_advice(advices[8], Rotation::cur());
-
-            vec![q_add * (hash + c - sum)]
-        });
-
         let primary = meta.instance_column();
         meta.enable_equality(primary.into());
 
@@ -100,16 +78,15 @@ impl Circuit<Fp> for HashCircuit {
 
         let poseidon_config = PoseidonChip::configure(
             meta,
-            OrchardNullifier,
-            advices[6..9].try_into().unwrap(),
-            advices[5],
+            P128Pow5T3,
+            advices[1..4].try_into().unwrap(),
+            advices[4],
             rc_a,
             rc_b,
         );
 
         Config {
             primary,
-            q_add,
             advices,
             poseidon_config,
         }
@@ -118,40 +95,20 @@ impl Circuit<Fp> for HashCircuit {
     fn synthesize(
         &self,
         config: Self::Config,
-        mut layouter: impl Layouter<Fp>,
+        mut layouter: impl Layouter<pallas::Base>,
     ) -> Result<(), Error> {
         let a = self.load_private(layouter.namespace(|| "load a"), config.advices[0], self.a)?;
         let b = self.load_private(layouter.namespace(|| "load b"), config.advices[0], self.b)?;
         let c = self.load_private(layouter.namespace(|| "load c"), config.advices[0], self.c)?;
+        let d = self.load_private(layouter.namespace(|| "load d"), config.advices[0], self.d)?;
 
         let hash = {
-            let message = [a, b];
-
-            let poseidon_message = layouter.assign_region(
-                || "load message",
-                |mut region| {
-                    let mut message_word = |i: usize| {
-                        let value = message[i].value();
-                        let var = region.assign_advice(
-                            || format!("load message_{}", i),
-                            config.poseidon_config.state()[i],
-                            0,
-                            || value.ok_or(Error::SynthesisError),
-                        )?;
-                        region.constrain_equal(var, message[i].cell())?;
-                        Ok(Word::<_, _, OrchardNullifier, 3, 2>::from_inner(
-                            StateWord::new(var, value),
-                        ))
-                    };
-                    Ok([message_word(0)?, message_word(1)?])
-                },
-            )?;
+            let poseidon_message = [a, b, c, d];
 
-            let poseidon_hasher = PoseidonHash::init(
-                //config.poseidon_chip(),
-                PoseidonChip::construct(config.poseidon_config.clone()),
+            let poseidon_hasher = PoseidonHash::<_, _, P128Pow5T3, _, 3, 2>::init(
+                config.poseidon_chip(),
                 layouter.namespace(|| "Poseidon init"),
-                ConstantLength::<2>,
+                ConstantLength::<4>,
             )?;
 
             let poseidon_output = poseidon_hasher.hash(
@@ -159,140 +116,37 @@ impl Circuit<Fp> for HashCircuit {
                 poseidon_message,
             )?;
 
-            let poseidon_output: CellValue<Fp> = poseidon_output.inner().into();
+            let poseidon_output: CellValue<pallas::Base> = poseidon_output.inner().into();
             poseidon_output
         };
 
-        // Add hash output to c
-        let scalar = layouter.assign_region(
-            || " `scalar` = poseidon_hash(a, b) + c",
-            |mut region| {
-                config.q_add.enable(&mut region, 0)?;
-
-                copy(&mut region, || "copy hash", config.advices[7], 0, &hash)?;
-                copy(&mut region, || "copy c", config.advices[8], 0, &c)?;
-
-                let scalar_val = hash.value().zip(c.value()).map(|(hash, c)| hash + c);
-
-                let cell = region.assign_advice(
-                    || "poseidon_hash(a, b) + c",
-                    config.advices[6],
-                    0,
-                    || scalar_val.ok_or(Error::SynthesisError),
-                )?;
-                Ok(CellValue::new(cell, scalar_val))
-            },
-        )?;
-
-        layouter.constrain_instance(scalar.cell(), config.primary, 0)
-    }
-}
-
-#[derive(Debug)]
-struct VerifyingKey {
-    params: commitment::Params<vesta::Affine>,
-    vk: plonk::VerifyingKey<vesta::Affine>,
-}
-
-impl VerifyingKey {
-    fn build() -> Self {
-        let params = commitment::Params::new(K);
-        let circuit: HashCircuit = Default::default();
-
-        let vk = plonk::keygen_vk(&params, &circuit).unwrap();
-
-        VerifyingKey { params, vk }
-    }
-}
-
-#[derive(Debug)]
-struct ProvingKey {
-    params: commitment::Params<vesta::Affine>,
-    pk: plonk::ProvingKey<vesta::Affine>,
-}
-
-impl ProvingKey {
-    fn build() -> Self {
-        let params = commitment::Params::new(K);
-        let circuit: HashCircuit = Default::default();
-
-        let vk = plonk::keygen_vk(&params, &circuit).unwrap();
-        let pk = plonk::keygen_pk(&params, vk, &circuit).unwrap();
-
-        ProvingKey { params, pk }
-    }
-}
-
-#[derive(Clone, Debug)]
-struct Proof(Vec<u8>);
-
-impl AsRef<[u8]> for Proof {
-    fn as_ref(&self) -> &[u8] {
-        &self.0
-    }
-}
-
-impl Proof {
-    fn create(pk: &ProvingKey, circuits: &[HashCircuit], pubinputs: &[Fp]) -> Result<Self, Error> {
-        let mut transcript = Blake2bWrite::<_, vesta::Affine, _>::init(vec![]);
-        plonk::create_proof(
-            &pk.params,
-            &pk.pk,
-            circuits,
-            &[&[pubinputs]],
-            &mut transcript,
-        )?;
-        Ok(Proof(transcript.finalize()))
-    }
+        layouter.constrain_instance(hash.cell(), config.primary, 0)?;
 
-    fn verify(&self, vk: &VerifyingKey, pubinputs: &[Fp]) -> Result<(), plonk::Error> {
-        let msm = vk.params.empty_msm();
-        let mut transcript = Blake2bRead::init(&self.0[..]);
-        let guard = plonk::verify_proof(&vk.params, &vk.vk, msm, &[&[pubinputs]], &mut transcript)?;
-        let msm = guard.clone().use_challenges();
-        if msm.eval() {
-            Ok(())
-        } else {
-            Err(Error::ConstraintSystemFailure)
-        }
+        Ok(())
     }
-
-    // fn new(bytes: Vec<u8>) -> Self {
-    // Proof(bytes)
-    // }
 }
 
 fn main() {
-    let a = Fp::from(13);
-    let b = Fp::from(69);
-    let c = Fp::from(42);
+    // The number of rows in our circuit cannot exceed 2^k
+    let k: u32 = 9;
+
+    let a = pallas::Base::from(1);
+    let b = pallas::Base::from(2);
+    let c = pallas::Base::from(3);
+    let d = pallas::Base::from(4);
 
-    let message = [a, b];
-    let output = Hash::init(OrchardNullifier, ConstantLength::<2>).hash(message);
+    let message = [a, b, c, d];
+    let hash = primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<4>).hash(message);
 
     let circuit = HashCircuit {
         a: Some(a),
         b: Some(b),
         c: Some(c),
+        d: Some(d),
     };
 
-    let sum = output + c;
-
-    // Correct:
-    let public_inputs = vec![sum];
-    // Incorrect:
-    // let public_inputs = vec![sum + Fp::one()];
-
-    let start = Instant::now();
-    let vk = VerifyingKey::build();
-    let pk = ProvingKey::build();
-    println!("Setup: [{:?}]", start.elapsed());
-
-    let start = Instant::now();
-    let proof = Proof::create(&pk, &[circuit], &public_inputs).unwrap();
-    println!("Prove: [{:?}]", start.elapsed());
+    let public_inputs = vec![hash];
 
-    let start = Instant::now();
-    assert!(proof.verify(&vk, &public_inputs).is_ok());
-    println!("Verify: [{:?}]", start.elapsed());
+    let prover = MockProver::run(k, &circuit, vec![public_inputs]).unwrap();
+    assert_eq!(prover.verify(), Ok(()));
 }

+ 8 - 28
examples/halo2/src/bin/poseidon.rs → example/halo2/src/bin/poseidon_add.rs

@@ -9,10 +9,7 @@ use halo2::{
     poly::Rotation,
 };
 use halo2_gadgets::{
-    poseidon::{
-        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
-        StateWord, Word,
-    },
+    poseidon::{Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig},
     primitives,
     primitives::poseidon::{ConstantLength, P128Pow5T3},
     utilities::{copy, CellValue, UtilitiesInstructions, Var},
@@ -138,29 +135,9 @@ impl Circuit<pallas::Base> for HashCircuit {
         let c = self.load_private(layouter.namespace(|| "load c"), config.advices[0], self.c)?;
 
         let hash = {
-            let message = [a, b];
-
-            let poseidon_message = layouter.assign_region(
-                || "load message",
-                |mut region| {
-                    let mut message_word = |i: usize| {
-                        let value = message[i].value();
-                        let var = region.assign_advice(
-                            || format!("load message_{}", i),
-                            config.poseidon_config.state()[i],
-                            0,
-                            || value.ok_or(Error::SynthesisError),
-                        )?;
-                        region.constrain_equal(var, message[i].cell())?;
-                        Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
-                            var, value,
-                        )))
-                    };
-                    Ok([message_word(0)?, message_word(1)?])
-                },
-            )?;
+            let poseidon_message = [a, b];
 
-            let poseidon_hasher = PoseidonHash::init(
+            let poseidon_hasher = PoseidonHash::<_, _, P128Pow5T3, _, 3, 2>::init(
                 config.poseidon_chip(),
                 layouter.namespace(|| "Poseidon init"),
                 ConstantLength::<2>,
@@ -235,14 +212,17 @@ fn main() {
 
     // Actual ZK proof
     let start = Instant::now();
-    let vk = VerifyingKey::build(k, HashCircuit::default());
     let pk = ProvingKey::build(k, HashCircuit::default());
-    println!("Setup: [{:?}]", start.elapsed());
+    println!("Setup Prover: [{:?}]", start.elapsed());
 
     let start = Instant::now();
     let proof = Proof::create(&pk, &[circuit], &public_inputs).unwrap();
     println!("Prove: [{:?}]", start.elapsed());
 
+    let start = Instant::now();
+    let vk = VerifyingKey::build(k, HashCircuit::default());
+    println!("Setup Verifier: [{:?}]", start.elapsed());
+
     let start = Instant::now();
     assert!(proof.verify(&vk, &public_inputs).is_ok());
     println!("Verify: [{:?}]", start.elapsed());

+ 0 - 130
example/halo2/src/bin/simple3.rs

@@ -1,130 +0,0 @@
-use halo2::{
-    circuit::{SimpleFloorPlanner, Chip, Layouter},
-    pasta::{EqAffine, Fp},
-    plonk::{Advice, Circuit, Column, ConstraintSystem, Error, Expression, Selector, create_proof, verify_proof, keygen_vk, keygen_pk},
-    poly::{commitment::Params, Rotation},
-    transcript::{Blake2bRead, Blake2bWrite, Challenge255},
-};
-use std::time::Instant;
-
-#[derive(Clone, Debug)]
-struct CoolConfig {
-    a_col: Column<Advice>,
-    s_range: Selector,
-}
-
-struct CoolChip {
-    config: CoolConfig
-}
-
-impl Chip<Fp> for CoolChip {
-    type Config = CoolConfig;
-    type Loaded = ();
-
-    fn config(&self) -> &Self::Config {
-        &self.config
-    }
-
-    fn loaded(&self) -> &Self::Loaded {
-        &()
-    }
-}
-
-impl CoolChip {
-    fn construct(config: CoolConfig) -> Self {
-        Self { config }
-    }
-
-    fn configure(cs: &mut ConstraintSystem<Fp>) -> CoolConfig {
-        let a_col = cs.advice_column();
-        let s_range = cs.selector();
-
-        cs.create_gate("check", |cs| {
-            let a = cs.query_advice(a_col, Rotation::cur());
-            let s_range = cs.query_selector(s_range);
-            vec![s_range * (a - Expression::Constant(Fp::from(2)))]
-        });
-
-        CoolConfig { a_col, s_range }
-    }
-
-    fn alloc_and_check(
-        &self,
-        layouter: &mut impl Layouter<Fp>,
-        a: Option<Fp>,
-    ) -> Result<(), Error> {
-        layouter.assign_region(
-            || "load private inputs",
-            |mut region| {
-                let row_offset = 0;
-                self.config.s_range.enable(&mut region, row_offset)?;
-                region.assign_advice(
-                    || "private input 'a'",
-                    self.config.a_col,
-                    row_offset,
-                    || a.ok_or(Error::SynthesisError),
-                )?;
-                Ok(())
-            },
-        )
-    }
-}
-
-#[derive(Clone)]
-struct CoolCircuit {
-    // Private input.
-    a: Option<Fp>,
-}
-
-impl Circuit<Fp> for CoolCircuit {
-    type Config = CoolConfig;
-    type FloorPlanner = SimpleFloorPlanner;
-
-    fn without_witnesses(&self) -> Self {
-        Self { a: None }
-    }
-
-    fn configure(cs: &mut ConstraintSystem<Fp>) -> Self::Config {
-        CoolChip::configure(cs)
-    }
-
-    fn synthesize(&self, config: Self::Config, mut layouter: impl Layouter<Fp>) -> Result<(), Error> {
-        let chip = CoolChip::construct(config);
-        chip.alloc_and_check(&mut layouter, self.a)
-    }
-}
-
-fn main() {
-    let start = Instant::now();
-    let params: Params<EqAffine> = Params::new(4);
-
-    let empty_circuit = CoolCircuit { a: None };
-    let vk = keygen_vk(&params, &empty_circuit).expect("keygen_vk should not fail");
-    let pk = keygen_pk(&params, vk, &empty_circuit).expect("keygen_pk should not fail");
-    println!("Setup: [{:?}]", start.elapsed());
-
-    let start = Instant::now();
-    let circuit = CoolCircuit {
-        a: Some(Fp::from(2)),
-    };
-
-    // Create a proof
-    let mut transcript = Blake2bWrite::<_, _, Challenge255<_>>::init(vec![]);
-    create_proof(&params, &pk, &[circuit], &[&[]], &mut transcript)
-        .expect("proof generation should not fail");
-    let proof = transcript.finalize();
-    println!("Prove: [{:?}]", start.elapsed());
-
-    let start = Instant::now();
-    let msm = params.empty_msm();
-    let mut transcript = Blake2bRead::<_, _, Challenge255<_>>::init(&proof[..]);
-    let verification = verify_proof(&params, pk.get_vk(), msm, &[&[]], &mut transcript);
-    if let Err(err) = verification {
-        panic!("error {:?}", err);
-    }
-    let guard = verification.unwrap();
-    let msm = guard.clone().use_challenges();
-    assert!(msm.eval());
-    println!("Verify: [{:?}]", start.elapsed());
-}
-

+ 0 - 267
example/halo2/src/bin/simple4.rs

@@ -1,267 +0,0 @@
-use halo2::{
-    circuit::{SimpleFloorPlanner, Cell, Chip, Layouter},
-    pasta::{EqAffine, Fp},
-    plonk::{Advice, Any, Circuit, Column, ConstraintSystem, Error, Expression, Selector, create_proof, verify_proof, keygen_vk, keygen_pk, Permutation},
-    poly::{commitment::{Blind, Params}, Rotation},
-    transcript::{Blake2bRead, Blake2bWrite, Challenge255},
-};
-use group::Curve;
-use std::time::Instant;
-
-#[derive(Clone, Debug)]
-struct CoolConfig {
-    a_col: Column<Advice>,
-    b_col: Column<Advice>,
-    permute: Permutation,
-    s_range: Selector,
-    s_mul: Selector,
-    s_pub: Selector,
-}
-
-struct CoolChip {
-    config: CoolConfig
-}
-
-impl Chip<Fp> for CoolChip {
-    type Config = CoolConfig;
-    type Loaded = ();
-
-    fn config(&self) -> &Self::Config {
-        &self.config
-    }
-
-    fn loaded(&self) -> &Self::Loaded {
-        &()
-    }
-}
-
-#[derive(Clone, Debug)]
-struct Number {
-    cell: Cell,
-    value: Option<Fp>,
-}
-
-impl CoolChip {
-    fn construct(config: CoolConfig) -> Self {
-        Self { config }
-    }
-
-    fn configure(cs: &mut ConstraintSystem<Fp>) -> CoolConfig {
-        let a_col = cs.advice_column();
-        let b_col = cs.advice_column();
-
-        let instance = cs.instance_column();
-
-        let permute = {
-            // Convert advice columns into an "any" columns.
-            let cols: [Column<Any>; 2] = [a_col.into(), b_col.into()];
-            Permutation::new(cs, &cols)
-        };
-
-        let s_range = cs.selector();
-        let s_mul = cs.selector();
-        let s_pub = cs.selector();
-
-        cs.create_gate("check", |cs| {
-            let a = cs.query_advice(a_col, Rotation::cur());
-            let s_range = cs.query_selector(s_range);
-            vec![s_range * (a - Expression::Constant(Fp::from(2)))]
-        });
-
-        cs.create_gate("mul", |cs| {
-            let lhs = cs.query_advice(a_col, Rotation::cur());
-            let rhs = cs.query_advice(b_col, Rotation::cur());
-            let out = cs.query_advice(a_col, Rotation::next());
-            let s_mul = cs.query_selector(s_mul);
-
-            vec![s_mul * (lhs * rhs + out * -Fp::one())]
-        });
-
-        cs.create_gate("public input", |cs| {
-            let a = cs.query_advice(b_col, Rotation::cur());
-            let p = cs.query_instance(instance, Rotation::cur());
-            let s = cs.query_selector(s_pub);
-
-            vec![s * (p + a * -Fp::one())]
-        });
-
-        CoolConfig { a_col, b_col, permute, s_range, s_mul, s_pub }
-    }
-
-    fn alloc_left(
-        &self,
-        layouter: &mut impl Layouter<Fp>,
-        value: Option<Fp>
-    ) -> Result<Number, Error> {
-        layouter.assign_region(
-            || "load left private input",
-            |mut region| {
-                let cell = region.assign_advice(
-                    || "private input 'a'",
-                    self.config.a_col,
-                    0,
-                    || value.ok_or(Error::SynthesisError),
-                )?;
-                Ok(Number { cell, value })
-            }
-        )
-    }
-
-    fn check(
-        &self,
-        layouter: &mut impl Layouter<Fp>,
-        number: Number
-    ) -> Result<(), Error> {
-        layouter.assign_region(
-            || "load private inputs",
-            |mut region| {
-                self.config.s_range.enable(&mut region, 0)?;
-
-                let a = region.assign_advice(
-                    || "lhs",
-                    self.config.a_col,
-                    0,
-                    || number.value.ok_or(Error::SynthesisError),
-                )?;
-                region.constrain_equal(&self.config.permute, number.cell, a)?;
-
-                Ok(())
-            },
-        )
-    }
-
-    fn mul(
-        &self,
-        layouter: &mut impl Layouter<Fp>,
-        a: Number,
-        b: Number
-    ) -> Result<Number, Error> {
-        let mut out = None;
-        layouter.assign_region(
-            || "mul",
-            |mut region| {
-                self.config.s_mul.enable(&mut region, 0)?;
-
-                let lhs = region.assign_advice(
-                    || "lhs",
-                    self.config.a_col,
-                    0,
-                    || a.value.ok_or(Error::SynthesisError),
-                )?;
-                let rhs = region.assign_advice(
-                    || "rhs",
-                    self.config.b_col,
-                    0,
-                    || b.value.ok_or(Error::SynthesisError),
-                )?;
-                region.constrain_equal(&self.config.permute, a.cell, lhs)?;
-                region.constrain_equal(&self.config.permute, b.cell, rhs)?;
-
-                let value = a.value.and_then(|a| b.value.map(|b| a * b));
-                let cell = region.assign_advice(
-                    || "lhs * rhs",
-                    self.config.a_col,
-                    1,
-                    || value.ok_or(Error::SynthesisError),
-                )?;
-
-                out = Some(Number { cell, value });
-                Ok(())
-            },
-        )?;
-
-        Ok(out.unwrap())
-    }
-
-    fn expose_public(&self, layouter: &mut impl Layouter<Fp>, num: Number) -> Result<(), Error> {
-        layouter.assign_region(
-            || "expose public",
-            |mut region| {
-                self.config.s_pub.enable(&mut region, 0)?;
-
-                let out = region.assign_advice(
-                    || "public advice",
-                    self.config.b_col,
-                    0,
-                    || num.value.ok_or(Error::SynthesisError),
-                )?;
-                region.constrain_equal(&self.config.permute, num.cell, out)?;
-
-                Ok(())
-            },
-        )
-    }
-}
-
-#[derive(Clone)]
-struct CoolCircuit {
-    // Private input.
-    a: Option<Fp>,
-}
-
-impl Circuit<Fp> for CoolCircuit {
-    type Config = CoolConfig;
-    type FloorPlanner = SimpleFloorPlanner;
-
-    fn without_witnesses(&self) -> Self {
-        Self { a: None }
-    }
-
-    fn configure(cs: &mut ConstraintSystem<Fp>) -> Self::Config {
-        CoolChip::configure(cs)
-    }
-
-    fn synthesize(&self, config: Self::Config, mut layouter: impl Layouter<Fp>) -> Result<(), Error> {
-        let chip = CoolChip::construct(config);
-        let a = chip.alloc_left(&mut layouter, self.a)?;
-        chip.check(&mut layouter, a.clone())?;
-        let a2 = chip.mul(&mut layouter, a.clone(), a)?;
-        chip.expose_public(&mut layouter, a2)?;
-        Ok(())
-    }
-}
-
-fn main() {
-    let k = 6;
-
-    let start = Instant::now();
-    let params: Params<EqAffine> = Params::new(k);
-
-    let empty_circuit = CoolCircuit { a: None };
-    let vk = keygen_vk(&params, &empty_circuit).expect("keygen_vk should not fail");
-    let pk = keygen_pk(&params, vk, &empty_circuit).expect("keygen_pk should not fail");
-    println!("Setup: [{:?}]", start.elapsed());
-
-    let start = Instant::now();
-    let circuit = CoolCircuit {
-        a: Some(Fp::from(2)),
-    };
-
-    let mut public_inputs = pk.get_vk().get_domain().empty_lagrange();
-    public_inputs[4] = Fp::from(4);
-
-    // Create a proof
-    let mut transcript = Blake2bWrite::<_, _, Challenge255<_>>::init(vec![]);
-    create_proof(&params, &pk, &[circuit], &[&[public_inputs.clone()]], &mut transcript)
-        .expect("proof generation should not fail");
-    let proof = transcript.finalize();
-    println!("Prove: [{:?}]", start.elapsed());
-
-    let pubinput = params
-        .commit_lagrange(&public_inputs, Blind::default())
-        .to_affine();
-    let pubinput_slice = &[pubinput];
-
-    let start = Instant::now();
-    let msm = params.empty_msm();
-    let mut transcript = Blake2bRead::<_, _, Challenge255<_>>::init(&proof[..]);
-    let verification = verify_proof(&params, pk.get_vk(), msm, &[pubinput_slice], &mut transcript);
-    if let Err(err) = verification {
-        panic!("error {:?}", err);
-    }
-    let guard = verification.unwrap();
-    let msm = guard.clone().use_challenges();
-    assert!(msm.eval());
-    println!("Verify: [{:?}]", start.elapsed());
-}
-

+ 0 - 16
example/halo2/src/circuit.rs

@@ -1,16 +0,0 @@
-use halo2::{
-    pasta::pallas,
-    plonk::{Advice, Column, Instance as InstanceColumn, Selector},
-};
-
-use halo2_ecc::chip::EccConfig;
-use halo2_poseidon::pow5t3::Pow5T3Config as PoseidonConfig;
-
-#[derive(Clone, Debug)]
-pub struct Config {
-    pub primary: Column<InstanceColumn>,
-    pub q_add: Selector,
-    pub advices: [Column<Advice>; 10],
-    pub ecc_config: EccConfig,
-    pub poseidon_config: PoseidonConfig<pallas::Base>,
-}

+ 0 - 0
examples/halo2/src/constants.rs → example/halo2/src/constants.rs


+ 0 - 0
examples/halo2/src/constants/fixed_bases.rs → example/halo2/src/constants/fixed_bases.rs


+ 0 - 0
examples/halo2/src/constants/fixed_bases/commit_ivk_r.rs → example/halo2/src/constants/fixed_bases/commit_ivk_r.rs


+ 0 - 0
examples/halo2/src/constants/fixed_bases/note_commit_r.rs → example/halo2/src/constants/fixed_bases/note_commit_r.rs


+ 0 - 0
examples/halo2/src/constants/fixed_bases/nullifier_k.rs → example/halo2/src/constants/fixed_bases/nullifier_k.rs


+ 0 - 0
examples/halo2/src/constants/fixed_bases/spend_auth_g.rs → example/halo2/src/constants/fixed_bases/spend_auth_g.rs


+ 0 - 0
examples/halo2/src/constants/fixed_bases/value_commit_r.rs → example/halo2/src/constants/fixed_bases/value_commit_r.rs


+ 0 - 0
examples/halo2/src/constants/fixed_bases/value_commit_v.rs → example/halo2/src/constants/fixed_bases/value_commit_v.rs


+ 0 - 0
examples/halo2/src/constants/sinsemilla.rs → example/halo2/src/constants/sinsemilla.rs


+ 0 - 0
examples/halo2/src/constants/util.rs → example/halo2/src/constants/util.rs


+ 0 - 0
examples/halo2/src/crypto.rs → example/halo2/src/crypto.rs


+ 137 - 0
example/halo2/src/endian.rs

@@ -0,0 +1,137 @@
+macro_rules! define_slice_to_be {
+    ($name: ident, $type: ty) => {
+        #[inline]
+        pub fn $name(slice: &[u8]) -> $type {
+            assert_eq!(slice.len(), ::std::mem::size_of::<$type>());
+            let mut res = 0;
+            for i in 0..::std::mem::size_of::<$type>() {
+                res |= (slice[i] as $type) << (::std::mem::size_of::<$type>() - i - 1) * 8;
+            }
+            res
+        }
+    };
+}
+macro_rules! define_slice_to_le {
+    ($name: ident, $type: ty) => {
+        #[inline]
+        pub fn $name(slice: &[u8]) -> $type {
+            assert_eq!(slice.len(), ::std::mem::size_of::<$type>());
+            let mut res = 0;
+            for i in 0..::std::mem::size_of::<$type>() {
+                res |= (slice[i] as $type) << i * 8;
+            }
+            res
+        }
+    };
+}
+macro_rules! define_be_to_array {
+    ($name: ident, $type: ty, $byte_len: expr) => {
+        #[inline]
+        pub fn $name(val: $type) -> [u8; $byte_len] {
+            assert_eq!(::std::mem::size_of::<$type>(), $byte_len); // size_of isn't a constfn in 1.22
+            let mut res = [0; $byte_len];
+            for i in 0..$byte_len {
+                res[i] = ((val >> ($byte_len - i - 1) * 8) & 0xff) as u8;
+            }
+            res
+        }
+    };
+}
+macro_rules! define_le_to_array {
+    ($name: ident, $type: ty, $byte_len: expr) => {
+        #[inline]
+        pub fn $name(val: $type) -> [u8; $byte_len] {
+            assert_eq!(::std::mem::size_of::<$type>(), $byte_len); // size_of isn't a constfn in 1.22
+            let mut res = [0; $byte_len];
+            for i in 0..$byte_len {
+                res[i] = ((val >> i * 8) & 0xff) as u8;
+            }
+            res
+        }
+    };
+}
+
+define_slice_to_be!(slice_to_u32_be, u32);
+define_be_to_array!(u32_to_array_be, u32, 4);
+define_slice_to_le!(slice_to_u16_le, u16);
+define_slice_to_le!(slice_to_u32_le, u32);
+define_slice_to_le!(slice_to_u64_le, u64);
+define_le_to_array!(u16_to_array_le, u16, 2);
+define_le_to_array!(u32_to_array_le, u32, 4);
+define_le_to_array!(u64_to_array_le, u64, 8);
+
+#[inline]
+pub fn i16_to_array_le(val: i16) -> [u8; 2] {
+    u16_to_array_le(val as u16)
+}
+#[inline]
+pub fn slice_to_i16_le(slice: &[u8]) -> i16 {
+    slice_to_u16_le(slice) as i16
+}
+#[inline]
+pub fn slice_to_i32_le(slice: &[u8]) -> i32 {
+    slice_to_u32_le(slice) as i32
+}
+#[inline]
+pub fn i32_to_array_le(val: i32) -> [u8; 4] {
+    u32_to_array_le(val as u32)
+}
+#[inline]
+pub fn slice_to_i64_le(slice: &[u8]) -> i64 {
+    slice_to_u64_le(slice) as i64
+}
+#[inline]
+pub fn i64_to_array_le(val: i64) -> [u8; 8] {
+    u64_to_array_le(val as u64)
+}
+
+macro_rules! define_chunk_slice_to_int {
+    ($name: ident, $type: ty, $converter: ident) => {
+        #[inline]
+        pub fn $name(inp: &[u8], outp: &mut [$type]) {
+            assert_eq!(inp.len(), outp.len() * ::std::mem::size_of::<$type>());
+            for (outp_val, data_bytes) in outp
+                .iter_mut()
+                .zip(inp.chunks(::std::mem::size_of::<$type>()))
+            {
+                *outp_val = $converter(data_bytes);
+            }
+        }
+    };
+}
+define_chunk_slice_to_int!(bytes_to_u64_slice_le, u64, slice_to_u64_le);
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn endianness_test() {
+        assert_eq!(slice_to_u32_be(&[0xde, 0xad, 0xbe, 0xef]), 0xdeadbeef);
+        assert_eq!(u32_to_array_be(0xdeadbeef), [0xde, 0xad, 0xbe, 0xef]);
+
+        assert_eq!(slice_to_u16_le(&[0xad, 0xde]), 0xdead);
+        assert_eq!(slice_to_u32_le(&[0xef, 0xbe, 0xad, 0xde]), 0xdeadbeef);
+        assert_eq!(
+            slice_to_u64_le(&[0xef, 0xbe, 0xad, 0xde, 0xfe, 0xca, 0xad, 0x1b]),
+            0x1badcafedeadbeef
+        );
+        assert_eq!(u16_to_array_le(0xdead), [0xad, 0xde]);
+        assert_eq!(u32_to_array_le(0xdeadbeef), [0xef, 0xbe, 0xad, 0xde]);
+        assert_eq!(
+            u64_to_array_le(0x1badcafedeadbeef),
+            [0xef, 0xbe, 0xad, 0xde, 0xfe, 0xca, 0xad, 0x1b]
+        );
+    }
+
+    #[test]
+    fn endian_chunk_test() {
+        let inp = [
+            0xef, 0xbe, 0xad, 0xde, 0xfe, 0xca, 0xad, 0x1b, 0xfe, 0xca, 0xad, 0x1b, 0xce, 0xfa,
+            0x01, 0x02,
+        ];
+        let mut out = [0; 2];
+        bytes_to_u64_slice_le(&inp, &mut out);
+        assert_eq!(out, [0x1badcafedeadbeef, 0x0201face1badcafe]);
+    }
+}

+ 113 - 0
example/halo2/src/error.rs

@@ -0,0 +1,113 @@
+use std::fmt;
+
+pub type Result<T> = std::result::Result<T, Error>;
+
+#[derive(Debug, Clone)]
+pub enum Error {
+    Io(std::io::ErrorKind),
+    /// VarInt was encoded in a non-minimal way
+    PathNotFound,
+    NonMinimalVarInt,
+    /// Parsing error
+    ParseFailed(&'static str),
+    ParseIntError,
+    AsyncChannelError,
+    MalformedPacket,
+    AddrParseError,
+    BadVariableRefType,
+    BadOperationType,
+    BadConstraintType,
+    InvalidParamName,
+    InvalidParamType,
+    MissingParams,
+    VmError,
+    BadContract,
+    Groth16Error,
+    RusqliteError(String),
+    OperationFailed,
+    ConnectFailed,
+    ConnectTimeout,
+    ChannelStopped,
+    ChannelTimeout,
+    ServiceStopped,
+    Utf8Error,
+    StrUtf8Error(String),
+    NoteDecryptionFailed,
+    ServicesError(&'static str),
+    ZmqError(String),
+    VerifyFailed,
+    TryIntoError,
+    TryFromError,
+    JsonRpcError(String),
+    RocksdbError(String),
+    TreeFull,
+    SerdeJsonError(String),
+    SurfHttpError(String),
+    EmptyPassword,
+    TomlDeserializeError(String),
+    TomlSerializeError(String),
+    CashierNoReply,
+    Base58EncodeError(String),
+    Base58DecodeError(String),
+    BadBTCAddress(String),
+}
+
+impl std::error::Error for Error {}
+
+impl fmt::Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result {
+        match *self {
+            Error::PathNotFound => f.write_str("Cannot find home directory"),
+            Error::Io(ref err) => write!(f, "io error:{:?}", err),
+            Error::NonMinimalVarInt => f.write_str("non-minimal varint"),
+            Error::ParseFailed(ref err) => write!(f, "parse failed: {}", err),
+            Error::ParseIntError => f.write_str("Parse int error"),
+            Error::AsyncChannelError => f.write_str("Async_channel error"),
+            Error::MalformedPacket => f.write_str("Malformed packet"),
+            Error::AddrParseError => f.write_str("Unable to parse address"),
+            Error::BadVariableRefType => f.write_str("Bad variable ref type byte"),
+            Error::BadOperationType => f.write_str("Bad operation type byte"),
+            Error::BadConstraintType => f.write_str("Bad constraint type byte"),
+            Error::InvalidParamName => f.write_str("Invalid param name"),
+            Error::InvalidParamType => f.write_str("Invalid param type"),
+            Error::MissingParams => f.write_str("Missing params"),
+            Error::VmError => f.write_str("VM error"),
+            Error::BadContract => f.write_str("Contract is poorly defined"),
+            Error::Groth16Error => f.write_str("Groth16 error"),
+            Error::RusqliteError(ref err) => write!(f, "Rusqlite error {}", err),
+            Error::OperationFailed => f.write_str("Operation failed"),
+
+            Error::ConnectFailed => f.write_str("Connection failed"),
+            Error::ConnectTimeout => f.write_str("Connection timed out"),
+            Error::ChannelStopped => f.write_str("Channel stopped"),
+            Error::ChannelTimeout => f.write_str("Channel timed out"),
+            Error::ServiceStopped => f.write_str("Service stopped"),
+            Error::Utf8Error => f.write_str("Malformed UTF8"),
+            Error::StrUtf8Error(ref err) => write!(f, "Malformed UTF8: {}", err),
+            Error::NoteDecryptionFailed => f.write_str("Unable to decrypt mint note"),
+            Error::ServicesError(ref err) => write!(f, "Services error: {}", err),
+            Error::ZmqError(ref err) => write!(f, "ZmqError: {}", err),
+            Error::VerifyFailed => f.write_str("Verify failed"),
+            Error::TryIntoError => f.write_str("TryInto error"),
+            Error::TryFromError => f.write_str("TryFrom error"),
+            Error::RocksdbError(ref err) => write!(f, "Rocksdb Error: {}", err),
+            Error::JsonRpcError(ref err) => write!(f, "JsonRpc Error: {}", err),
+            Error::TreeFull => f.write_str("MerkleTree is full"),
+            Error::SerdeJsonError(ref err) => write!(f, "Json serialization error: {}", err),
+            Error::SurfHttpError(ref err) => write!(f, "Surf Http error: {}", err),
+            Error::EmptyPassword => f.write_str("Password is empty. Cannot create database"),
+            Error::TomlDeserializeError(ref err) => write!(f, "Toml parsing error: {}", err),
+            Error::TomlSerializeError(ref err) => write!(f, "Toml parsing error: {}", err),
+            Error::Base58EncodeError(ref err) => write!(f, "bs58 encode error: {}", err),
+            Error::Base58DecodeError(ref err) => write!(f, "bs58 decode error: {}", err),
+            Error::CashierNoReply => f.write_str("Cashier did not reply with BTC address"),
+            Error::BadBTCAddress(ref err) => write!(f, "could not parse BTC address: {}", err),
+        }
+    }
+}
+
+impl From<std::io::Error> for Error {
+    fn from(err: std::io::Error) -> Error {
+        Error::Io(err.kind())
+    }
+}

+ 7 - 19
example/halo2/src/lib.rs

@@ -1,19 +1,7 @@
-pub mod circuit;
-
-use halo2::{
-    arithmetic::{CurveExt, FieldExt},
-    pasta::{Ep, Fq},
-};
-use orchard::constants::fixed_bases::{
-    VALUE_COMMITMENT_PERSONALIZATION, VALUE_COMMITMENT_R_BYTES, VALUE_COMMITMENT_V_BYTES,
-};
-
-#[allow(non_snake_case)]
-pub fn pedersen_commitment(value: u64, blind: Fq) -> Ep {
-    let hasher = Ep::hash_to_curve(VALUE_COMMITMENT_PERSONALIZATION);
-    let V = hasher(&VALUE_COMMITMENT_V_BYTES);
-    let R = hasher(&VALUE_COMMITMENT_R_BYTES);
-    let value = Fq::from_u64(value);
-
-    V * value + R * blind
-}
+pub mod constants;
+pub mod crypto;
+pub mod endian;
+pub mod error;
+pub mod proof;
+pub mod serial;
+pub mod spec;

+ 0 - 0
examples/halo2/src/proof.rs → example/halo2/src/proof.rs


+ 870 - 0
example/halo2/src/serial.rs

@@ -0,0 +1,870 @@
+use std::borrow::Cow;
+use std::io::{Cursor, Read, Write};
+use std::net::{IpAddr, SocketAddr};
+use std::{io, mem};
+
+use crate::endian;
+use crate::error::{Error, Result};
+
+/// Encode an object into a vector
+pub fn serialize<T: Encodable + ?Sized>(data: &T) -> Vec<u8> {
+    let mut encoder = Vec::new();
+    let len = data.encode(&mut encoder).unwrap();
+    assert_eq!(len, encoder.len());
+    encoder
+}
+
+/// Encode an object into a hex-encoded string
+pub fn serialize_hex<T: Encodable + ?Sized>(data: &T) -> String {
+    hex::encode(serialize(data))
+}
+
+/// Deserialize an object from a vector, will error if said deserialization
+/// doesn't consume the entire vector.
+pub fn deserialize<T: Decodable>(data: &[u8]) -> Result<T> {
+    let (rv, consumed) = deserialize_partial(data)?;
+
+    // Fail if data are not consumed entirely.
+    if consumed == data.len() {
+        Ok(rv)
+    } else {
+        Err(Error::ParseFailed(
+            "data not consumed entirely when explicitly deserializing",
+        ))
+    }
+}
+
+/// Deserialize an object from a vector, but will not report an error if said
+/// deserialization doesn't consume the entire vector.
+pub fn deserialize_partial<T: Decodable>(data: &[u8]) -> Result<(T, usize)> {
+    let mut decoder = Cursor::new(data);
+    let rv = Decodable::decode(&mut decoder)?;
+    let consumed = decoder.position() as usize;
+
+    Ok((rv, consumed))
+}
+
+/// Extensions of `Write` to encode data as per Bitcoin consensus
+pub trait WriteExt {
+    /// Output a 64-bit uint
+    fn write_u64(&mut self, v: u64) -> Result<()>;
+    /// Output a 32-bit uint
+    fn write_u32(&mut self, v: u32) -> Result<()>;
+    /// Output a 16-bit uint
+    fn write_u16(&mut self, v: u16) -> Result<()>;
+    /// Output a 8-bit uint
+    fn write_u8(&mut self, v: u8) -> Result<()>;
+
+    /// Output a 64-bit int
+    fn write_i64(&mut self, v: i64) -> Result<()>;
+    /// Output a 32-bit int
+    fn write_i32(&mut self, v: i32) -> Result<()>;
+    /// Output a 16-bit int
+    fn write_i16(&mut self, v: i16) -> Result<()>;
+    /// Output a 8-bit int
+    fn write_i8(&mut self, v: i8) -> Result<()>;
+
+    /// Output a boolean
+    fn write_bool(&mut self, v: bool) -> Result<()>;
+
+    /// Output a byte slice
+    fn write_slice(&mut self, v: &[u8]) -> Result<()>;
+}
+
+/// Extensions of `Read` to decode data as per Bitcoin consensus
+pub trait ReadExt {
+    /// Read a 64-bit uint
+    fn read_u64(&mut self) -> Result<u64>;
+    /// Read a 32-bit uint
+    fn read_u32(&mut self) -> Result<u32>;
+    /// Read a 16-bit uint
+    fn read_u16(&mut self) -> Result<u16>;
+    /// Read a 8-bit uint
+    fn read_u8(&mut self) -> Result<u8>;
+
+    /// Read a 64-bit int
+    fn read_i64(&mut self) -> Result<i64>;
+    /// Read a 32-bit int
+    fn read_i32(&mut self) -> Result<i32>;
+    /// Read a 16-bit int
+    fn read_i16(&mut self) -> Result<i16>;
+    /// Read a 8-bit int
+    fn read_i8(&mut self) -> Result<i8>;
+
+    /// Read a boolean
+    fn read_bool(&mut self) -> Result<bool>;
+
+    /// Read a byte slice
+    fn read_slice(&mut self, slice: &mut [u8]) -> Result<()>;
+}
+
+macro_rules! encoder_fn {
+    ($name:ident, $val_type:ty, $writefn:ident) => {
+        #[inline]
+        fn $name(&mut self, v: $val_type) -> Result<()> {
+            self.write_all(&endian::$writefn(v))
+                .map_err(|e| Error::Io(e.kind()))
+        }
+    };
+}
+
+macro_rules! decoder_fn {
+    ($name:ident, $val_type:ty, $readfn:ident, $byte_len: expr) => {
+        #[inline]
+        fn $name(&mut self) -> Result<$val_type> {
+            assert_eq!(::std::mem::size_of::<$val_type>(), $byte_len); // size_of isn't a constfn in 1.22
+            let mut val = [0; $byte_len];
+            self.read_exact(&mut val[..])
+                .map_err(|e| Error::Io(e.kind()))?;
+            Ok(endian::$readfn(&val))
+        }
+    };
+}
+
+impl<W: Write> WriteExt for W {
+    encoder_fn!(write_u64, u64, u64_to_array_le);
+    encoder_fn!(write_u32, u32, u32_to_array_le);
+    encoder_fn!(write_u16, u16, u16_to_array_le);
+    encoder_fn!(write_i64, i64, i64_to_array_le);
+    encoder_fn!(write_i32, i32, i32_to_array_le);
+    encoder_fn!(write_i16, i16, i16_to_array_le);
+
+    #[inline]
+    fn write_i8(&mut self, v: i8) -> Result<()> {
+        self.write_all(&[v as u8]).map_err(|e| Error::Io(e.kind()))
+    }
+    #[inline]
+    fn write_u8(&mut self, v: u8) -> Result<()> {
+        self.write_all(&[v]).map_err(|e| Error::Io(e.kind()))
+    }
+    #[inline]
+    fn write_bool(&mut self, v: bool) -> Result<()> {
+        self.write_all(&[v as u8]).map_err(|e| Error::Io(e.kind()))
+    }
+    #[inline]
+    fn write_slice(&mut self, v: &[u8]) -> Result<()> {
+        self.write_all(v).map_err(|e| Error::Io(e.kind()))
+    }
+}
+
+impl<R: Read> ReadExt for R {
+    decoder_fn!(read_u64, u64, slice_to_u64_le, 8);
+    decoder_fn!(read_u32, u32, slice_to_u32_le, 4);
+    decoder_fn!(read_u16, u16, slice_to_u16_le, 2);
+    decoder_fn!(read_i64, i64, slice_to_i64_le, 8);
+    decoder_fn!(read_i32, i32, slice_to_i32_le, 4);
+    decoder_fn!(read_i16, i16, slice_to_i16_le, 2);
+
+    #[inline]
+    fn read_u8(&mut self) -> Result<u8> {
+        let mut slice = [0u8; 1];
+        self.read_exact(&mut slice)?;
+        Ok(slice[0])
+    }
+    #[inline]
+    fn read_i8(&mut self) -> Result<i8> {
+        let mut slice = [0u8; 1];
+        self.read_exact(&mut slice)?;
+        Ok(slice[0] as i8)
+    }
+    #[inline]
+    fn read_bool(&mut self) -> Result<bool> {
+        ReadExt::read_i8(self).map(|bit| bit != 0)
+    }
+    #[inline]
+    fn read_slice(&mut self, slice: &mut [u8]) -> Result<()> {
+        self.read_exact(slice).map_err(|e| Error::Io(e.kind()))
+    }
+}
+
+/// Data which can be encoded in a consensus-consistent way
+pub trait Encodable {
+    /// Encode an object with a well-defined format, should only ever error if
+    /// the underlying `Write` errors. Returns the number of bytes written on
+    /// success
+    fn encode<W: io::Write>(&self, e: W) -> Result<usize>;
+}
+
+/// Data which can be encoded in a consensus-consistent way
+pub trait Decodable: Sized {
+    /// Decode an object with a well-defined format
+    fn decode<D: io::Read>(d: D) -> Result<Self>;
+}
+
+#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Debug)]
+pub struct VarInt(pub u64);
+
+// Primitive types
+macro_rules! impl_int_encodable {
+    ($ty:ident, $meth_dec:ident, $meth_enc:ident) => {
+        impl Decodable for $ty {
+            #[inline]
+            fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+                ReadExt::$meth_dec(&mut d).map($ty::from_le)
+            }
+        }
+        impl Encodable for $ty {
+            #[inline]
+            fn encode<S: WriteExt>(&self, mut s: S) -> Result<usize> {
+                s.$meth_enc(self.to_le())?;
+                Ok(mem::size_of::<$ty>())
+            }
+        }
+    };
+}
+
+impl_int_encodable!(u8, read_u8, write_u8);
+impl_int_encodable!(u16, read_u16, write_u16);
+impl_int_encodable!(u32, read_u32, write_u32);
+impl_int_encodable!(u64, read_u64, write_u64);
+impl_int_encodable!(i8, read_i8, write_i8);
+impl_int_encodable!(i16, read_i16, write_i16);
+impl_int_encodable!(i32, read_i32, write_i32);
+impl_int_encodable!(i64, read_i64, write_i64);
+
+impl VarInt {
+    /// Gets the length of this VarInt when encoded.
+    /// Returns 1 for 0...0xFC, 3 for 0xFD...(2^16-1), 5 for 0x10000...(2^32-1),
+    /// and 9 otherwise.
+    #[inline]
+    pub fn len(&self) -> usize {
+        match self.0 {
+            0..=0xFC => 1,
+            0xFD..=0xFFFF => 3,
+            0x10000..=0xFFFFFFFF => 5,
+            _ => 9,
+        }
+    }
+}
+
+impl Encodable for VarInt {
+    #[inline]
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        match self.0 {
+            0..=0xFC => {
+                (self.0 as u8).encode(s)?;
+                Ok(1)
+            }
+            0xFD..=0xFFFF => {
+                s.write_u8(0xFD)?;
+                (self.0 as u16).encode(s)?;
+                Ok(3)
+            }
+            0x10000..=0xFFFFFFFF => {
+                s.write_u8(0xFE)?;
+                (self.0 as u32).encode(s)?;
+                Ok(5)
+            }
+            _ => {
+                s.write_u8(0xFF)?;
+                (self.0 as u64).encode(s)?;
+                Ok(9)
+            }
+        }
+    }
+}
+
+impl Decodable for VarInt {
+    #[inline]
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let n = ReadExt::read_u8(&mut d)?;
+        match n {
+            0xFF => {
+                let x = ReadExt::read_u64(&mut d)?;
+                if x < 0x100000000 {
+                    Err(self::Error::NonMinimalVarInt)
+                } else {
+                    Ok(VarInt(x))
+                }
+            }
+            0xFE => {
+                let x = ReadExt::read_u32(&mut d)?;
+                if x < 0x10000 {
+                    Err(self::Error::NonMinimalVarInt)
+                } else {
+                    Ok(VarInt(x as u64))
+                }
+            }
+            0xFD => {
+                let x = ReadExt::read_u16(&mut d)?;
+                if x < 0xFD {
+                    Err(self::Error::NonMinimalVarInt)
+                } else {
+                    Ok(VarInt(x as u64))
+                }
+            }
+            n => Ok(VarInt(n as u64)),
+        }
+    }
+}
+
+// Booleans
+impl Encodable for bool {
+    #[inline]
+    fn encode<S: WriteExt>(&self, mut s: S) -> Result<usize> {
+        s.write_bool(*self)?;
+        Ok(1)
+    }
+}
+
+impl Decodable for bool {
+    #[inline]
+    fn decode<D: io::Read>(mut d: D) -> Result<bool> {
+        ReadExt::read_bool(&mut d)
+    }
+}
+
+// Strings
+impl Encodable for String {
+    #[inline]
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let b = self.as_bytes();
+        let vi_len = VarInt(b.len() as u64).encode(&mut s)?;
+        s.write_slice(&b)?;
+        Ok(vi_len + b.len())
+    }
+}
+
+impl Decodable for String {
+    #[inline]
+    fn decode<D: io::Read>(d: D) -> Result<String> {
+        String::from_utf8(Decodable::decode(d)?)
+            .map_err(|_| self::Error::ParseFailed("String was not valid UTF8"))
+    }
+}
+
+// Cow<'static, str>
+impl Encodable for Cow<'static, str> {
+    #[inline]
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let b = self.as_bytes();
+        let vi_len = VarInt(b.len() as u64).encode(&mut s)?;
+        s.write_slice(&b)?;
+        Ok(vi_len + b.len())
+    }
+}
+
+impl Decodable for Cow<'static, str> {
+    #[inline]
+    fn decode<D: io::Read>(d: D) -> Result<Cow<'static, str>> {
+        String::from_utf8(Decodable::decode(d)?)
+            .map_err(|_| self::Error::ParseFailed("String was not valid UTF8"))
+            .map(Cow::Owned)
+    }
+}
+
+// Arrays
+macro_rules! impl_array {
+    ( $size:expr ) => {
+        impl Encodable for [u8; $size] {
+            #[inline]
+            fn encode<S: WriteExt>(&self, mut s: S) -> Result<usize> {
+                s.write_slice(&self[..])?;
+                Ok(self.len())
+            }
+        }
+
+        impl Decodable for [u8; $size] {
+            #[inline]
+            fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+                let mut ret = [0; $size];
+                d.read_slice(&mut ret)?;
+                Ok(ret)
+            }
+        }
+    };
+}
+
+impl_array!(2);
+impl_array!(4);
+impl_array!(8);
+impl_array!(12);
+impl_array!(16);
+impl_array!(32);
+impl_array!(33);
+
+// Options
+impl<T: Encodable> Encodable for Option<T> {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let mut len = 0;
+        if let Some(v) = self {
+            len += true.encode(&mut s)?;
+            len += v.encode(&mut s)?;
+        } else {
+            len += false.encode(&mut s)?;
+        }
+        Ok(len)
+    }
+}
+impl<T: Decodable> Decodable for Option<T> {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let valid: bool = Decodable::decode(&mut d)?;
+        let mut val: Option<T> = None;
+
+        if valid {
+            val = Some(Decodable::decode(&mut d)?);
+        }
+
+        Ok(val)
+    }
+}
+
+impl<T: Encodable> Encodable for Vec<Option<T>> {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let mut len = 0;
+        len += VarInt(self.len() as u64).encode(&mut s)?;
+        for val in self {
+            len += val.encode(&mut s)?;
+        }
+        Ok(len)
+    }
+}
+impl<T: Decodable> Decodable for Vec<Option<T>> {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let len = VarInt::decode(&mut d)?.0;
+        let mut ret = Vec::with_capacity(len as usize);
+        for _ in 0..len {
+            ret.push(Decodable::decode(&mut d)?);
+        }
+        Ok(ret)
+    }
+}
+
+// Vectors
+#[macro_export]
+macro_rules! impl_vec {
+    ($type: ty) => {
+        impl Encodable for Vec<$type> {
+            #[inline]
+            fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+                let mut len = 0;
+                len += VarInt(self.len() as u64).encode(&mut s)?;
+                for c in self.iter() {
+                    len += c.encode(&mut s)?;
+                }
+                Ok(len)
+            }
+        }
+        impl Decodable for Vec<$type> {
+            #[inline]
+            fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+                let len = VarInt::decode(&mut d)?.0;
+                let mut ret = Vec::with_capacity(len as usize);
+                for _ in 0..len {
+                    ret.push(Decodable::decode(&mut d)?);
+                }
+                Ok(ret)
+            }
+        }
+    };
+}
+impl_vec!(SocketAddr);
+impl_vec!([u8; 32]);
+
+impl Encodable for IpAddr {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let mut len = 0;
+        match self {
+            IpAddr::V4(ip) => {
+                let version: u8 = 4;
+                len += version.encode(&mut s)?;
+                len += ip.octets().encode(s)?;
+            }
+            IpAddr::V6(ip) => {
+                let version: u8 = 6;
+                len += version.encode(&mut s)?;
+                len += ip.octets().encode(s)?;
+            }
+        }
+        Ok(len)
+    }
+}
+
+impl Decodable for IpAddr {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let version: u8 = Decodable::decode(&mut d)?;
+        match version {
+            4 => {
+                let addr: [u8; 4] = Decodable::decode(&mut d)?;
+                Ok(IpAddr::from(addr))
+            }
+            6 => {
+                let addr: [u8; 16] = Decodable::decode(&mut d)?;
+                Ok(IpAddr::from(addr))
+            }
+            _ => Err(Error::ParseFailed("couldn't decode IpAddr")),
+        }
+    }
+}
+
+impl Encodable for SocketAddr {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let mut len = 0;
+        len += self.ip().encode(&mut s)?;
+        len += self.port().encode(s)?;
+        Ok(len)
+    }
+}
+
+impl Decodable for SocketAddr {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let ip = Decodable::decode(&mut d)?;
+        let port: u16 = Decodable::decode(d)?;
+        Ok(SocketAddr::new(ip, port))
+    }
+}
+
+pub fn encode_with_size<S: io::Write>(data: &[u8], mut s: S) -> Result<usize> {
+    let vi_len = VarInt(data.len() as u64).encode(&mut s)?;
+    s.write_slice(&data)?;
+    Ok(vi_len + data.len())
+}
+
+impl Encodable for Vec<u8> {
+    #[inline]
+    fn encode<S: io::Write>(&self, s: S) -> Result<usize> {
+        encode_with_size(self, s)
+    }
+}
+
+impl Decodable for Vec<u8> {
+    #[inline]
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let len = VarInt::decode(&mut d)?.0 as usize;
+        let mut ret = vec![0u8; len];
+        d.read_slice(&mut ret)?;
+        Ok(ret)
+    }
+}
+
+impl Encodable for Box<[u8]> {
+    #[inline]
+    fn encode<S: io::Write>(&self, s: S) -> Result<usize> {
+        encode_with_size(self, s)
+    }
+}
+
+impl Decodable for Box<[u8]> {
+    #[inline]
+    fn decode<D: io::Read>(d: D) -> Result<Self> {
+        <Vec<u8>>::decode(d).map(From::from)
+    }
+}
+
+// Tuples
+macro_rules! tuple_encode {
+($($x:ident),*) => (
+impl <$($x: Encodable),*> Encodable for ($($x),*) {
+#[inline]
+#[allow(non_snake_case)]
+fn encode<S: io::Write>(
+&self,
+mut s: S,
+) -> Result<usize> {
+let &($(ref $x),*) = self;
+let mut len = 0;
+$(len += $x.encode(&mut s)?;)*
+Ok(len)
+}
+}
+
+impl<$($x: Decodable),*> Decodable for ($($x),*) {
+#[inline]
+#[allow(non_snake_case)]
+fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+Ok(($({let $x = Decodable::decode(&mut d)?; $x }),*))
+}
+}
+);
+}
+
+tuple_encode!(T0, T1);
+tuple_encode!(T0, T1, T2, T3);
+tuple_encode!(T0, T1, T2, T3, T4, T5);
+tuple_encode!(T0, T1, T2, T3, T4, T5, T6, T7);
+
+#[cfg(test)]
+mod tests {
+    use super::{deserialize, serialize, Error, Result, VarInt};
+    use super::{deserialize_partial, Encodable};
+    use crate::endian::{u16_to_array_le, u32_to_array_le, u64_to_array_le};
+    use std::io;
+    use std::mem::discriminant;
+
+    #[test]
+    fn serialize_int_test() {
+        // bool
+        assert_eq!(serialize(&false), vec![0u8]);
+        assert_eq!(serialize(&true), vec![1u8]);
+        // u8
+        assert_eq!(serialize(&1u8), vec![1u8]);
+        assert_eq!(serialize(&0u8), vec![0u8]);
+        assert_eq!(serialize(&255u8), vec![255u8]);
+        // u16
+        assert_eq!(serialize(&1u16), vec![1u8, 0]);
+        assert_eq!(serialize(&256u16), vec![0u8, 1]);
+        assert_eq!(serialize(&5000u16), vec![136u8, 19]);
+        // u32
+        assert_eq!(serialize(&1u32), vec![1u8, 0, 0, 0]);
+        assert_eq!(serialize(&256u32), vec![0u8, 1, 0, 0]);
+        assert_eq!(serialize(&5000u32), vec![136u8, 19, 0, 0]);
+        assert_eq!(serialize(&500000u32), vec![32u8, 161, 7, 0]);
+        assert_eq!(serialize(&168430090u32), vec![10u8, 10, 10, 10]);
+        // i32
+        assert_eq!(serialize(&-1i32), vec![255u8, 255, 255, 255]);
+        assert_eq!(serialize(&-256i32), vec![0u8, 255, 255, 255]);
+        assert_eq!(serialize(&-5000i32), vec![120u8, 236, 255, 255]);
+        assert_eq!(serialize(&-500000i32), vec![224u8, 94, 248, 255]);
+        assert_eq!(serialize(&-168430090i32), vec![246u8, 245, 245, 245]);
+        assert_eq!(serialize(&1i32), vec![1u8, 0, 0, 0]);
+        assert_eq!(serialize(&256i32), vec![0u8, 1, 0, 0]);
+        assert_eq!(serialize(&5000i32), vec![136u8, 19, 0, 0]);
+        assert_eq!(serialize(&500000i32), vec![32u8, 161, 7, 0]);
+        assert_eq!(serialize(&168430090i32), vec![10u8, 10, 10, 10]);
+        // u64
+        assert_eq!(serialize(&1u64), vec![1u8, 0, 0, 0, 0, 0, 0, 0]);
+        assert_eq!(serialize(&256u64), vec![0u8, 1, 0, 0, 0, 0, 0, 0]);
+        assert_eq!(serialize(&5000u64), vec![136u8, 19, 0, 0, 0, 0, 0, 0]);
+        assert_eq!(serialize(&500000u64), vec![32u8, 161, 7, 0, 0, 0, 0, 0]);
+        assert_eq!(
+            serialize(&723401728380766730u64),
+            vec![10u8, 10, 10, 10, 10, 10, 10, 10]
+        );
+        // i64
+        assert_eq!(
+            serialize(&-1i64),
+            vec![255u8, 255, 255, 255, 255, 255, 255, 255]
+        );
+        assert_eq!(
+            serialize(&-256i64),
+            vec![0u8, 255, 255, 255, 255, 255, 255, 255]
+        );
+        assert_eq!(
+            serialize(&-5000i64),
+            vec![120u8, 236, 255, 255, 255, 255, 255, 255]
+        );
+        assert_eq!(
+            serialize(&-500000i64),
+            vec![224u8, 94, 248, 255, 255, 255, 255, 255]
+        );
+        assert_eq!(
+            serialize(&-723401728380766730i64),
+            vec![246u8, 245, 245, 245, 245, 245, 245, 245]
+        );
+        assert_eq!(serialize(&1i64), vec![1u8, 0, 0, 0, 0, 0, 0, 0]);
+        assert_eq!(serialize(&256i64), vec![0u8, 1, 0, 0, 0, 0, 0, 0]);
+        assert_eq!(serialize(&5000i64), vec![136u8, 19, 0, 0, 0, 0, 0, 0]);
+        assert_eq!(serialize(&500000i64), vec![32u8, 161, 7, 0, 0, 0, 0, 0]);
+        assert_eq!(
+            serialize(&723401728380766730i64),
+            vec![10u8, 10, 10, 10, 10, 10, 10, 10]
+        );
+    }
+
+    #[test]
+    fn serialize_varint_test() {
+        assert_eq!(serialize(&VarInt(10)), vec![10u8]);
+        assert_eq!(serialize(&VarInt(0xFC)), vec![0xFCu8]);
+        assert_eq!(serialize(&VarInt(0xFD)), vec![0xFDu8, 0xFD, 0]);
+        assert_eq!(serialize(&VarInt(0xFFF)), vec![0xFDu8, 0xFF, 0xF]);
+        assert_eq!(
+            serialize(&VarInt(0xF0F0F0F)),
+            vec![0xFEu8, 0xF, 0xF, 0xF, 0xF]
+        );
+        assert_eq!(
+            serialize(&VarInt(0xF0F0F0F0F0E0)),
+            vec![0xFFu8, 0xE0, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0, 0]
+        );
+        assert_eq!(
+            test_varint_encode(0xFF, &u64_to_array_le(0x100000000)).unwrap(),
+            VarInt(0x100000000)
+        );
+        assert_eq!(
+            test_varint_encode(0xFE, &u64_to_array_le(0x10000)).unwrap(),
+            VarInt(0x10000)
+        );
+        assert_eq!(
+            test_varint_encode(0xFD, &u64_to_array_le(0xFD)).unwrap(),
+            VarInt(0xFD)
+        );
+
+        // Test that length calc is working correctly
+        test_varint_len(VarInt(0), 1);
+        test_varint_len(VarInt(0xFC), 1);
+        test_varint_len(VarInt(0xFD), 3);
+        test_varint_len(VarInt(0xFFFF), 3);
+        test_varint_len(VarInt(0x10000), 5);
+        test_varint_len(VarInt(0xFFFFFFFF), 5);
+        test_varint_len(VarInt(0xFFFFFFFF + 1), 9);
+        test_varint_len(VarInt(u64::max_value()), 9);
+    }
+
+    fn test_varint_len(varint: VarInt, expected: usize) {
+        let mut encoder = io::Cursor::new(vec![]);
+        assert_eq!(varint.encode(&mut encoder).unwrap(), expected);
+        assert_eq!(varint.len(), expected);
+    }
+
+    fn test_varint_encode(n: u8, x: &[u8]) -> Result<VarInt> {
+        let mut input = [0u8; 9];
+        input[0] = n;
+        input[1..x.len() + 1].copy_from_slice(x);
+        deserialize_partial::<VarInt>(&input).map(|t| t.0)
+    }
+
+    #[test]
+    fn deserialize_nonminimal_vec() {
+        // Check the edges for variant int
+        assert_eq!(
+            discriminant(&test_varint_encode(0xFF, &u64_to_array_le(0x100000000 - 1)).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(&test_varint_encode(0xFE, &u32_to_array_le(0x10000 - 1)).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(&test_varint_encode(0xFD, &u16_to_array_le(0xFD - 1)).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+
+        assert_eq!(
+            discriminant(&deserialize::<Vec<u8>>(&[0xfd, 0x00, 0x00]).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(&deserialize::<Vec<u8>>(&[0xfd, 0xfc, 0x00]).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(&deserialize::<Vec<u8>>(&[0xfd, 0xfc, 0x00]).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(&deserialize::<Vec<u8>>(&[0xfe, 0xff, 0x00, 0x00, 0x00]).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(&deserialize::<Vec<u8>>(&[0xfe, 0xff, 0xff, 0x00, 0x00]).unwrap_err()),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(
+                &deserialize::<Vec<u8>>(&[0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00])
+                    .unwrap_err()
+            ),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+        assert_eq!(
+            discriminant(
+                &deserialize::<Vec<u8>>(&[0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00])
+                    .unwrap_err()
+            ),
+            discriminant(&Error::NonMinimalVarInt)
+        );
+
+        let mut vec_256 = vec![0; 259];
+        vec_256[0] = 0xfd;
+        vec_256[1] = 0x00;
+        vec_256[2] = 0x01;
+        assert!(deserialize::<Vec<u8>>(&vec_256).is_ok());
+
+        let mut vec_253 = vec![0; 256];
+        vec_253[0] = 0xfd;
+        vec_253[1] = 0xfd;
+        vec_253[2] = 0x00;
+        assert!(deserialize::<Vec<u8>>(&vec_253).is_ok());
+    }
+
+    #[test]
+    fn serialize_vector_test() {
+        assert_eq!(serialize(&vec![1u8, 2, 3]), vec![3u8, 1, 2, 3]);
+        // TODO: test vectors of more interesting objects
+    }
+
+    #[test]
+    fn serialize_strbuf_test() {
+        assert_eq!(
+            serialize(&"Andrew".to_string()),
+            vec![6u8, 0x41, 0x6e, 0x64, 0x72, 0x65, 0x77]
+        );
+    }
+
+    #[test]
+    fn deserialize_int_test() {
+        // bool
+        assert!((deserialize(&[58u8, 0]) as Result<bool>).is_err());
+        assert_eq!(deserialize(&[58u8]).ok(), Some(true));
+        assert_eq!(deserialize(&[1u8]).ok(), Some(true));
+        assert_eq!(deserialize(&[0u8]).ok(), Some(false));
+        assert!((deserialize(&[0u8, 1]) as Result<bool>).is_err());
+
+        // u8
+        assert_eq!(deserialize(&[58u8]).ok(), Some(58u8));
+
+        // u16
+        assert_eq!(deserialize(&[0x01u8, 0x02]).ok(), Some(0x0201u16));
+        assert_eq!(deserialize(&[0xABu8, 0xCD]).ok(), Some(0xCDABu16));
+        assert_eq!(deserialize(&[0xA0u8, 0x0D]).ok(), Some(0xDA0u16));
+        let failure16: Result<u16> = deserialize(&[1u8]);
+        assert!(failure16.is_err());
+
+        // u32
+        assert_eq!(deserialize(&[0xABu8, 0xCD, 0, 0]).ok(), Some(0xCDABu32));
+        assert_eq!(
+            deserialize(&[0xA0u8, 0x0D, 0xAB, 0xCD]).ok(),
+            Some(0xCDAB0DA0u32)
+        );
+        let failure32: Result<u32> = deserialize(&[1u8, 2, 3]);
+        assert!(failure32.is_err());
+        // TODO: test negative numbers
+        assert_eq!(deserialize(&[0xABu8, 0xCD, 0, 0]).ok(), Some(0xCDABi32));
+        assert_eq!(
+            deserialize(&[0xA0u8, 0x0D, 0xAB, 0x2D]).ok(),
+            Some(0x2DAB0DA0i32)
+        );
+        let failurei32: Result<i32> = deserialize(&[1u8, 2, 3]);
+        assert!(failurei32.is_err());
+
+        // u64
+        assert_eq!(
+            deserialize(&[0xABu8, 0xCD, 0, 0, 0, 0, 0, 0]).ok(),
+            Some(0xCDABu64)
+        );
+        assert_eq!(
+            deserialize(&[0xA0u8, 0x0D, 0xAB, 0xCD, 0x99, 0, 0, 0x99]).ok(),
+            Some(0x99000099CDAB0DA0u64)
+        );
+        let failure64: Result<u64> = deserialize(&[1u8, 2, 3, 4, 5, 6, 7]);
+        assert!(failure64.is_err());
+        // TODO: test negative numbers
+        assert_eq!(
+            deserialize(&[0xABu8, 0xCD, 0, 0, 0, 0, 0, 0]).ok(),
+            Some(0xCDABi64)
+        );
+        assert_eq!(
+            deserialize(&[0xA0u8, 0x0D, 0xAB, 0xCD, 0x99, 0, 0, 0x99]).ok(),
+            Some(-0x66ffff663254f260i64)
+        );
+        let failurei64: Result<i64> = deserialize(&[1u8, 2, 3, 4, 5, 6, 7]);
+        assert!(failurei64.is_err());
+    }
+
+    #[test]
+    fn deserialize_vec_test() {
+        assert_eq!(deserialize(&[3u8, 2, 3, 4]).ok(), Some(vec![2u8, 3, 4]));
+        assert!((deserialize(&[4u8, 2, 3, 4, 5, 6]) as Result<Vec<u8>>).is_err());
+    }
+
+    #[test]
+    fn deserialize_strbuf_test() {
+        assert_eq!(
+            deserialize(&[6u8, 0x41, 0x6e, 0x64, 0x72, 0x65, 0x77]).ok(),
+            Some("Andrew".to_string())
+        );
+        assert_eq!(
+            deserialize(&[6u8, 0x41, 0x6e, 0x64, 0x72, 0x65, 0x77]).ok(),
+            Some(::std::borrow::Cow::Borrowed("Andrew"))
+        );
+    }
+}

+ 0 - 0
examples/halo2/src/spec.rs → example/halo2/src/spec.rs


+ 17 - 4
examples/halo2/Cargo.toml → example/vm/Cargo.toml

@@ -1,14 +1,26 @@
 [package]
-name = "drk_halo2"
+name = "halo2_examples"
 version = "0.1.0"
-authors = ["Ivan Jelincic <parazyd@dyne.org>"]
+authors = ["narodnik <x@x.org>"]
 edition = "2021"
 
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
 [dependencies]
-rand = "0.8.4"
-ff = "0.11.0"
+ff = "0.10"
+group = "0.10"
 pasta_curves = "0.2.1"
 
+rand = "0.8.4"
+hex = "0.4.3"
+
+# Can we delete these?
+bitvec = "0.22"
+arrayvec = "0.7.0"
+lazy_static = "1"
+bigint = "4"
+subtle = "2.3"
+
 [dependencies.halo2]
 version = "=0.1.0-beta.1"
 features = ["dev-graph", "gadget-traces", "sanity-checks"]
@@ -17,3 +29,4 @@ features = ["dev-graph", "gadget-traces", "sanity-checks"]
 git = "https://github.com/parazyd/halo2_gadgets.git"
 rev = "8238cb3471b798c76dd53b278524fc80685c7d4f"
 features = ["dev-graph", "test-dependencies"]
+

+ 22 - 0
example/vm/src/lib.rs

@@ -0,0 +1,22 @@
+//pub mod async_serial;
+//pub mod blockchain;
+//pub mod bls_extensions;
+//pub mod circuit;
+//pub mod cli;
+//pub mod crypto;
+pub mod arith_chip;
+pub mod endian;
+pub mod error;
+//pub mod net;
+//pub mod rpc;
+pub mod serial;
+//pub mod service;
+//pub mod state;
+//pub mod system;
+//pub mod tx;
+//pub mod util;
+//pub mod vm;
+pub mod vm2;
+pub mod vm2_serial;
+//pub mod vm_serial;
+//pub mod wallet;

+ 0 - 1531
examples/halo2/Cargo.lock

@@ -1,1531 +0,0 @@
-# This file is automatically @generated by Cargo.
-# It is not intended for manual editing.
-version = 3
-
-[[package]]
-name = "addr2line"
-version = "0.16.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e61f2b7f93d2c7d2b08263acaa4a363b3e276806c68af6134c44f523bf1aacd"
-dependencies = [
- "gimli",
-]
-
-[[package]]
-name = "adler"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
-
-[[package]]
-name = "adler32"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234"
-
-[[package]]
-name = "aho-corasick"
-version = "0.7.18"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "anyhow"
-version = "1.0.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "61604a8f862e1d5c3229fdd78f8b02c68dcf73a4c4b05fd636d12240aaa242c1"
-
-[[package]]
-name = "arrayref"
-version = "0.3.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
-
-[[package]]
-name = "arrayvec"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
-
-[[package]]
-name = "arrayvec"
-version = "0.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6"
-
-[[package]]
-name = "autocfg"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
-
-[[package]]
-name = "backtrace"
-version = "0.3.62"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "091bcdf2da9950f96aa522681ce805e6857f6ca8df73833d35736ab2dc78e152"
-dependencies = [
- "addr2line",
- "cc",
- "cfg-if",
- "libc",
- "miniz_oxide 0.4.4",
- "object",
- "rustc-demangle",
-]
-
-[[package]]
-name = "bigint"
-version = "4.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c0e8c8a600052b52482eff2cf4d810e462fdff1f656ac1ecb6232132a1ed7def"
-dependencies = [
- "byteorder",
- "crunchy",
-]
-
-[[package]]
-name = "bit-set"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de"
-dependencies = [
- "bit-vec",
-]
-
-[[package]]
-name = "bit-vec"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
-
-[[package]]
-name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "bitvec"
-version = "0.22.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5237f00a8c86130a0cc317830e558b966dd7850d48a953d998c813f01a41b527"
-dependencies = [
- "funty",
- "radium",
- "tap",
- "wyz",
-]
-
-[[package]]
-name = "blake2b_simd"
-version = "0.5.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587"
-dependencies = [
- "arrayref",
- "arrayvec 0.5.2",
- "constant_time_eq",
-]
-
-[[package]]
-name = "bls12_381"
-version = "0.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d28daeeded7949f1c7c72693377c98473b00be0aa0023760a84a300e4e7c74b"
-dependencies = [
- "ff",
- "rand_core",
- "subtle",
-]
-
-[[package]]
-name = "bumpalo"
-version = "3.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c"
-
-[[package]]
-name = "bytemuck"
-version = "1.7.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72957246c41db82b8ef88a5486143830adeb8227ef9837740bdec67724cf2c5b"
-
-[[package]]
-name = "byteorder"
-version = "1.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610"
-
-[[package]]
-name = "cc"
-version = "1.0.71"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd"
-
-[[package]]
-name = "cfg-if"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-
-[[package]]
-name = "chrono"
-version = "0.4.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73"
-dependencies = [
- "libc",
- "num-integer",
- "num-traits",
- "time",
- "winapi",
-]
-
-[[package]]
-name = "cmake"
-version = "0.1.46"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b7b858541263efe664aead4a5209a4ae5c5d2811167d4ed4ee0944503f8d2089"
-dependencies = [
- "cc",
-]
-
-[[package]]
-name = "color_quant"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b"
-
-[[package]]
-name = "constant_time_eq"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
-
-[[package]]
-name = "core-foundation"
-version = "0.9.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3"
-dependencies = [
- "core-foundation-sys",
- "libc",
-]
-
-[[package]]
-name = "core-foundation-sys"
-version = "0.8.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"
-
-[[package]]
-name = "core-graphics"
-version = "0.22.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86"
-dependencies = [
- "bitflags",
- "core-foundation",
- "core-graphics-types",
- "foreign-types",
- "libc",
-]
-
-[[package]]
-name = "core-graphics-types"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b"
-dependencies = [
- "bitflags",
- "core-foundation",
- "foreign-types",
- "libc",
-]
-
-[[package]]
-name = "core-text"
-version = "19.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25"
-dependencies = [
- "core-foundation",
- "core-graphics",
- "foreign-types",
- "libc",
-]
-
-[[package]]
-name = "crc32fast"
-version = "1.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "crossbeam-channel"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-deque"
-version = "0.8.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e"
-dependencies = [
- "cfg-if",
- "crossbeam-epoch",
- "crossbeam-utils",
-]
-
-[[package]]
-name = "crossbeam-epoch"
-version = "0.9.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd"
-dependencies = [
- "cfg-if",
- "crossbeam-utils",
- "lazy_static",
- "memoffset",
- "scopeguard",
-]
-
-[[package]]
-name = "crossbeam-utils"
-version = "0.8.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d82cfc11ce7f2c3faef78d8a684447b40d503d9681acebed6cb728d45940c4db"
-dependencies = [
- "cfg-if",
- "lazy_static",
-]
-
-[[package]]
-name = "crunchy"
-version = "0.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2f4a431c5c9f662e1200b7c7f02c34e91361150e382089a8f2dec3ba680cbda"
-
-[[package]]
-name = "darling"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858"
-dependencies = [
- "darling_core",
- "darling_macro",
-]
-
-[[package]]
-name = "darling_core"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b"
-dependencies = [
- "fnv",
- "ident_case",
- "proc-macro2",
- "quote",
- "strsim",
- "syn",
-]
-
-[[package]]
-name = "darling_macro"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72"
-dependencies = [
- "darling_core",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "deflate"
-version = "0.8.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174"
-dependencies = [
- "adler32",
- "byteorder",
-]
-
-[[package]]
-name = "derive_builder"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0"
-dependencies = [
- "darling",
- "derive_builder_core",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "derive_builder_core"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef"
-dependencies = [
- "darling",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "digest"
-version = "0.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066"
-dependencies = [
- "generic-array",
-]
-
-[[package]]
-name = "dirs-next"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
-dependencies = [
- "cfg-if",
- "dirs-sys-next",
-]
-
-[[package]]
-name = "dirs-sys-next"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
-dependencies = [
- "libc",
- "redox_users",
- "winapi",
-]
-
-[[package]]
-name = "drk_halo2"
-version = "0.1.0"
-dependencies = [
- "ff",
- "halo2",
- "halo2_gadgets",
- "pasta_curves",
- "rand",
-]
-
-[[package]]
-name = "dwrote"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b"
-dependencies = [
- "lazy_static",
- "libc",
- "winapi",
- "wio",
-]
-
-[[package]]
-name = "either"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
-
-[[package]]
-name = "expat-sys"
-version = "2.1.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa"
-dependencies = [
- "cmake",
- "pkg-config",
-]
-
-[[package]]
-name = "ff"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2958d04124b9f27f175eaeb9a9f383d026098aa837eadd8ba22c11f13a05b9e"
-dependencies = [
- "bitvec",
- "rand_core",
- "subtle",
-]
-
-[[package]]
-name = "float-ord"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e"
-
-[[package]]
-name = "fnv"
-version = "1.0.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
-
-[[package]]
-name = "font-kit"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "46c9a156ec38864999bc9c4156e5f3b50224d4a5578028a64e5a3875caa9ee28"
-dependencies = [
- "bitflags",
- "byteorder",
- "core-foundation",
- "core-graphics",
- "core-text",
- "dirs-next",
- "dwrote",
- "float-ord",
- "freetype",
- "lazy_static",
- "libc",
- "log",
- "pathfinder_geometry",
- "pathfinder_simd",
- "servo-fontconfig",
- "walkdir",
- "winapi",
-]
-
-[[package]]
-name = "foreign-types"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
-dependencies = [
- "foreign-types-shared",
-]
-
-[[package]]
-name = "foreign-types-shared"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
-
-[[package]]
-name = "freetype"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6"
-dependencies = [
- "freetype-sys",
- "libc",
-]
-
-[[package]]
-name = "freetype-sys"
-version = "0.13.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a"
-dependencies = [
- "cmake",
- "libc",
- "pkg-config",
-]
-
-[[package]]
-name = "funty"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1847abb9cb65d566acd5942e94aea9c8f547ad02c98e1649326fc0e8910b8b1e"
-
-[[package]]
-name = "generic-array"
-version = "0.14.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817"
-dependencies = [
- "typenum",
- "version_check",
-]
-
-[[package]]
-name = "getrandom"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
-dependencies = [
- "cfg-if",
- "libc",
- "wasi",
-]
-
-[[package]]
-name = "gif"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b"
-dependencies = [
- "color_quant",
- "weezl",
-]
-
-[[package]]
-name = "gimli"
-version = "0.25.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7"
-
-[[package]]
-name = "group"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89"
-dependencies = [
- "byteorder",
- "ff",
- "rand_core",
- "subtle",
-]
-
-[[package]]
-name = "halo2"
-version = "0.1.0-beta.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0f186b85ed81082fb1cf59d52b0111f02915e89a4ac61d292b38d075e570f3a9"
-dependencies = [
- "backtrace",
- "blake2b_simd",
- "ff",
- "group",
- "pasta_curves",
- "plotters",
- "rand",
- "rayon",
- "tabbycat",
-]
-
-[[package]]
-name = "halo2_gadgets"
-version = "0.0.0"
-source = "git+https://github.com/parazyd/halo2_gadgets.git?rev=8238cb3471b798c76dd53b278524fc80685c7d4f#8238cb3471b798c76dd53b278524fc80685c7d4f"
-dependencies = [
- "arrayvec 0.7.2",
- "bigint",
- "bitvec",
- "ff",
- "group",
- "halo2",
- "lazy_static",
- "memuse",
- "nonempty",
- "pasta_curves",
- "plotters",
- "proptest",
- "rand",
- "reddsa",
- "subtle",
-]
-
-[[package]]
-name = "hermit-abi"
-version = "0.1.19"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "ident_case"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
-
-[[package]]
-name = "image"
-version = "0.23.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24ffcb7e7244a9bf19d35bf2883b9c080c4ced3c07a9895572178cdb8f13f6a1"
-dependencies = [
- "bytemuck",
- "byteorder",
- "color_quant",
- "jpeg-decoder",
- "num-iter",
- "num-rational",
- "num-traits",
- "png",
-]
-
-[[package]]
-name = "jpeg-decoder"
-version = "0.1.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "229d53d58899083193af11e15917b5640cd40b29ff475a1fe4ef725deb02d0f2"
-
-[[package]]
-name = "js-sys"
-version = "0.3.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84"
-dependencies = [
- "wasm-bindgen",
-]
-
-[[package]]
-name = "jubjub"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2e7baec19d4e83f9145d4891178101a604565edff9645770fc979804138b04c"
-dependencies = [
- "bitvec",
- "bls12_381",
- "ff",
- "group",
- "rand_core",
- "subtle",
-]
-
-[[package]]
-name = "lazy_static"
-version = "1.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
-
-[[package]]
-name = "libc"
-version = "0.2.105"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013"
-
-[[package]]
-name = "log"
-version = "0.4.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
-dependencies = [
- "cfg-if",
-]
-
-[[package]]
-name = "memchr"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
-
-[[package]]
-name = "memoffset"
-version = "0.6.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59accc507f1338036a0477ef61afdae33cde60840f4dfe481319ce3ad116ddf9"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "memuse"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f69d25cd7528769ad3d897e99eb942774bff8b23165012af490351a44c5b583b"
-dependencies = [
- "nonempty",
-]
-
-[[package]]
-name = "miniz_oxide"
-version = "0.3.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435"
-dependencies = [
- "adler32",
-]
-
-[[package]]
-name = "miniz_oxide"
-version = "0.4.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b"
-dependencies = [
- "adler",
- "autocfg",
-]
-
-[[package]]
-name = "nonempty"
-version = "0.7.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7"
-
-[[package]]
-name = "num-integer"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db"
-dependencies = [
- "autocfg",
- "num-traits",
-]
-
-[[package]]
-name = "num-iter"
-version = "0.1.42"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-rational"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07"
-dependencies = [
- "autocfg",
- "num-integer",
- "num-traits",
-]
-
-[[package]]
-name = "num-traits"
-version = "0.2.14"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
-dependencies = [
- "autocfg",
-]
-
-[[package]]
-name = "num_cpus"
-version = "1.13.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
-dependencies = [
- "hermit-abi",
- "libc",
-]
-
-[[package]]
-name = "object"
-version = "0.27.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "67ac1d3f9a1d3616fd9a60c8d74296f22406a238b6a72f5cc1e6f314df4ffbf9"
-dependencies = [
- "memchr",
-]
-
-[[package]]
-name = "pasta_curves"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d647d91972bad78120fd61e06b225fcda117805c9bbf17676b51bd03a251278b"
-dependencies = [
- "blake2b_simd",
- "ff",
- "group",
- "lazy_static",
- "rand",
- "static_assertions",
- "subtle",
-]
-
-[[package]]
-name = "pathfinder_geometry"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3"
-dependencies = [
- "log",
- "pathfinder_simd",
-]
-
-[[package]]
-name = "pathfinder_simd"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff"
-dependencies = [
- "rustc_version",
-]
-
-[[package]]
-name = "pest"
-version = "2.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
-dependencies = [
- "ucd-trie",
-]
-
-[[package]]
-name = "pkg-config"
-version = "0.3.22"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f"
-
-[[package]]
-name = "plotters"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32a3fd9ec30b9749ce28cd91f255d569591cdf937fe280c312143e3c4bad6f2a"
-dependencies = [
- "chrono",
- "font-kit",
- "image",
- "lazy_static",
- "num-traits",
- "pathfinder_geometry",
- "plotters-backend",
- "plotters-bitmap",
- "plotters-svg",
- "ttf-parser",
- "wasm-bindgen",
- "web-sys",
-]
-
-[[package]]
-name = "plotters-backend"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d88417318da0eaf0fdcdb51a0ee6c3bed624333bff8f946733049380be67ac1c"
-
-[[package]]
-name = "plotters-bitmap"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "21362fa905695e5618aefd169358f52e0e8bc4a8e05333cf780fda8cddc00b54"
-dependencies = [
- "gif",
- "image",
- "plotters-backend",
-]
-
-[[package]]
-name = "plotters-svg"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "521fa9638fa597e1dc53e9412a4f9cefb01187ee1f7413076f9e6749e2885ba9"
-dependencies = [
- "plotters-backend",
-]
-
-[[package]]
-name = "png"
-version = "0.16.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6"
-dependencies = [
- "bitflags",
- "crc32fast",
- "deflate",
- "miniz_oxide 0.3.7",
-]
-
-[[package]]
-name = "ppv-lite86"
-version = "0.2.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
-
-[[package]]
-name = "proc-macro2"
-version = "1.0.32"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43"
-dependencies = [
- "unicode-xid",
-]
-
-[[package]]
-name = "proptest"
-version = "1.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1e0d9cc07f18492d879586c92b485def06bc850da3118075cd45d50e9c95b0e5"
-dependencies = [
- "bit-set",
- "bitflags",
- "byteorder",
- "lazy_static",
- "num-traits",
- "quick-error 2.0.1",
- "rand",
- "rand_chacha",
- "rand_xorshift",
- "regex-syntax",
- "rusty-fork",
- "tempfile",
-]
-
-[[package]]
-name = "quick-error"
-version = "1.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
-
-[[package]]
-name = "quick-error"
-version = "2.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
-
-[[package]]
-name = "quote"
-version = "1.0.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05"
-dependencies = [
- "proc-macro2",
-]
-
-[[package]]
-name = "radium"
-version = "0.6.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "643f8f41a8ebc4c5dc4515c82bb8abd397b527fc20fd681b7c011c2aee5d44fb"
-
-[[package]]
-name = "rand"
-version = "0.8.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8"
-dependencies = [
- "libc",
- "rand_chacha",
- "rand_core",
- "rand_hc",
-]
-
-[[package]]
-name = "rand_chacha"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
-dependencies = [
- "ppv-lite86",
- "rand_core",
-]
-
-[[package]]
-name = "rand_core"
-version = "0.6.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
-dependencies = [
- "getrandom",
-]
-
-[[package]]
-name = "rand_hc"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7"
-dependencies = [
- "rand_core",
-]
-
-[[package]]
-name = "rand_xorshift"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f"
-dependencies = [
- "rand_core",
-]
-
-[[package]]
-name = "rayon"
-version = "1.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90"
-dependencies = [
- "autocfg",
- "crossbeam-deque",
- "either",
- "rayon-core",
-]
-
-[[package]]
-name = "rayon-core"
-version = "1.9.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e"
-dependencies = [
- "crossbeam-channel",
- "crossbeam-deque",
- "crossbeam-utils",
- "lazy_static",
- "num_cpus",
-]
-
-[[package]]
-name = "reddsa"
-version = "0.0.0"
-source = "git+https://github.com/str4d/redjubjub.git?rev=416a6a8ebf8bd42c114c938883016c04f338de72#416a6a8ebf8bd42c114c938883016c04f338de72"
-dependencies = [
- "blake2b_simd",
- "byteorder",
- "digest",
- "group",
- "jubjub",
- "pasta_curves",
- "rand_core",
- "serde",
- "thiserror",
- "zeroize",
-]
-
-[[package]]
-name = "redox_syscall"
-version = "0.2.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
-dependencies = [
- "bitflags",
-]
-
-[[package]]
-name = "redox_users"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
-dependencies = [
- "getrandom",
- "redox_syscall",
-]
-
-[[package]]
-name = "regex"
-version = "1.5.4"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461"
-dependencies = [
- "aho-corasick",
- "memchr",
- "regex-syntax",
-]
-
-[[package]]
-name = "regex-syntax"
-version = "0.6.25"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
-
-[[package]]
-name = "remove_dir_all"
-version = "0.5.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "rustc-demangle"
-version = "0.1.21"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342"
-
-[[package]]
-name = "rustc_version"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee"
-dependencies = [
- "semver",
-]
-
-[[package]]
-name = "rusty-fork"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f"
-dependencies = [
- "fnv",
- "quick-error 1.2.3",
- "tempfile",
- "wait-timeout",
-]
-
-[[package]]
-name = "same-file"
-version = "1.0.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
-dependencies = [
- "winapi-util",
-]
-
-[[package]]
-name = "scopeguard"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
-
-[[package]]
-name = "semver"
-version = "0.11.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6"
-dependencies = [
- "semver-parser",
-]
-
-[[package]]
-name = "semver-parser"
-version = "0.10.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7"
-dependencies = [
- "pest",
-]
-
-[[package]]
-name = "serde"
-version = "1.0.130"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
-dependencies = [
- "serde_derive",
-]
-
-[[package]]
-name = "serde_derive"
-version = "1.0.130"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "servo-fontconfig"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c"
-dependencies = [
- "libc",
- "servo-fontconfig-sys",
-]
-
-[[package]]
-name = "servo-fontconfig-sys"
-version = "5.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388"
-dependencies = [
- "expat-sys",
- "freetype-sys",
- "pkg-config",
-]
-
-[[package]]
-name = "static_assertions"
-version = "1.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
-
-[[package]]
-name = "strsim"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c"
-
-[[package]]
-name = "subtle"
-version = "2.4.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601"
-
-[[package]]
-name = "syn"
-version = "1.0.81"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966"
-dependencies = [
- "proc-macro2",
- "quote",
- "unicode-xid",
-]
-
-[[package]]
-name = "synstructure"
-version = "0.12.6"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "unicode-xid",
-]
-
-[[package]]
-name = "tabbycat"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c45590f0f859197b4545be1b17b2bc3cc7bb075f7d1cc0ea1dc6521c0bf256a3"
-dependencies = [
- "anyhow",
- "derive_builder",
- "regex",
-]
-
-[[package]]
-name = "tap"
-version = "1.0.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369"
-
-[[package]]
-name = "tempfile"
-version = "3.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
-dependencies = [
- "cfg-if",
- "libc",
- "rand",
- "redox_syscall",
- "remove_dir_all",
- "winapi",
-]
-
-[[package]]
-name = "thiserror"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417"
-dependencies = [
- "thiserror-impl",
-]
-
-[[package]]
-name = "thiserror-impl"
-version = "1.0.30"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "time"
-version = "0.1.44"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255"
-dependencies = [
- "libc",
- "wasi",
- "winapi",
-]
-
-[[package]]
-name = "ttf-parser"
-version = "0.12.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7ae2f58a822f08abdaf668897e96a5656fe72f5a9ce66422423e8849384872e6"
-
-[[package]]
-name = "typenum"
-version = "1.14.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b63708a265f51345575b27fe43f9500ad611579e764c79edbc2037b1121959ec"
-
-[[package]]
-name = "ucd-trie"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
-
-[[package]]
-name = "unicode-xid"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
-
-[[package]]
-name = "version_check"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
-
-[[package]]
-name = "wait-timeout"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
-dependencies = [
- "libc",
-]
-
-[[package]]
-name = "walkdir"
-version = "2.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
-dependencies = [
- "same-file",
- "winapi",
- "winapi-util",
-]
-
-[[package]]
-name = "wasi"
-version = "0.10.0+wasi-snapshot-preview1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
-
-[[package]]
-name = "wasm-bindgen"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce"
-dependencies = [
- "cfg-if",
- "wasm-bindgen-macro",
-]
-
-[[package]]
-name = "wasm-bindgen-backend"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b"
-dependencies = [
- "bumpalo",
- "lazy_static",
- "log",
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-macro"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9"
-dependencies = [
- "quote",
- "wasm-bindgen-macro-support",
-]
-
-[[package]]
-name = "wasm-bindgen-macro-support"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "wasm-bindgen-backend",
- "wasm-bindgen-shared",
-]
-
-[[package]]
-name = "wasm-bindgen-shared"
-version = "0.2.78"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc"
-
-[[package]]
-name = "web-sys"
-version = "0.3.55"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb"
-dependencies = [
- "js-sys",
- "wasm-bindgen",
-]
-
-[[package]]
-name = "weezl"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d8b77fdfd5a253be4ab714e4ffa3c49caf146b4de743e97510c0656cf90f1e8e"
-
-[[package]]
-name = "winapi"
-version = "0.3.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
-dependencies = [
- "winapi-i686-pc-windows-gnu",
- "winapi-x86_64-pc-windows-gnu",
-]
-
-[[package]]
-name = "winapi-i686-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
-
-[[package]]
-name = "winapi-util"
-version = "0.1.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "winapi-x86_64-pc-windows-gnu"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "wio"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5"
-dependencies = [
- "winapi",
-]
-
-[[package]]
-name = "wyz"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "129e027ad65ce1453680623c3fb5163cbf7107bfe1aa32257e7d0e63f9ced188"
-dependencies = [
- "tap",
-]
-
-[[package]]
-name = "zeroize"
-version = "1.4.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bf68b08513768deaa790264a7fac27a58cbf2705cfcdc9448362229217d7e970"
-dependencies = [
- "zeroize_derive",
-]
-
-[[package]]
-name = "zeroize_derive"
-version = "1.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bdff2024a851a322b08f179173ae2ba620445aef1e838f0c196820eade4ae0c7"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
- "synstructure",
-]

+ 0 - 455
examples/halo2/src/bin/mint.rs

@@ -1,455 +0,0 @@
-use std::time::Instant;
-
-use halo2::{
-    circuit::{Layouter, SimpleFloorPlanner},
-    dev::MockProver,
-    plonk::{
-        Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector,
-    },
-    poly::Rotation,
-};
-use halo2_gadgets::{
-    ecc::{
-        chip::{EccChip, EccConfig},
-        FixedPoint,
-    },
-    poseidon::{
-        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
-        StateWord, Word,
-    },
-    primitives,
-    primitives::poseidon::{ConstantLength, P128Pow5T3},
-    utilities::{
-        copy, lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
-    },
-};
-use pasta_curves::{
-    arithmetic::{CurveAffine, Field},
-    group::{Curve, Group},
-    pallas,
-};
-use rand::rngs::OsRng;
-
-use drk_halo2::{
-    constants::OrchardFixedBases,
-    crypto::pedersen_commitment,
-    proof::{Proof, ProvingKey, VerifyingKey},
-};
-
-#[derive(Clone, Debug)]
-struct MintConfig {
-    primary: Column<InstanceColumn>,
-    q_add: Selector,
-    advices: [Column<Advice>; 10],
-    ecc_config: EccConfig,
-    poseidon_config: PoseidonConfig<pallas::Base>,
-}
-
-impl MintConfig {
-    fn ecc_chip(&self) -> EccChip<OrchardFixedBases> {
-        EccChip::construct(self.ecc_config.clone())
-    }
-
-    fn poseidon_chip(&self) -> PoseidonChip<pallas::Base> {
-        PoseidonChip::construct(self.poseidon_config.clone())
-    }
-}
-
-// The public input array offsets
-const MINT_COIN_OFFSET: usize = 0;
-const MINT_VALCOMX_OFFSET: usize = 1;
-const MINT_VALCOMY_OFFSET: usize = 2;
-const MINT_ASSCOMX_OFFSET: usize = 3;
-const MINT_ASSCOMY_OFFSET: usize = 4;
-
-#[derive(Default, Debug)]
-struct MintCircuit {
-    pub_x: Option<pallas::Base>,         // x coordinate for pubkey
-    pub_y: Option<pallas::Base>,         // y coordinate for pubkey
-    value: Option<pallas::Base>,         // The value of this coin
-    asset: Option<pallas::Base>,         // The asset ID
-    serial: Option<pallas::Base>,        // Unique serial number corresponding to this coin
-    coin_blind: Option<pallas::Base>,    // Random blinding factor for coin
-    value_blind: Option<pallas::Scalar>, // Random blinding factor for value commitment
-    asset_blind: Option<pallas::Scalar>, // Random blinding factor for the asset ID
-}
-
-impl UtilitiesInstructions<pallas::Base> for MintCircuit {
-    type Var = CellValue<pallas::Base>;
-}
-
-impl Circuit<pallas::Base> for MintCircuit {
-    type Config = MintConfig;
-    type FloorPlanner = SimpleFloorPlanner;
-
-    fn without_witnesses(&self) -> Self {
-        Self::default()
-    }
-
-    fn configure(meta: &mut ConstraintSystem<pallas::Base>) -> Self::Config {
-        // Advice columns used in the circuit
-        let advices = [
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-            meta.advice_column(),
-        ];
-
-        // Addition of two field elements
-        /*
-        let q_add = meta.selector();
-        meta.create_gate("poseidon_hash(a, b) + c", |meta| {
-            let q_add = meta.query_selector(q_add);
-            let sum = meta.query_advice(advices[6], Rotation::cur());
-            let hash = meta.query_advice(advices[7], Rotation::cur());
-            let c = meta.query_advice(advices[8], Rotation::cur());
-
-            vec![q_add * (hash + c - sum)]
-        });
-        */
-        let q_add = meta.selector();
-        meta.create_gate("a+b+c", |meta| {
-            let q_add = meta.query_selector(q_add);
-            let sum = meta.query_advice(advices[5], Rotation::cur());
-            let a = meta.query_advice(advices[6], Rotation::cur());
-            let b = meta.query_advice(advices[7], Rotation::cur());
-            let c = meta.query_advice(advices[8], Rotation::cur());
-
-            vec![q_add * (a + b + c - sum)]
-        });
-
-        // Fixed columns for the Sinsemilla generator lookup table
-        let table_idx = meta.lookup_table_column();
-        let _lookup = (
-            table_idx,
-            meta.lookup_table_column(),
-            meta.lookup_table_column(),
-        );
-
-        // Instance column used for public inputs
-        let primary = meta.instance_column();
-        meta.enable_equality(primary.into());
-
-        // Permutation over all advice columns
-        for advice in advices.iter() {
-            meta.enable_equality((*advice).into());
-        }
-
-        // Poseidon requires four advice columns, while ECC incomplete addition
-        // requires six. We can reduce the proof size by sharing fixed columns
-        // between the ECC and Poseidon chips.
-        // TODO: For multiple invocations they could/should be configured in
-        // parallel rather than sharing perhaps?
-        let lagrange_coeffs = [
-            meta.fixed_column(),
-            meta.fixed_column(),
-            meta.fixed_column(),
-            meta.fixed_column(),
-            meta.fixed_column(),
-            meta.fixed_column(),
-            meta.fixed_column(),
-            meta.fixed_column(),
-        ];
-        let rc_a = lagrange_coeffs[2..5].try_into().unwrap();
-        let rc_b = lagrange_coeffs[5..8].try_into().unwrap();
-
-        // Also use the first Lagrange coefficient column for loading global constants.
-        meta.enable_constant(lagrange_coeffs[0]);
-
-        // Use one of the right-most advice columns for all of our range checks.
-        let range_check = LookupRangeCheckConfig::configure(meta, advices[9], table_idx);
-
-        // Configuration for curve point operations.
-        // This uses 10 advice columns and spans the whole circuit.
-        let ecc_config =
-            EccChip::<OrchardFixedBases>::configure(meta, advices, lagrange_coeffs, range_check);
-
-        // Configuration for the Poseidon hash
-        let poseidon_config = PoseidonChip::configure(
-            meta,
-            P128Pow5T3,
-            advices[6..9].try_into().unwrap(),
-            advices[5],
-            rc_a,
-            rc_b,
-        );
-
-        MintConfig {
-            primary,
-            q_add,
-            advices,
-            ecc_config,
-            poseidon_config,
-        }
-    }
-
-    fn synthesize(
-        &self,
-        config: Self::Config,
-        mut layouter: impl Layouter<pallas::Base>,
-    ) -> Result<(), Error> {
-        let ecc_chip = config.ecc_chip();
-
-        let pub_x = self.load_private(
-            layouter.namespace(|| "load pubkey x"),
-            config.advices[0],
-            self.pub_x,
-        )?;
-
-        let pub_y = self.load_private(
-            layouter.namespace(|| "load pubkey y"),
-            config.advices[0],
-            self.pub_y,
-        )?;
-
-        let value = self.load_private(
-            layouter.namespace(|| "load value"),
-            config.advices[0],
-            self.value,
-        )?;
-
-        let asset = self.load_private(
-            layouter.namespace(|| "load asset"),
-            config.advices[0],
-            self.asset,
-        )?;
-
-        let serial = self.load_private(
-            layouter.namespace(|| "load serial"),
-            config.advices[0],
-            self.serial,
-        )?;
-
-        let coin_blind = self.load_private(
-            layouter.namespace(|| "load coin_blind"),
-            config.advices[0],
-            self.coin_blind,
-        )?;
-
-        // =========
-        // Coin hash
-        // =========
-        let messages = [[pub_x, pub_y], [value, asset], [serial, coin_blind]];
-        let mut hashes = vec![];
-
-        for message in messages.iter() {
-            let hash = {
-                let poseidon_message = layouter.assign_region(
-                    || "load message",
-                    |mut region| {
-                        let mut message_word = |i: usize| {
-                            let value = message[i].value();
-                            let var = region.assign_advice(
-                                || format!("load message_{}", i),
-                                config.poseidon_config.state()[i],
-                                0,
-                                || value.ok_or(Error::SynthesisError),
-                            )?;
-                            region.constrain_equal(var, message[i].cell())?;
-                            Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
-                                var, value,
-                            )))
-                        };
-                        Ok([message_word(0)?, message_word(1)?])
-                    },
-                )?;
-
-                let poseidon_hasher = PoseidonHash::init(
-                    config.poseidon_chip(),
-                    layouter.namespace(|| "Poseidon init"),
-                    ConstantLength::<2>,
-                )?;
-
-                let poseidon_output = poseidon_hasher.hash(
-                    layouter.namespace(|| "Poseidon hash (a, b)"),
-                    poseidon_message,
-                )?;
-
-                let poseidon_output: CellValue<pallas::Base> = poseidon_output.inner().into();
-                poseidon_output
-            };
-
-            hashes.push(hash);
-        }
-
-        let coin = layouter.assign_region(
-            || " `coin` = hash(a,b) + hash(c, d) + hash(e, f)",
-            |mut region| {
-                config.q_add.enable(&mut region, 0)?;
-
-                copy(&mut region, || "copy ab", config.advices[6], 0, &hashes[0])?;
-                copy(&mut region, || "copy cd", config.advices[7], 0, &hashes[1])?;
-                copy(&mut region, || "copy ef", config.advices[8], 0, &hashes[2])?;
-
-                let scalar_val = hashes[0]
-                    .value()
-                    .zip(hashes[1].value())
-                    .zip(hashes[2].value())
-                    .map(|(abcd, ef)| abcd.0 + abcd.1 + ef);
-
-                let cell = region.assign_advice(
-                    || "hash(a,b)+hash(c,d)+hash(e,f)",
-                    config.advices[5],
-                    0,
-                    || scalar_val.ok_or(Error::SynthesisError),
-                )?;
-                Ok(CellValue::new(cell, scalar_val))
-            },
-        )?;
-
-        // Constrain the coin C
-        layouter.constrain_instance(coin.cell(), config.primary, MINT_COIN_OFFSET)?;
-
-        // ================
-        // Value commitment
-        // ================
-
-        // This constant one is used for short multiplication
-        let one = self.load_private(
-            layouter.namespace(|| "load constant one"),
-            config.advices[0],
-            Some(pallas::Base::one()),
-        )?;
-
-        // v * G_1
-        let (commitment, _) = {
-            let value_commit_v = OrchardFixedBases::ValueCommitV;
-            let value_commit_v = FixedPoint::from_inner(ecc_chip.clone(), value_commit_v);
-            value_commit_v.mul_short(layouter.namespace(|| "[value] ValueCommitV"), (value, one))?
-        };
-
-        // r_V * G_2
-        let (blind, _rcv) = {
-            let rcv = self.value_blind;
-            let value_commit_r = OrchardFixedBases::ValueCommitR;
-            let value_commit_r = FixedPoint::from_inner(ecc_chip.clone(), value_commit_r);
-            value_commit_r.mul(layouter.namespace(|| "[value_blind] ValueCommitR"), rcv)?
-        };
-
-        // Constrain the value commitment coordinates
-        let value_commit = commitment.add(layouter.namespace(|| "valuecommit"), &blind)?;
-        layouter.constrain_instance(
-            value_commit.inner().x().cell(),
-            config.primary,
-            MINT_VALCOMX_OFFSET,
-        )?;
-        layouter.constrain_instance(
-            value_commit.inner().y().cell(),
-            config.primary,
-            MINT_VALCOMY_OFFSET,
-        )?;
-
-        // ================
-        // Asset commitment
-        // ================
-        // a * G_1
-        let (commitment, _) = {
-            let asset_commit_v = OrchardFixedBases::ValueCommitV;
-            let asset_commit_v = FixedPoint::from_inner(ecc_chip.clone(), asset_commit_v);
-            asset_commit_v.mul_short(layouter.namespace(|| "[asset] ValueCommitV"), (asset, one))?
-        };
-
-        // r_A * G_2
-        let (blind, _rca) = {
-            let rca = self.asset_blind;
-            let asset_commit_r = OrchardFixedBases::ValueCommitR;
-            let asset_commit_r = FixedPoint::from_inner(ecc_chip, asset_commit_r);
-            asset_commit_r.mul(layouter.namespace(|| "[asset_blind] ValueCommitR"), rca)?
-        };
-
-        // Constrain the asset commitment coordinates
-        let asset_commit = commitment.add(layouter.namespace(|| "assetcommit"), &blind)?;
-        layouter.constrain_instance(
-            asset_commit.inner().x().cell(),
-            config.primary,
-            MINT_ASSCOMX_OFFSET,
-        )?;
-        layouter.constrain_instance(
-            asset_commit.inner().y().cell(),
-            config.primary,
-            MINT_ASSCOMY_OFFSET,
-        )?;
-
-        // At this point we've enforced all of our public inputs.
-        Ok(())
-    }
-}
-
-fn main() {
-    // The number of rows in our circuit cannot exceed 2^k
-    let k: u32 = 9;
-
-    let pubkey = pallas::Point::random(&mut OsRng);
-    let coords = pubkey.to_affine().coordinates().unwrap();
-
-    let value = 42;
-    let asset = 1;
-
-    let value_blind = pallas::Scalar::random(&mut OsRng);
-    let asset_blind = pallas::Scalar::random(&mut OsRng);
-
-    let serial = pallas::Base::random(&mut OsRng);
-    let coin_blind = pallas::Base::random(&mut OsRng);
-
-    // poseidon_hash(x, y) + poseidon_hash(value, asset) + poseidon_hash(serial, coin_blind)
-    let mut coin = pallas::Base::zero();
-
-    let messages = [
-        [*coords.x(), *coords.y()],
-        [pallas::Base::from(value), pallas::Base::from(asset)],
-        [serial, coin_blind],
-    ];
-
-    for msg in messages.iter() {
-        let hash = primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(*msg);
-        coin += hash;
-    }
-
-    let value_commit = pedersen_commitment(value, value_blind);
-    let value_coords = value_commit.to_affine().coordinates().unwrap();
-
-    let asset_commit = pedersen_commitment(asset, asset_blind);
-    let asset_coords = asset_commit.to_affine().coordinates().unwrap();
-
-    let public_inputs = vec![
-        coin,
-        *value_coords.x(),
-        *value_coords.y(),
-        *asset_coords.x(),
-        *asset_coords.y(),
-    ];
-
-    let circuit = MintCircuit {
-        pub_x: Some(*coords.x()),
-        pub_y: Some(*coords.y()),
-        value: Some(pallas::Base::from(value)),
-        asset: Some(pallas::Base::from(asset)),
-        serial: Some(serial),
-        coin_blind: Some(coin_blind),
-        value_blind: Some(value_blind),
-        asset_blind: Some(asset_blind),
-    };
-
-    let prover = MockProver::run(k, &circuit, vec![public_inputs.clone()]).unwrap();
-    assert_eq!(prover.verify(), Ok(()));
-
-    // Actual ZK proof
-    let start = Instant::now();
-    let vk = VerifyingKey::build(k, MintCircuit::default());
-    let pk = ProvingKey::build(k, MintCircuit::default());
-    println!("Setup: [{:?}]", start.elapsed());
-
-    let start = Instant::now();
-    let proof = Proof::create(&pk, &[circuit], &public_inputs).unwrap();
-    println!("Prove: [{:?}]", start.elapsed());
-
-    let start = Instant::now();
-    assert!(proof.verify(&vk, &public_inputs).is_ok());
-    println!("Verify: [{:?}]", start.elapsed());
-}

+ 0 - 4
examples/halo2/src/lib.rs

@@ -1,4 +0,0 @@
-pub mod constants;
-pub mod crypto;
-pub mod proof;
-pub mod spec;

+ 56 - 0
proof/burn.zk

@@ -0,0 +1,56 @@
+# :set syntax=zk
+# :source scripts/zk.vim
+constant EcFixedPoint VALUE_COMMIT_VALUE
+constant EcFixedPoint VALUE_COMMIT_RANDOM
+constant EcFixedPoint SPEND_AUTH_G
+
+contract Burn {
+    Base secret
+    Base serial
+    MerklePath path
+    Base leaf
+
+    Base value
+    Base asset
+    Scalar value_blind
+    Scalar asset_blind
+    Scalar sig_secret
+}
+
+circuit Burn {
+    # nullifier = Hash(secret, serial)
+    poseidon_hash nullifier secret serial
+    constrain_instance nullifier
+
+    # root = calculate_root(path, leaf)
+    calculate_merkle_root root path leaf
+    constrain_instance root
+
+    # value_commit = PedersenCommit(value, value_blind);
+    ec_mul_short vcv value VALUE_COMMIT_VALUE
+    ec_mul vcr value_blind VALUE_COMMIT_RANDOM
+    ec_add value_commit vcv vcr
+    ec_get_x x value_commit
+    ec_get_y y value_commit
+    constrain_instance x
+    constrain_instance y
+
+    # asset_commit = PedersenCommit(asset, asset_blind);
+    ec_mul_short acv asset VALUE_COMMIT_VALUE
+    ec_mul acr asset_blind VALUE_COMMIT_RANDOM
+    ec_add asset_commit acv acr
+    ec_get_x x asset_commit
+    ec_get_y y asset_commit
+    constrain_instance x
+    constrain_instance y
+
+    # spend_auth_public = sig_secret * SPEND_AUTH_G
+    ec_mul spend_auth_public sig_secret SPEND_AUTH_G
+    ec_get_x sx spend_auth_public
+    ec_get_y sy spend_auth_public
+    constrain_instance sx
+    constrain_instance sy
+
+    # return (nullifier, root, value_commit, value_blind);
+}
+

+ 46 - 0
proof/mint.zk

@@ -0,0 +1,46 @@
+# :set syntax=zk
+# :source scripts/zk.vim
+constant EcFixedPoint VALUE_COMMIT_VALUE
+constant EcFixedPoint VALUE_COMMIT_RANDOM
+
+contract Mint {
+    Base pub_x
+    Base pub_y
+    Base value
+    Base asset
+    Base serial
+    Base coin_blind
+    Scalar value_blind
+    Scalar asset_blind
+}
+
+circuit Mint {
+    # coin = Hash(pub_x, pub_y, value, asset, serial, coin_blind);
+    poseidon_hash C1 pub_x pub_y
+    poseidon_hash C2 value asset
+    poseidon_hash C3 serial coin_blind
+    add C12 C1 C2
+    add C C12 C3
+    constrain_instance C 
+
+    # value_commit = PedersenCommit(value, value_blind);
+    ec_mul_short vcv value VALUE_COMMIT_VALUE
+    ec_mul vcr value_blind VALUE_COMMIT_RANDOM
+    ec_add value_commit vcv vcr
+    ec_get_x x value_commit
+    ec_get_y y value_commit
+    constrain_instance x
+    constrain_instance y
+
+    # asset_commit = PedersenCommit(asset, asset_blind);
+    ec_mul_short acv asset VALUE_COMMIT_VALUE
+    ec_mul acr asset_blind VALUE_COMMIT_RANDOM
+    ec_add asset_commit acv acr
+    ec_get_x x asset_commit
+    ec_get_y y asset_commit
+    constrain_instance x
+    constrain_instance y
+
+    # return (coin, value_commit, asset_commit);
+}
+

+ 7 - 0
run_burn_zk.sh

@@ -0,0 +1,7 @@
+#!/bin/bash -x
+python script/zkas.py proof/burn.zk --bincode
+du -sh proof/burn.zk.bin
+python script/zkas.py proof/burn.zk
+#python script/zkas.py proof/mint.zk
+cargo run --release --bin vm2_burn
+

+ 7 - 0
run_mint_zk.sh

@@ -0,0 +1,7 @@
+#!/bin/bash -x
+python script/zkas.py proof/mint.zk --bincode
+du -sh proof/mint.zk.bin
+python script/zkas.py proof/mint.zk
+#python script/zkas.py proof/mint.zk
+cargo run --release --bin vm2
+

+ 187 - 0
script/research/halo/plonk_kate.sage

@@ -0,0 +1,187 @@
+# We'll use y^2 = x^3 + 3 for our curve, over F_101
+p = 101
+F = FiniteField(p)
+R.<x_f> = F[]
+E = EllipticCurve(F, [0, 3])
+print(E)
+
+e_points = E.points()
+# Our generator G_1 = E(1, 2)
+G_1 = e_points[1]
+
+# Let's find a subgroup with this generator.
+print(f"Finding a subgroup with generator {G_1} ...")
+r = 1
+elem = G_1
+while True:
+    elem += G_1
+    r += 1
+    if elem == e_points[0]:
+        break
+
+print(f"Found subgroup of order r={r} using generator {G_1}")
+
+# Now let's find the embedding degree.
+# The embedding degree is the smallest k such that r|p^k - 1
+# In other words: p^k == 1 mod r
+k = 1
+print(f"Finding embedding degree for {p}^k mod {r} ...")
+while True:
+    if p ^ k % r == 1:
+        break
+    k += 1
+
+print(f"Found embedding degree: k={k}")
+
+# Our extension field. The polynomial x^2+2 is irreducible in F_101.
+F2.<u> = F.extension(x_f^2+2, 'u')
+assert u^2 == -2
+print(F2)
+E2 = EllipticCurve(F2, [0, 3])
+print(E2)
+# One of the generators for this curve we can use is (36, 31u)
+G_2 = E2(36, 31*u)
+
+# Now we build the trusted setup. The SRS is a list of EC points
+# parameterized by a randomly generated secret number s.
+# According to the PLONK protocol paper, a circuit with n gates requires
+# an SRS with at least n+5 elements.
+
+# We choose 2 as our random number for demo purposes.
+s = 2
+# Our circuit will have 4 gates.
+n_gates = 4
+
+SRS = []
+for i in range(0, n_gates+3):
+	SRS.append(s^i * G_1)
+for i in range(0, 2):
+	SRS.append(s^i * G_2)
+
+# Composing our circuit. We'll test a^2 + b^2 = c^2:
+# x_1 * x_1 = x_2
+# x_3 * x_3 = x_4
+# x_5 * x_5 = x_6
+# x_2 + x_4 = x_6
+#
+# In order to satisfy these constraints, we need to supply six numbers
+# as wire values that make all of the equations correct.
+# e.g. x=(3, 9, 4, 16, 5, 25) would work.
+
+# A full PLONK gate looks like this:
+# (q_L)*a + (q_R)*b + (q_O)*c + (q_M)*a*b + q_C = 0
+#
+# Where a, b, c are the left, right, output wires of the gate.
+#
+# a + b = c  ---> q_L=1 , q_R=1, q_O=-1, q_M=0, q_C = 0
+# a * b = c  ---> q_O=-1, q_M=1, and the rest = 0
+#
+# To bind a variable to a public value:
+# q_R = q_O = q_M = 0
+# q_L = 1
+# q_C = public_value
+#
+# Considering all inputs as private, we get these four PLONK gates
+# representing our circuit:
+# 0*a_1 + 0*b_1 + (-1)*c_1 + 1*a_1*b_1 + 0 = 0    (a_1 * b_1 = c_1)
+# 0*a_2 + 0*b_2 + (-1)*c_2 + 1*a_2*b_2 + 0 = 0    (a_2 * b_2 = c_2)
+# 0*a_3 + 0*b_3 + (-1)*c_3 + 1*a_3*b_3 + 0 = 0    (a_3 * b_3 = c_3)
+# 1*a_4 + 1*b_4 + (-1)*c_4 + 0*a_4*b_4 + 0 = 0    (a_4 + b_4 = c_4)
+#
+# So let's test with (3, 4, 5)
+# a_i (left) values will be (3, 4, 5, 9)
+# b_i (right) values will be (3, 4, 5, 16)
+# c_i (output) values will be (9, 16, 25, 25)
+
+# Selectors
+q_L = vector([0, 0, 0, 1])
+q_R = vector([0, 0, 0, 1])
+q_O = vector([-1, -1, -1, -1])
+q_M = vector([1, 1, 1, 0])
+q_C = vector([0, 0, 0, 0])
+# Assignments
+a = vector([3, 4, 5, 9])
+b = vector([3, 4, 5, 16])
+c = vector([9, 16, 25, 25])
+
+# Roots of Unity.
+# The vectors for our circuit and assignment are all length 4, so the domain
+# for our polynomial interpolation must have at least four elements.
+roots_of_unity = []
+F_r = FiniteField(r)
+for i in F_r:
+	if i^4 == 1:
+		roots_of_unity.append(i)
+
+omega_0 = roots_of_unity[0]
+omega_1 = roots_of_unity[1]
+omega_2 = roots_of_unity[3]
+omega_3 = roots_of_unity[2]
+
+# Cosets
+# k_1 not in H, k_2 not in H nor k_1H
+k_1 = 2
+k_2 = 3
+H = [omega_0, omega_1, omega_2, omega_3]
+k1H = [H[0]*k_1, H[1]*k_1, H[2]*k_1, H[3]*k_1]
+k2H = [H[0]*k_2, H[1]*k_2, H[2]*k_2, H[3]*k_2]
+print("Polynomial interpolation using roots of unity")
+print(f"H:   {H}")
+print(f"k1H: {k1H}")
+print(f"k2H: {k2H}")
+
+# Interpolating using the Roots of Unity
+# The interpolated polynomial will be degree-3 and have the form:
+# f_a(x) = d + c*x + b*x^2 + a*x^3
+# f_a(1) = 3, f_a(4) = 4, f_a(16) = 5, f_a(13) = 9
+# Note that the above x is H (the omegas)
+#
+# This gives a system of equations:
+# f(1)  = d + c*1 + b*1^2 + a*1^3 = 3
+# f(4)  = d + c*4 + b*4^2 + a*4^3 = 4
+# f(16) = d + c*16 + b*16^2 + a*16^3 = 5
+# f(13) = d + c*13 + b*13^2 + a*13^3 = 9
+
+# We can rewrite it as a matrix equation and solve by computing
+# an inverse matrix.
+def inverse_matrix(c):
+	return Matrix([
+		[c[0]^0, c[0]^1, c[0]^2, c[0]^3],
+		[c[1]^0, c[1]^1, c[1]^2, c[1]^3],
+		[c[2]^0, c[2]^1, c[2]^2, c[2]^3],
+		[c[3]^0, c[3]^1, c[3]^2, c[3]^3],
+	])^-1
+
+# Now we can find polynomial f_a by multiplying the vector a=(3,4,5,9) by
+# the interpolation matrix.
+f_a_coeffs = inverse_matrix(H) * a
+f_b_coeffs = inverse_matrix(H) * b
+f_c_coeffs = inverse_matrix(H) * c
+q_L_coeffs = inverse_matrix(H) * q_L
+q_R_coeffs = inverse_matrix(H) * q_R
+q_O_coeffs = inverse_matrix(H) * q_O
+q_M_coeffs = inverse_matrix(H) * q_M
+q_C_coeffs = inverse_matrix(H) * q_C
+
+# The copy constraints involving left, right, output values are encoded as
+# polynomials S_sigma_1, S_sigma_2, S_sigma_3 using the cosets we found
+# earlier. The roots of unity H are used to label entries in vector a,
+# the elements of k1H are used to label entries in vector b, and vector c is
+# labeled by the elements of k2H.
+print("Copy constraints:")
+print(f"a: {a}")
+print(f"b: {b}")
+print(f"c: {c}")
+# a1 = b1, a2 = b2, a3 = b3, a4 = c1
+sigma_1 = vector([k1H[0], k1H[1], k1H[2], k2H[0]])
+print(f"sigma_1: {sigma_1}")
+# b1 = a1, b2 = a2, b3 = a3, b4 = c2
+sigma_2 = vector([H[0], H[1], H[2], k2H[1]])
+print(f"sigma_2: {sigma_2}")
+# c1 = a4, c2 = b4, c3 = c4, c4 = c3
+sigma_3 = vector([H[3], k1H[3], k2H[3], k2H[2]])
+print(f"sigma_3: {sigma_3}")
+
+S_sigma_1_coeffs = inverse_matrix(H) * sigma_1
+S_sigma_2_coeffs = inverse_matrix(H) * sigma_2
+S_sigma_3_coeffs = inverse_matrix(H) * sigma_3

+ 33 - 0
script/research/rsa_accum.sage

@@ -0,0 +1,33 @@
+p = 2^31 - 1
+q = 2^61 - 1
+assert is_prime(p)
+assert is_prime(q)
+n = p * q
+# Order of the multiplicative group for n
+# phi = (p - 1) * (q - 1)
+K = IntegerModRing(n)
+
+A_0 = K(5)
+
+c_0 = random_prime(2^12)
+A_1 = A_0^c_0
+
+c_1 = random_prime(2^12)
+A_2 = A_1^c_1
+
+c_2 = random_prime(2^12)
+W_3 = A_2
+A_3 = A_2^c_2
+
+c_3 = random_prime(2^12)
+W_4 = W_3^c_3
+A_4 = A_3^c_3
+
+c_4 = random_prime(2^12)
+W_5 = W_4^c_4
+A_5 = A_4^c_4
+
+assert W_5^c_2 == A_5
+assert A_5 == A_0^(c_0 * c_1 * c_2 * c_3 * c_4)
+assert W_5 == A_0^(c_0 * c_1       * c_3 * c_4)
+

+ 5 - 0
script/to_html.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+#nvim -c ":TOhtml" $1
+sed -i "s/PreProc { color: #5fd7ff; }/PreProc { color: #8f2722; }/" $1
+sed -i "s/Comment { color: #00ffff; }/Comment { color: #0055ff; }/" $1
+

+ 41 - 0
script/zk.vim

@@ -0,0 +1,41 @@
+"For autoload, add this to your VIM config:
+"   VIM:    .vimrc
+"   NeoVIM: .config/nvim/init.vim
+"
+"autocmd BufRead *.pism call SetPismOptions()
+"function SetPismOptions()
+"    set syntax=pism
+"    source /home/narodnik/src/drk/scripts/pism.vim
+"endfunction
+
+if exists('b:current_syntax')
+    finish
+endif
+
+syn keyword drkKeyword constant contract circuit
+"syn keyword drkAttr
+syn keyword drkType EcFixedPoint Base Scalar
+"syn keyword drkFunctionKeyword enforce lc0_add_one lc1_add_one lc2_add_one lc_coeff_reset lc_coeff_double lc0_sub_one lc1_sub_one lc2_sub_one dump_alloc dump_local
+syn match drkFunction "^[ ]*[a-z_0-9]* "
+syn match drkComment "#.*$"
+syn match drkNumber ' \zs\d\+\ze'
+syn match drkHexNumber ' \zs0x[a-z0-9]\+\ze'
+syn match drkConst '[A-Z_]\{2,}[A-Z0-9_]*'
+syn keyword drkBoolVal true false
+syn match drkPreproc "{%.*%}"
+syn match drkPreproc2 "{{.*}}"
+
+hi def link drkKeyword    Statement
+"hi def link drkAttr       StorageClass
+hi def link drkPreproc    PreProc
+hi def link drkPreproc2   PreProc
+hi def link drkType       Type
+hi def link drkFunction   Function
+hi def link drkFunctionKeyword Function
+hi def link drkComment    Comment
+hi def link drkNumber     Constant
+hi def link drkHexNumber  Constant
+hi def link drkConst      Constant
+hi def link drkBoolVal    Constant
+
+let b:current_syntax = "pism"

+ 402 - 0
script/zkas.py

@@ -0,0 +1,402 @@
+import argparse
+import sys
+
+from zkas.types import *
+
+class CompileException(Exception):
+
+    def __init__(self, error_message, line):
+        super().__init__(error_message)
+        self.error_message = error_message
+        self.line = line
+
+class Constants:
+
+    def __init__(self):
+        self.table = []
+        self.map = {}
+
+    def add(self, variable, type_id):
+        idx = len(self.table)
+        self.table.append(type_id)
+        self.map[variable] = idx
+
+    def lookup(self, variable):
+        idx = self.map[variable]
+        return self.table[idx]
+
+    def variables(self):
+        return self.map.keys()
+
+class SyntaxStruct:
+
+    def __init__(self):
+        self.contracts = {}
+        self.circuits = {}
+        self.constants = Constants()
+
+    def parse_contract(self, line, it):
+        assert line.tokens[0] == "contract"
+        if len(line.tokens) != 3 or line.tokens[2] != "{":
+            raise CompileException("malformed contract opening", line)
+        name = line.tokens[1]
+        if name in self.contracts:
+            raise CompileException(f"duplicate contract {name}", line)
+        lines = []
+
+        while True:
+            try:
+                line = next(it)
+            except StopIteration:
+                raise CompileException(
+    f"premature end of file while parsing {name} contract", line)
+
+            assert len(line.tokens) > 0
+            if line.tokens[0] == "}":
+                break
+
+            lines.append(line)
+
+        self.contracts[name] = lines
+
+    def parse_circuit(self, line, it):
+        assert line.tokens[0] == "circuit"
+        if len(line.tokens) != 3 or line.tokens[2] != "{":
+            raise CompileException("malformed circuit opening", line)
+        name = line.tokens[1]
+        if name in self.circuits:
+            raise CompileException(f"duplicate contract {name}", line)
+        lines = []
+
+        while True:
+            try:
+                line = next(it)
+            except StopIteration:
+                raise CompileException(
+    f"premature end of file while parsing {name} circuit", line)
+
+            assert len(line.tokens) > 0
+            if line.tokens[0] == "}":
+                break
+
+            lines.append(line)
+
+        self.circuits[name] = lines
+
+    def parse_constant(self, line):
+        assert line.tokens[0] == "constant"
+        if len(line.tokens) != 3:
+            raise CompileException("malformed constant line", line)
+        _, type_name, variable = line.tokens
+        if type_name not in allowed_types:
+            raise CompileException("unknown type '{type}'", line)
+        type_id = allowed_types[type_name]
+        self.constants.add(variable, type_id)
+
+    def verify(self):
+        self.static_checks()
+        schema = self.format_data()
+        self.trace_circuits(schema)
+        return schema
+
+    def static_checks(self):
+        for name, lines in self.contracts.items():
+            for line in lines:
+                if len(line.tokens) != 2:
+                    raise CompileException("incorrect number of tokens", line)
+                type, variable = line.tokens
+                if type not in allowed_types:
+                    raise CompileException(
+                        f"unknown type specifier for variable {variable}", line)
+
+        for name, lines in self.circuits.items():
+            for line in lines:
+                assert len(line.tokens) > 0
+                func_name, args = line.tokens[0], line.tokens[1:]
+                if func_name not in function_formats:
+                    raise CompileException(f"unknown function call {func_name}",
+                                         line)
+                func_format = function_formats[func_name]
+                if len(args) != func_format.total_arguments():
+                    raise CompileException(
+        f"incorrect number of arguments for function call {func_name}", line)
+
+        # Finally check there are matching circuits and contracts
+        all_names = set(self.circuits.keys()) | set(self.contracts.keys())
+
+        for name in all_names:
+            if name not in self.contracts:
+                raise CompileException(f"missing contract for {name}", None)
+            if name not in self.circuits:
+                raise CompileException(f"missing circuit for {name}", None)
+
+    def format_data(self):
+        schema = []
+        for name, circuit in self.circuits.items():
+            assert name in self.contracts
+            contract = self.contracts[name]
+
+            witness = []
+            for line in contract:
+                assert len(line.tokens) == 2
+                type_name, variable = line.tokens
+                assert type_name in allowed_types
+                type_id = allowed_types[type_name]
+                witness.append((type_id, variable, line))
+
+            code = []
+            for line in circuit:
+                assert len(line.tokens) > 0
+                func_name, args = line.tokens[0], line.tokens[1:]
+                assert func_name in function_formats
+                func_format = function_formats[func_name]
+                assert len(args) == func_format.total_arguments()
+
+                return_values = []
+                if func_format.return_type_ids:
+                    rv_len = len(func_format.return_type_ids)
+                    return_values, args = args[:rv_len], args[rv_len:]
+
+                func_id = func_format.func_id
+                code.append((func_format, return_values, args, line))
+
+            schema.append((name, witness, code))
+        return schema
+
+    def trace_circuits(self, schema):
+        for name, witness, code in schema:
+            tracer = DynamicTracer(name, witness, code, self.constants)
+            tracer.execute()
+
+class DynamicTracer:
+
+    def __init__(self, name, contract_witness, circuit_code, constants):
+        self.name = name
+        self.witness = contract_witness
+        self.code = circuit_code
+        self.constants = constants
+
+    def execute(self):
+        stack = {}
+
+        # Load constants
+        for variable in self.constants.variables():
+            stack[variable] = self.constants.lookup(variable)
+
+        # Preload stack with our witness values
+        for type_id, variable, line in self.witness:
+            stack[variable] = type_id
+
+        for i, (func_format, return_values, args, code_line) \
+            in enumerate(self.code):
+
+            assert len(args) == len(func_format.param_types)
+            for variable, type_id in zip(args, func_format.param_types):
+                if variable not in stack:
+                    raise CompileException(
+                        f"variable '{variable}' is not defined", code_line)
+
+                stack_type_id = stack[variable]
+                if stack_type_id != type_id:
+                    type_name = type_id_to_name[type_id]
+                    stack_type_name = type_id_to_name[stack_type_id]
+                    raise CompileException(
+    f"variable '{variable}' has incorrect type. "
+    f"Found {type_name} but expected variable of "
+    f"type {stack_type_name}", code_line)
+
+                assert len(return_values) == len(func_format.return_type_ids)
+
+                for return_variable, return_type_id \
+                    in zip(return_values, func_format.return_type_ids):
+
+                    # Note that later variables shadow earlier ones.
+                    # We accept this.
+
+                    stack[return_variable] = return_type_id
+
+class CodeLine:
+
+    def __init__(self, func_format, return_values, args, arg_idxs, code_line):
+        self.func_format = func_format
+        self.return_values = return_values
+        self.args = args
+        self.arg_idxs = arg_idxs
+        self.code_line = code_line
+
+    def func_name(self):
+        return func_id_to_name[self.func_format.func_id]
+
+class CompiledContract:
+
+    def __init__(self, name, witness, code):
+        self.name = name
+        self.witness = witness
+        self.code = code
+
+class Compiler:
+
+    def __init__(self, witness, uncompiled_code, constants):
+        self.witness = witness
+        self.uncompiled_code = uncompiled_code
+        self.constants = constants
+
+    def compile(self):
+        code = []
+
+        # Each unique type_id has its own stack
+        stacks = [[] for i in range(TYPE_ID_LAST)]
+        # Map from variable name to stacks above
+        stack_vars = {}
+
+        def alloc(variable, type_id):
+            assert type_id <= len(stacks)
+            idx = len(stacks[type_id])
+            # Add variable to the stack for its type_id
+            stacks[type_id].append(variable)
+            # Create mapping from variable name
+            stack_vars[variable] = (type_id, idx)
+
+        # Load constants
+        for variable in self.constants.variables():
+            type_id = self.constants.lookup(variable)
+            alloc(variable, type_id)
+
+        # Preload stack with our witness values
+        for type_id, variable, line in self.witness:
+            alloc(variable, type_id)
+
+        for i, (func_format, return_values, args, code_line) \
+            in enumerate(self.uncompiled_code):
+
+            assert len(args) == len(func_format.param_types)
+
+            arg_idxs = []
+
+            # Loop through all arguments
+            for variable, type_id in zip(args, func_format.param_types):
+                assert type_id <= len(stacks)
+                assert variable in stack_vars
+                # Find the index for the M by N matrix of our variable
+                loc_type_id, loc_idx = stack_vars[variable]
+                assert type_id == loc_type_id
+                assert stacks[loc_type_id][loc_idx] == variable
+
+                # This is the info to be serialized, not the variable names
+                arg_idxs.append(loc_idx)
+
+            assert len(return_values) == len(func_format.return_type_ids)
+
+            for return_variable, return_type_id \
+                in zip(return_values, func_format.return_type_ids):
+
+                # Allocate returned values so they can be used by
+                # subsequent function calls.
+                alloc(return_variable, return_type_id)
+
+            code.append(CodeLine(func_format, return_values, args,
+                                 arg_idxs, code_line))
+
+        return code
+
+class Line:
+
+    def __init__(self, tokens, original_line, number):
+        self.tokens = tokens
+        self.orig = original_line
+        self.number = number
+
+    def __repr__(self):
+        return f"Line({self.number}: {str(self.tokens)})"
+
+def load(src_file):
+    source = []
+    for i, original_line in enumerate(src_file):
+        # Remove whitespace on both sides
+        line = original_line.strip()
+        # Strip out comments
+        line = line.split("#")[0]
+        # Split at whitespace
+        line = line.split()
+        if not line:
+            continue
+        line_number = i + 1
+        source.append(Line(line, original_line, line_number))
+    return source
+
+def parse(source):
+    syntax = SyntaxStruct()
+    it = iter(source)
+    while True:
+        try:
+            line = next(it)
+        except StopIteration:
+            break
+
+        assert len(line.tokens) > 0
+        if line.tokens[0] == "contract":
+            syntax.parse_contract(line, it)
+        elif line.tokens[0] == "circuit":
+            syntax.parse_circuit(line, it)
+        elif line.tokens[0] == "constant":
+            syntax.parse_constant(line)
+        elif line.tokens[0] == "}":
+            raise CompileException("unmatched delimiter '}'", line)
+    return syntax
+
+def main():
+    parser = argparse.ArgumentParser()
+    parser.add_argument("SOURCE", help="ZK script to compile")
+    parser.add_argument("--output", default=None, help="output file")
+    group = parser.add_mutually_exclusive_group()
+    group.add_argument('--display', action='store_true',
+                       help="show the compiled code in human readable format")
+    group.add_argument('--bincode', action='store_true',
+                       help="output compiled code to zkvm supervisor")
+    args = parser.parse_args()
+
+    with open(args.SOURCE, "r") as src_file:
+        source = load(src_file)
+    try:
+        syntax = parse(source)
+        schema = syntax.verify()
+        contracts = []
+        for name, witness, uncompiled_code in schema:
+            compiler = Compiler(witness, uncompiled_code, syntax.constants)
+            code = compiler.compile()
+            contracts.append(CompiledContract(name, witness, code))
+        constants = syntax.constants
+        if args.display:
+            from zkas.text_output import output
+            if args.output is None:
+                output(sys.stdout, contracts, constants)
+            else:
+                with open(outpath, "w") as file:
+                    output(file, contracts, constants)
+        elif args.bincode:
+            from zkas.bincode_output import output
+            outpath = args.output
+            if args.output is None:
+                outpath = args.SOURCE + ".bin"
+            with open(outpath, "wb") as file:
+                output(file, contracts, constants)
+        else:
+            from zkas.text_output import output
+            if args.output is None:
+                output(sys.stdout, contracts, constants)
+            else:
+                with open(outpath, "w") as file:
+                    output(file, contracts, constants)
+    except CompileException as ex:
+        print(f"Error: {ex.error_message}", file=sys.stderr)
+        if ex.line is not None:
+            print(f"Line {ex.line.number}: {ex.line.orig}", file=sys.stderr)
+        #return -1
+        raise
+    return 0
+
+if __name__ == "__main__":
+    sys.exit(main())
+
+# todo: think about extendable payment scheme which
+# is like bitcoin soft forks

+ 0 - 0
script/zkas/__init__.py


+ 50 - 0
script/zkas/bincode_output.py

@@ -0,0 +1,50 @@
+import struct
+
+def varuint(value):
+    if value <= 0xfc:
+        return struct.pack("<B", value)
+    elif value <= 0xffff:
+        return struct.pack("<BH", 0xfd, value)
+    elif value <= 0xffffffff:
+        return struct.pack("<BI", 0xfe, value)
+    else:
+        return struct.pack("<BQ", 0xff, value)
+
+def write_len(output, objects):
+    output.write(varuint(len(objects)))
+
+def write_value(fmt, output, value):
+    value_bytes = struct.pack("<" + fmt, value)
+    output.write(value_bytes)
+
+def write_u8(output, value):
+    write_value("B", output, value)
+def write_u32(output, value):
+    write_value("I", output, value)
+
+def output_contract(output, contract):
+    write_len(output, contract.name)
+    output.write(contract.name.encode())
+    write_len(output, contract.witness)
+    for type_id, variable, _ in contract.witness:
+        write_len(output, variable)
+        output.write(variable.encode())
+        write_u8(output, type_id)
+    write_len(output, contract.code)
+    for code in contract.code:
+        func_id = code.func_format.func_id
+        write_u8(output, func_id)
+        for arg_idx in code.arg_idxs:
+            write_u32(output, arg_idx)
+
+def output(output, contracts, constants):
+    write_len(output, constants.variables())
+    for variable in constants.variables():
+        write_len(output, variable)
+        output.write(variable.encode())
+        type_id = constants.lookup(variable)
+        write_u8(output, type_id)
+    write_len(output, contracts)
+    for contract in contracts:
+        output_contract(output, contract)
+

+ 21 - 0
script/zkas/text_output.py

@@ -0,0 +1,21 @@
+from .types import type_id_to_name, func_id_to_name
+
+def output(output, contracts, constants):
+    output.write("Constants:\n")
+    for variable in constants.variables():
+        type_id = constants.lookup(variable)
+        output.write(f"  {type_id} {variable}\n")
+    for contract in contracts:
+        output.write(f"{contract.name}:\n")
+
+        output.write(f"  Witness:\n")
+        for type_id, variable, _ in contract.witness:
+            type_name = type_id_to_name[type_id]
+            output.write(f"    {type_name} {variable}\n")
+
+        output.write(f"  Code:\n")
+        for code in contract.code:
+            output.write(f"    # args = {code.args}\n")
+            output.write(f"    {code.func_name()} {code.return_values} "
+                             f"{code.arg_idxs}\n")
+

+ 77 - 0
script/zkas/types.py

@@ -0,0 +1,77 @@
+TYPE_ID_BASE                    = 0
+TYPE_ID_SCALAR                  = 1
+TYPE_ID_EC_POINT                = 2
+TYPE_ID_EC_FIXED_POINT          = 3
+TYPE_ID_MERKLE_PATH             = 4
+# This is so we know the number of TYPE_ID stacks
+TYPE_ID_LAST                    = 5
+
+allowed_types = {
+    "Base":                 TYPE_ID_BASE,
+    "Scalar":               TYPE_ID_SCALAR,
+    "EcFixedPoint":         TYPE_ID_EC_FIXED_POINT,
+    "MerklePath":           TYPE_ID_MERKLE_PATH,
+}
+# Used for debug and error messages
+type_id_to_name = dict((value, key) for key, value in allowed_types.items())
+
+FUNC_ID_POSEIDON_HASH           = 0
+FUNC_ID_ADD                     = 1
+FUNC_ID_CONSTRAIN_INSTANCE      = 2
+FUNC_ID_EC_MUL_SHORT            = 3
+FUNC_ID_EC_MUL                  = 4
+FUNC_ID_EC_ADD                  = 5
+FUNC_ID_EC_GET_X                = 6
+FUNC_ID_EC_GET_Y                = 7
+FUNC_ID_CALCULATE_MERKLE_ROOT   = 8
+
+class FuncFormat:
+
+    def __init__(self, func_id, return_type_ids, param_types):
+        self.func_id = func_id
+        self.return_type_ids = return_type_ids
+        self.param_types = param_types
+
+    def total_arguments(self):
+        return len(self.return_type_ids) + len(self.param_types)
+
+function_formats = {
+    "poseidon_hash": FuncFormat(
+        # Funcion ID            Type ID             Parameter types
+        FUNC_ID_POSEIDON_HASH,  [TYPE_ID_BASE],     [TYPE_ID_BASE,
+                                                     TYPE_ID_BASE]
+    ),
+    "add": FuncFormat(
+        FUNC_ID_ADD,            [TYPE_ID_BASE],     [TYPE_ID_BASE,
+                                                     TYPE_ID_BASE]
+    ),
+    "constrain_instance": FuncFormat(
+        FUNC_ID_CONSTRAIN_INSTANCE, [],             [TYPE_ID_BASE]
+    ),
+    "ec_mul_short": FuncFormat(
+        FUNC_ID_EC_MUL_SHORT,   [TYPE_ID_EC_POINT], [TYPE_ID_BASE,
+                                                     TYPE_ID_EC_FIXED_POINT]
+    ),
+    "ec_mul": FuncFormat(
+        FUNC_ID_EC_MUL,         [TYPE_ID_EC_POINT], [TYPE_ID_SCALAR,
+                                                     TYPE_ID_EC_FIXED_POINT]
+    ),
+    "ec_add": FuncFormat(
+        FUNC_ID_EC_ADD,         [TYPE_ID_EC_POINT], [TYPE_ID_EC_POINT,
+                                                     TYPE_ID_EC_POINT]
+    ),
+    "ec_get_x": FuncFormat(
+        FUNC_ID_EC_GET_X,       [TYPE_ID_BASE],     [TYPE_ID_EC_POINT]
+    ),
+    "ec_get_y": FuncFormat(
+        FUNC_ID_EC_GET_Y,       [TYPE_ID_BASE],     [TYPE_ID_EC_POINT]
+    ),
+    "calculate_merkle_root": FuncFormat(
+        FUNC_ID_CALCULATE_MERKLE_ROOT, 
+                                [TYPE_ID_BASE],     [TYPE_ID_MERKLE_PATH,
+                                                     TYPE_ID_BASE]
+    ),
+}
+
+func_id_to_name = dict((fmt.func_id, key) for key, fmt
+                       in function_formats.items())

+ 1 - 1
src/async_serial.rs

@@ -1,8 +1,8 @@
 use futures::prelude::*;
 
 use crate::endian;
-use crate::error::{Error, Result};
 use crate::serial::VarInt;
+use crate::{Error, Result};
 
 impl VarInt {
     pub async fn encode_async<W: AsyncWrite + Unpin>(&self, stream: &mut W) -> Result<usize> {

+ 157 - 29
examples/halo2/src/bin/burn.rs → src/bin/burn.rs

@@ -29,24 +29,33 @@ use halo2_gadgets::{
         merkle::MerklePath,
     },
     utilities::{
-        lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
+        copy, lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
     },
 };
+use incrementalmerkletree::{
+    bridgetree::{BridgeTree, Frontier as BridgeFrontier},
+    Altitude, Frontier, Tree,
+};
 use pasta_curves::{
     arithmetic::{CurveAffine, Field},
-    group::{ff::PrimeFieldBits, Curve},
+    group::{
+        ff::{PrimeField, PrimeFieldBits},
+        Curve,
+    },
     pallas,
 };
 use rand::rngs::OsRng;
 
-use drk_halo2::{
+use drk::crypto::{
     constants::{
-        sinsemilla::{OrchardCommitDomains, OrchardHashDomains, MERKLE_CRH_PERSONALIZATION},
+        sinsemilla::{
+            i2lebsp, OrchardCommitDomains, OrchardHashDomains, MERKLE_CRH_PERSONALIZATION,
+        },
         OrchardFixedBases,
     },
-    crypto::pedersen_commitment,
+    merkle_node2::MerkleNode,
     proof::{Proof, ProvingKey, VerifyingKey},
-    spec::i2lebsp,
+    util::{pedersen_commitment_scalar, pedersen_commitment_u64},
 };
 
 #[derive(Clone, Debug)]
@@ -119,7 +128,6 @@ struct BurnCircuit {
     coin_blind: Option<pallas::Base>,
     value_blind: Option<pallas::Scalar>,
     asset_blind: Option<pallas::Scalar>,
-    leaf: Option<pallas::Base>,
     leaf_pos: Option<u32>,
     merkle_path: Option<[pallas::Base; 32]>,
     sig_secret: Option<pallas::Scalar>,
@@ -290,7 +298,7 @@ impl Circuit<pallas::Base> for BurnCircuit {
         // =========
         // Nullifier
         // =========
-        let hashed_secret_key = self.load_private(
+        let secret_key = self.load_private(
             layouter.namespace(|| "load sinsemilla(secret key)"),
             config.advices[0],
             self.secret_key,
@@ -302,7 +310,7 @@ impl Circuit<pallas::Base> for BurnCircuit {
             self.serial,
         )?;
 
-        let message = [hashed_secret_key, serial];
+        let message = [secret_key, serial];
         let hash = {
             let poseidon_message = layouter.assign_region(
                 || "load message",
@@ -341,14 +349,117 @@ impl Circuit<pallas::Base> for BurnCircuit {
 
         layouter.constrain_instance(hash.cell(), config.primary, BURN_NULLIFIER_OFFSET)?;
 
+        // let nullifier_k = FixedPointBaseField::from_inner(ecc_chip.clone(), NullifierK);
+        //     nullifier_k.mul(
+        //         layouter.namespace(|| "[poseidon_output + psi_old] NullifierK"),
+        //         scalar,
+        //     )?
+
+        let value = self.load_private(
+            layouter.namespace(|| "load value"),
+            config.advices[0],
+            self.value,
+        )?;
+
+        let asset = self.load_private(
+            layouter.namespace(|| "load asset"),
+            config.advices[0],
+            self.asset,
+        )?;
+
+        let coin_blind = self.load_private(
+            layouter.namespace(|| "load coin_blind"),
+            config.advices[0],
+            self.coin_blind,
+        )?;
+
+        let public_key = {
+            let nullifier_k = OrchardFixedBases::NullifierK;
+            let nullifier_k = FixedPoint::from_inner(ecc_chip.clone(), nullifier_k);
+            nullifier_k.mul_base_field(layouter.namespace(|| "[x_s] Nullifier"), secret_key)?
+        };
+
+        let (pub_x, pub_y) = (public_key.inner().x(), public_key.inner().y());
+
+        // =========
+        // Coin hash
+        // =========
+        let messages = [[pub_x, pub_y], [value, asset], [serial, coin_blind]];
+        let mut hashes = vec![];
+
+        for message in messages.iter() {
+            let hash = {
+                let poseidon_message = layouter.assign_region(
+                    || "load message",
+                    |mut region| {
+                        let mut message_word = |i: usize| {
+                            let value = message[i].value();
+                            let var = region.assign_advice(
+                                || format!("load message_{}", i),
+                                config.poseidon_config.state()[i],
+                                0,
+                                || value.ok_or(Error::SynthesisError),
+                            )?;
+                            region.constrain_equal(var, message[i].cell())?;
+                            Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
+                                var, value,
+                            )))
+                        };
+                        Ok([message_word(0)?, message_word(1)?])
+                    },
+                )?;
+
+                let poseidon_hasher = PoseidonHash::init(
+                    config.poseidon_chip(),
+                    layouter.namespace(|| "Poseidon init"),
+                    ConstantLength::<2>,
+                )?;
+
+                let poseidon_output = poseidon_hasher.hash(
+                    layouter.namespace(|| "Poseidon hash (a, b)"),
+                    poseidon_message,
+                )?;
+
+                let poseidon_output: CellValue<pallas::Base> = poseidon_output.inner().into();
+                poseidon_output
+            };
+
+            hashes.push(hash);
+        }
+
+        let coin = layouter.assign_region(
+            || " `coin` = hash(a,b) + hash(c, d) + hash(e, f)",
+            |mut region| {
+                config.q_add.enable(&mut region, 0)?;
+
+                copy(&mut region, || "copy ab", config.advices[6], 0, &hashes[0])?;
+                copy(&mut region, || "copy cd", config.advices[7], 0, &hashes[1])?;
+                copy(&mut region, || "copy ef", config.advices[8], 0, &hashes[2])?;
+
+                let scalar_val = hashes[0]
+                    .value()
+                    .zip(hashes[1].value())
+                    .zip(hashes[2].value())
+                    .map(|(abcd, ef)| abcd.0 + abcd.1 + ef);
+
+                let cell = region.assign_advice(
+                    || "hash(a,b)+hash(c,d)+hash(e,f)",
+                    config.advices[5],
+                    0,
+                    || scalar_val.ok_or(Error::SynthesisError),
+                )?;
+                Ok(CellValue::new(cell, scalar_val))
+            },
+        )?;
+
         // ===========
         // Merkle root
         // ===========
-        let leaf = self.load_private(
-            layouter.namespace(|| "load leaf"),
-            config.advices[0],
-            self.leaf,
-        )?;
+        //let leaf = self.load_private(
+        //    layouter.namespace(|| "load leaf"),
+        //    config.advices[0],
+        //    self.leaf,
+        //)?;
 
         let path = MerklePath {
             chip_1: merkle_chip_1,
@@ -359,7 +470,7 @@ impl Circuit<pallas::Base> for BurnCircuit {
         };
 
         let computed_final_root =
-            path.calculate_root(layouter.namespace(|| "calculate root"), leaf)?;
+            path.calculate_root(layouter.namespace(|| "calculate root"), coin)?;
 
         layouter.constrain_instance(
             computed_final_root.cell(),
@@ -502,11 +613,15 @@ fn root(path: [pallas::Base; 32], leaf_pos: u32, leaf: pallas::Base) -> pallas::
     node
 }
 
+fn mod_r_p(x: pallas::Base) -> pallas::Scalar {
+    pallas::Scalar::from_repr(x.to_repr()).unwrap()
+}
+
 fn main() {
     // The number of rows in our circuit cannot exceed 2^k
     let k: u32 = 11;
 
-    let secret_key = pallas::Scalar::random(&mut OsRng);
+    let secret = pallas::Base::random(&mut OsRng);
     let serial = pallas::Base::random(&mut OsRng);
 
     let value = 42;
@@ -514,15 +629,15 @@ fn main() {
 
     // Nullifier = poseidon(sinsemilla(secret_key), serial)
     let domain = primitives::sinsemilla::HashDomain::new(S_PERSONALIZATION);
-    let bits_secretkey: Vec<bool> = secret_key.to_le_bits().iter().by_val().collect();
-    let hashed_secret_key = domain.hash(iter::empty().chain(bits_secretkey)).unwrap();
+    //let bits_secretkey: Vec<bool> = secret_key.to_le_bits().iter().by_val().collect();
+    //let hashed_secret_key = domain.hash(iter::empty().chain(bits_secretkey)).unwrap();
 
-    let nullifier = [hashed_secret_key, serial];
+    let nullifier = [secret, serial];
     let nullifier =
         primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(nullifier);
 
     // Public key derivation
-    let public_key = OrchardFixedBases::SpendAuthG.generator() * secret_key;
+    let public_key = OrchardFixedBases::NullifierK.generator() * mod_r_p(secret);
     let coords = public_key.to_affine().coordinates().unwrap();
 
     // Construct Coin
@@ -539,17 +654,31 @@ fn main() {
         coin += hash;
     }
 
+    let mut tree = BridgeTree::<MerkleNode, 32>::new(100);
+    for _ in 0..10 {
+        let random_node = MerkleNode(pallas::Base::random(&mut OsRng));
+        tree.append(&random_node);
+    }
+    let node = MerkleNode(coin.clone());
+    tree.append(&node);
+    tree.witness();
+    for _ in 0..10 {
+        let random_node = MerkleNode(pallas::Base::random(&mut OsRng));
+        tree.append(&random_node);
+    }
+
+    let (merkle_position, merkle_path) = tree.authentication_path(&node).unwrap();
+
     // Merkle root
-    let leaf = pallas::Base::random(&mut OsRng);
-    let pos = rand::random::<u32>();
-    let path: Vec<_> = (0..32).map(|_| pallas::Base::random(&mut OsRng)).collect();
-    let merkle_root = root(path.clone().try_into().unwrap(), pos, leaf);
+    let pos: u64 = merkle_position.into();
+    let path: Vec<pallas::Base> = merkle_path.iter().map(|node| node.0).collect();
+    let merkle_root = tree.root().0;
 
     // Value and asset commitments
     let value_blind = pallas::Scalar::random(&mut OsRng);
     let asset_blind = pallas::Scalar::random(&mut OsRng);
-    let value_commit = pedersen_commitment(value, value_blind);
-    let asset_commit = pedersen_commitment(asset, asset_blind);
+    let value_commit = pedersen_commitment_u64(value, value_blind);
+    let asset_commit = pedersen_commitment_u64(asset, asset_blind);
 
     let value_coords = value_commit.to_affine().coordinates().unwrap();
     let asset_coords = asset_commit.to_affine().coordinates().unwrap();
@@ -571,15 +700,14 @@ fn main() {
     ];
 
     let circuit = BurnCircuit {
-        secret_key: Some(hashed_secret_key),
+        secret_key: Some(secret),
         serial: Some(serial),
         value: Some(pallas::Base::from(value)),
         asset: Some(pallas::Base::from(asset)),
         coin_blind: Some(coin_blind),
         value_blind: Some(value_blind),
         asset_blind: Some(asset_blind),
-        leaf: Some(leaf),
-        leaf_pos: Some(pos),
+        leaf_pos: Some(pos as u32),
         merkle_path: Some(path.try_into().unwrap()),
         sig_secret: Some(sig_secret),
     };

+ 0 - 1
src/bin/darkfid.rs

@@ -1,6 +1,5 @@
 use async_std::sync::{Arc, Mutex};
 use std::collections::HashMap;
-use std::convert::TryInto;
 use std::path::PathBuf;
 use std::str::FromStr;
 

+ 495 - 69
src/bin/mint.rs

@@ -1,89 +1,515 @@
-use drk::{Decodable, ZkContract};
-use std::fs::File;
 use std::time::Instant;
 
-use bls12_381::Scalar;
-use ff::{Field, PrimeField};
-use group::{Curve, Group};
+use halo2::{
+    circuit::{Layouter, SimpleFloorPlanner},
+    dev::MockProver,
+    plonk::{
+        Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector,
+    },
+    poly::Rotation,
+};
+use halo2_gadgets::{
+    ecc::{
+        chip::{EccChip, EccConfig},
+        FixedPoint,
+    },
+    poseidon::{
+        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
+        StateWord, Word,
+    },
+    primitives,
+    primitives::poseidon::{ConstantLength, P128Pow5T3},
+    sinsemilla::{
+        chip::{SinsemillaChip, SinsemillaConfig},
+        merkle::chip::{MerkleChip, MerkleConfig},
+        merkle::MerklePath,
+    },
+    utilities::{
+        copy, lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
+    },
+};
+use pasta_curves::{
+    arithmetic::{CurveAffine, Field},
+    group::{Curve, Group},
+    pallas,
+};
 use rand::rngs::OsRng;
 
-//type Result<T> = std::result::Result<T, failure::Error>;
-use drk::Result;
-
-// Unpack a value (such as jubjub::Fr) into 256 Scalar binary digits
-fn unpack<F: PrimeField>(value: F) -> Vec<Scalar> {
-    let mut bits = Vec::new();
-    print!("Unpack: ");
-    for (_i, bit) in value.to_le_bits().into_iter().cloned().enumerate() {
-        match bit {
-            true => bits.push(Scalar::one()),
-            false => bits.push(Scalar::zero()),
-        }
-        print!("{}", if bit { 1 } else { 0 });
-    }
-    println!();
-    bits
+use drk::crypto::{
+    constants::{
+        sinsemilla::{OrchardCommitDomains, OrchardHashDomains, MERKLE_CRH_PERSONALIZATION},
+        OrchardFixedBases,
+    },
+    proof::{Proof, ProvingKey, VerifyingKey},
+    util::{pedersen_commitment_scalar, pedersen_commitment_u64},
+};
+
+#[derive(Clone, Debug)]
+struct MintConfig {
+    primary: Column<InstanceColumn>,
+    q_add: Selector,
+    advices: [Column<Advice>; 10],
+    ecc_config: EccConfig,
+    merkle_config_1: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    merkle_config_2: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_1:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_2:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    poseidon_config: PoseidonConfig<pallas::Base>,
 }
 
-// Unpack a u64 value in 64 Scalar binary digits
-fn _unpack_u64(value: u64) -> Vec<Scalar> {
-    let mut result = Vec::with_capacity(64);
+impl MintConfig {
+    fn ecc_chip(&self) -> EccChip<OrchardFixedBases> {
+        EccChip::construct(self.ecc_config.clone())
+    }
 
-    for i in 0..64 {
-        if (value >> i) & 1 == 1 {
-            result.push(Scalar::one());
-        } else {
-            result.push(Scalar::zero());
-        }
+    fn poseidon_chip(&self) -> PoseidonChip<pallas::Base> {
+        PoseidonChip::construct(self.poseidon_config.clone())
     }
+}
+
+// The public input array offsets
+const MINT_COIN_OFFSET: usize = 0;
+const MINT_VALCOMX_OFFSET: usize = 1;
+const MINT_VALCOMY_OFFSET: usize = 2;
+const MINT_ASSCOMX_OFFSET: usize = 3;
+const MINT_ASSCOMY_OFFSET: usize = 4;
 
-    result
+#[derive(Default, Debug)]
+struct MintCircuit {
+    pub_x: Option<pallas::Base>,         // x coordinate for pubkey
+    pub_y: Option<pallas::Base>,         // y coordinate for pubkey
+    value: Option<pallas::Base>,         // The value of this coin
+    asset: Option<pallas::Base>,         // The asset ID
+    serial: Option<pallas::Base>,        // Unique serial number corresponding to this coin
+    coin_blind: Option<pallas::Base>,    // Random blinding factor for coin
+    value_blind: Option<pallas::Scalar>, // Random blinding factor for value commitment
+    asset_blind: Option<pallas::Scalar>, // Random blinding factor for the asset ID
 }
 
-fn main() -> Result<()> {
-    let start = Instant::now();
-    let file = File::open("mint.zcd")?;
-    let mut visor = ZkContract::decode(file)?;
-    println!("{}", visor.name);
-    //ZkContract::load_contract(bytes);
-    println!("Loaded contract: [{:?}]", start.elapsed());
-
-    println!("Stats:");
-    println!("    Constants: {}", visor.vm.constants.len());
-    println!("    Alloc: {}", visor.vm.alloc.len());
-    println!("    Operations: {}", visor.vm.ops.len());
-    println!(
-        "    Constraint Instructions: {}",
-        visor.vm.constraints.len()
-    );
-
-    visor.setup("mint.zts")?;
-
-    // We use the ExtendedPoint in calculations because it's faster
-    let public_point = jubjub::ExtendedPoint::from(jubjub::SubgroupPoint::random(&mut OsRng));
-    // But to serialize we need to convert to affine (which has the (u, v) values)
-    let public_affine = public_point.to_affine();
-
-    let randomness_value: jubjub::Fr = jubjub::Fr::random(&mut OsRng);
-
-    for param in visor.param_names() {
-        println!("Param name: {}", param);
+impl UtilitiesInstructions<pallas::Base> for MintCircuit {
+    type Var = CellValue<pallas::Base>;
+}
+
+impl Circuit<pallas::Base> for MintCircuit {
+    type Config = MintConfig;
+    type FloorPlanner = SimpleFloorPlanner;
+
+    fn without_witnesses(&self) -> Self {
+        Self::default()
     }
 
-    visor.set_param("public_u", public_affine.get_u())?;
-    visor.set_param("public_v", public_affine.get_v())?;
-    for (i, param_bit) in unpack(randomness_value).into_iter().enumerate() {
-        visor.set_param(&format!("vc_randomness_{}", i), param_bit)?;
+    fn configure(meta: &mut ConstraintSystem<pallas::Base>) -> Self::Config {
+        // Advice columns used in the circuit
+        let advices = [
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+        ];
+
+        // Addition of two field elements
+        /*
+        let q_add = meta.selector();
+        meta.create_gate("poseidon_hash(a, b) + c", |meta| {
+            let q_add = meta.query_selector(q_add);
+            let sum = meta.query_advice(advices[6], Rotation::cur());
+            let hash = meta.query_advice(advices[7], Rotation::cur());
+            let c = meta.query_advice(advices[8], Rotation::cur());
+
+            vec![q_add * (hash + c - sum)]
+        });
+        */
+        let q_add = meta.selector();
+        meta.create_gate("a+b+c", |meta| {
+            let q_add = meta.query_selector(q_add);
+            let sum = meta.query_advice(advices[5], Rotation::cur());
+            let a = meta.query_advice(advices[6], Rotation::cur());
+            let b = meta.query_advice(advices[7], Rotation::cur());
+            let c = meta.query_advice(advices[8], Rotation::cur());
+
+            vec![q_add * (a + b + c - sum)]
+        });
+
+        // Fixed columns for the Sinsemilla generator lookup table
+        let table_idx = meta.lookup_table_column();
+        let lookup = (
+            table_idx,
+            meta.lookup_table_column(),
+            meta.lookup_table_column(),
+        );
+
+        // Instance column used for public inputs
+        let primary = meta.instance_column();
+        meta.enable_equality(primary.into());
+
+        // Permutation over all advice columns
+        for advice in advices.iter() {
+            meta.enable_equality((*advice).into());
+        }
+
+        // Poseidon requires four advice columns, while ECC incomplete addition
+        // requires six. We can reduce the proof size by sharing fixed columns
+        // between the ECC and Poseidon chips.
+        // TODO: For multiple invocations they could/should be configured in
+        // parallel rather than sharing perhaps?
+        let lagrange_coeffs = [
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+        ];
+        let rc_a = lagrange_coeffs[2..5].try_into().unwrap();
+        let rc_b = lagrange_coeffs[5..8].try_into().unwrap();
+
+        // Also use the first Lagrange coefficient column for loading global constants.
+        meta.enable_constant(lagrange_coeffs[0]);
+
+        // Use one of the right-most advice columns for all of our range checks.
+        let range_check = LookupRangeCheckConfig::configure(meta, advices[9], table_idx);
+
+        // Configuration for curve point operations.
+        // This uses 10 advice columns and spans the whole circuit.
+        let ecc_config = EccChip::<OrchardFixedBases>::configure(
+            meta,
+            advices,
+            lagrange_coeffs,
+            range_check.clone(),
+        );
+
+        // Configuration for the Poseidon hash
+        let poseidon_config = PoseidonChip::configure(
+            meta,
+            P128Pow5T3,
+            advices[6..9].try_into().unwrap(),
+            advices[5],
+            rc_a,
+            rc_b,
+        );
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_1, merkle_config_1) = {
+            let sinsemilla_config_1 = SinsemillaChip::configure(
+                meta,
+                advices[..5].try_into().unwrap(),
+                advices[6],
+                lagrange_coeffs[0],
+                lookup,
+                range_check.clone(),
+            );
+            let merkle_config_1 = MerkleChip::configure(meta, sinsemilla_config_1.clone());
+            (sinsemilla_config_1, merkle_config_1)
+        };
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_2, merkle_config_2) = {
+            let sinsemilla_config_2 = SinsemillaChip::configure(
+                meta,
+                advices[5..].try_into().unwrap(),
+                advices[7],
+                lagrange_coeffs[1],
+                lookup,
+                range_check,
+            );
+            let merkle_config_2 = MerkleChip::configure(meta, sinsemilla_config_2.clone());
+
+            (sinsemilla_config_2, merkle_config_2)
+        };
+
+        MintConfig {
+            primary,
+            q_add,
+            advices,
+            ecc_config,
+            merkle_config_1,
+            merkle_config_2,
+            sinsemilla_config_1,
+            sinsemilla_config_2,
+            poseidon_config,
+        }
+    }
+
+    fn synthesize(
+        &self,
+        config: Self::Config,
+        mut layouter: impl Layouter<pallas::Base>,
+    ) -> Result<(), Error> {
+        // Load the Sinsemilla generator lookup table used by the whole circuit.
+        SinsemillaChip::load(config.sinsemilla_config_1.clone(), &mut layouter)?;
+
+        let ecc_chip = config.ecc_chip();
+
+        let pub_x = self.load_private(
+            layouter.namespace(|| "load pubkey x"),
+            config.advices[0],
+            self.pub_x,
+        )?;
+
+        let pub_y = self.load_private(
+            layouter.namespace(|| "load pubkey y"),
+            config.advices[0],
+            self.pub_y,
+        )?;
+
+        let value = self.load_private(
+            layouter.namespace(|| "load value"),
+            config.advices[0],
+            self.value,
+        )?;
+
+        let asset = self.load_private(
+            layouter.namespace(|| "load asset"),
+            config.advices[0],
+            self.asset,
+        )?;
+
+        let serial = self.load_private(
+            layouter.namespace(|| "load serial"),
+            config.advices[0],
+            self.serial,
+        )?;
+
+        let coin_blind = self.load_private(
+            layouter.namespace(|| "load coin_blind"),
+            config.advices[0],
+            self.coin_blind,
+        )?;
+
+        // =========
+        // Coin hash
+        // =========
+        let messages = [[pub_x, pub_y], [value, asset], [serial, coin_blind]];
+        let mut hashes = vec![];
+
+        for message in messages.iter() {
+            let hash = {
+                let poseidon_message = layouter.assign_region(
+                    || "load message",
+                    |mut region| {
+                        let mut message_word = |i: usize| {
+                            let value = message[i].value();
+                            let var = region.assign_advice(
+                                || format!("load message_{}", i),
+                                config.poseidon_config.state()[i],
+                                0,
+                                || value.ok_or(Error::SynthesisError),
+                            )?;
+                            region.constrain_equal(var, message[i].cell())?;
+                            Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
+                                var, value,
+                            )))
+                        };
+                        Ok([message_word(0)?, message_word(1)?])
+                    },
+                )?;
+
+                let poseidon_hasher = PoseidonHash::init(
+                    config.poseidon_chip(),
+                    layouter.namespace(|| "Poseidon init"),
+                    ConstantLength::<2>,
+                )?;
+
+                let poseidon_output = poseidon_hasher.hash(
+                    layouter.namespace(|| "Poseidon hash (a, b)"),
+                    poseidon_message,
+                )?;
+
+                let poseidon_output: CellValue<pallas::Base> = poseidon_output.inner().into();
+                poseidon_output
+            };
+
+            hashes.push(hash);
+        }
+
+        let coin = layouter.assign_region(
+            || " `coin` = hash(a,b) + hash(c, d) + hash(e, f)",
+            |mut region| {
+                config.q_add.enable(&mut region, 0)?;
+
+                copy(&mut region, || "copy ab", config.advices[6], 0, &hashes[0])?;
+                copy(&mut region, || "copy cd", config.advices[7], 0, &hashes[1])?;
+                copy(&mut region, || "copy ef", config.advices[8], 0, &hashes[2])?;
+
+                let scalar_val = hashes[0]
+                    .value()
+                    .zip(hashes[1].value())
+                    .zip(hashes[2].value())
+                    .map(|(abcd, ef)| abcd.0 + abcd.1 + ef);
+
+                let cell = region.assign_advice(
+                    || "hash(a,b)+hash(c,d)+hash(e,f)",
+                    config.advices[5],
+                    0,
+                    || scalar_val.ok_or(Error::SynthesisError),
+                )?;
+                Ok(CellValue::new(cell, scalar_val))
+            },
+        )?;
+
+        // Constrain the coin C
+        layouter.constrain_instance(coin.cell(), config.primary, MINT_COIN_OFFSET)?;
+
+        // ================
+        // Value commitment
+        // ================
+
+        // This constant one is used for short multiplication
+        let one = self.load_private(
+            layouter.namespace(|| "load constant one"),
+            config.advices[0],
+            Some(pallas::Base::one()),
+        )?;
+
+        // v * G_1
+        let (commitment, _) = {
+            let value_commit_v = OrchardFixedBases::ValueCommitV;
+            let value_commit_v = FixedPoint::from_inner(ecc_chip.clone(), value_commit_v);
+            value_commit_v.mul_short(layouter.namespace(|| "[value] ValueCommitV"), (value, one))?
+        };
+
+        // r_V * G_2
+        let (blind, _rcv) = {
+            let rcv = self.value_blind;
+            let value_commit_r = OrchardFixedBases::ValueCommitR;
+            let value_commit_r = FixedPoint::from_inner(ecc_chip.clone(), value_commit_r);
+            value_commit_r.mul(layouter.namespace(|| "[value_blind] ValueCommitR"), rcv)?
+        };
+
+        // Constrain the value commitment coordinates
+        let value_commit = commitment.add(layouter.namespace(|| "valuecommit"), &blind)?;
+        layouter.constrain_instance(
+            value_commit.inner().x().cell(),
+            config.primary,
+            MINT_VALCOMX_OFFSET,
+        )?;
+        layouter.constrain_instance(
+            value_commit.inner().y().cell(),
+            config.primary,
+            MINT_VALCOMY_OFFSET,
+        )?;
+
+        // ================
+        // Asset commitment
+        // ================
+        // a * G_1
+        let (commitment, _) = {
+            let asset_commit_v = OrchardFixedBases::ValueCommitV;
+            let asset_commit_v = FixedPoint::from_inner(ecc_chip.clone(), asset_commit_v);
+            asset_commit_v.mul_short(layouter.namespace(|| "[asset] ValueCommitV"), (asset, one))?
+        };
+
+        // r_A * G_2
+        let (blind, _rca) = {
+            let rca = self.asset_blind;
+            let asset_commit_r = OrchardFixedBases::ValueCommitR;
+            let asset_commit_r = FixedPoint::from_inner(ecc_chip, asset_commit_r);
+            asset_commit_r.mul(layouter.namespace(|| "[asset_blind] ValueCommitR"), rca)?
+        };
+
+        // Constrain the asset commitment coordinates
+        let asset_commit = commitment.add(layouter.namespace(|| "assetcommit"), &blind)?;
+        layouter.constrain_instance(
+            asset_commit.inner().x().cell(),
+            config.primary,
+            MINT_ASSCOMX_OFFSET,
+        )?;
+        layouter.constrain_instance(
+            asset_commit.inner().y().cell(),
+            config.primary,
+            MINT_ASSCOMY_OFFSET,
+        )?;
+
+        // At this point we've enforced all of our public inputs.
+        Ok(())
     }
+}
+
+fn main() {
+    // The number of rows in our circuit cannot exceed 2^k
+    let k: u32 = 11;
+
+    let pubkey = pallas::Point::random(&mut OsRng);
+    let coords = pubkey.to_affine().coordinates().unwrap();
+
+    let value = 42;
+    let asset = 1;
+
+    let value_blind = pallas::Scalar::random(&mut OsRng);
+    let asset_blind = pallas::Scalar::random(&mut OsRng);
+
+    let serial = pallas::Base::random(&mut OsRng);
+    let coin_blind = pallas::Base::random(&mut OsRng);
+
+    // poseidon_hash(x, y) + poseidon_hash(value, asset) + poseidon_hash(serial, coin_blind)
+    let mut coin = pallas::Base::zero();
 
-    let proof = visor.prove()?;
+    let messages = [
+        [*coords.x(), *coords.y()],
+        [pallas::Base::from(value), pallas::Base::from(asset)],
+        [serial, coin_blind],
+    ];
 
-    assert_eq!(proof.public.len(), 2);
-    for (name, value) in &proof.public {
-        println!("Public {} = {:?}", name, value);
+    for msg in messages.iter() {
+        let hash = primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(*msg);
+        coin += hash;
     }
 
-    assert!(visor.verify(&proof));
+    let value_commit = pedersen_commitment_u64(value, value_blind);
+    let value_coords = value_commit.to_affine().coordinates().unwrap();
 
-    Ok(())
+    let asset_commit = pedersen_commitment_u64(asset, asset_blind);
+    let asset_coords = asset_commit.to_affine().coordinates().unwrap();
+
+    let public_inputs = vec![
+        coin,
+        *value_coords.x(),
+        *value_coords.y(),
+        *asset_coords.x(),
+        *asset_coords.y(),
+    ];
+
+    let circuit = MintCircuit {
+        pub_x: Some(*coords.x()),
+        pub_y: Some(*coords.y()),
+        value: Some(pallas::Base::from(value)),
+        asset: Some(pallas::Base::from(asset)),
+        serial: Some(serial),
+        coin_blind: Some(coin_blind),
+        value_blind: Some(value_blind),
+        asset_blind: Some(asset_blind),
+    };
+
+    let prover = MockProver::run(k, &circuit, vec![public_inputs.clone()]).unwrap();
+    assert_eq!(prover.verify(), Ok(()));
+
+    // Actual ZK proof
+    let start = Instant::now();
+    let vk = VerifyingKey::build(k, MintCircuit::default());
+    let pk = ProvingKey::build(k, MintCircuit::default());
+    println!("Setup: [{:?}]", start.elapsed());
+
+    let start = Instant::now();
+    let proof = Proof::create(&pk, &[circuit], &public_inputs).unwrap();
+    println!("Prove: [{:?}]", start.elapsed());
+
+    let start = Instant::now();
+    assert!(proof.verify(&vk, &public_inputs).is_ok());
+    println!("Verify: [{:?}]", start.elapsed());
 }

+ 180 - 0
src/bin/tx2.rs

@@ -0,0 +1,180 @@
+use rand::rngs::OsRng;
+use std::{fmt, time::Instant};
+
+use halo2_gadgets::ecc::FixedPoints;
+use incrementalmerkletree::Hashable;
+use incrementalmerkletree::{bridgetree::BridgeTree, Frontier, Tree};
+use pasta_curves::{
+    arithmetic::{CurveAffine, Field, FieldExt},
+    pallas,
+};
+
+use drk::{
+    circuit::{mint_contract::MintContract, spend_contract::SpendContract},
+    crypto::{
+        coin::Coin,
+        constants::OrchardFixedBases,
+        merkle_node2::MerkleNode,
+        note::{EncryptedNote, Note},
+        nullifier::Nullifier,
+        proof::{Proof, ProvingKey, VerifyingKey},
+        schnorr,
+        util::mod_r_p,
+        util::{pedersen_commitment_scalar, pedersen_commitment_u64},
+    },
+    state::{state_transition, ProgramState, StateUpdate},
+    tx,
+};
+
+struct MemoryState {
+    // The entire merkle tree state
+    tree: BridgeTree<MerkleNode, 32>,
+    // List of all previous and the current merkle roots
+    // This is the hashed value of all the children.
+    merkle_roots: Vec<MerkleNode>,
+    // Nullifiers prevent double spending
+    nullifiers: Vec<Nullifier>,
+    // All received coins
+    // NOTE: we need maybe a flag to keep track of which ones are spent
+    // Maybe the spend field links to a tx hash:input index
+    // We should also keep track of the tx hash:output index where this
+    // coin was received
+    own_coins: Vec<(Coin, Note)>,
+    mint_vk: VerifyingKey,
+    spend_vk: VerifyingKey,
+
+    // Public key of the cashier
+    cashier_public: schnorr::PublicKey,
+    // List of all our secret keys
+    secrets: Vec<pallas::Base>,
+}
+
+impl ProgramState for MemoryState {
+    fn is_valid_cashier_public_key(&self, public: &schnorr::PublicKey) -> bool {
+        public == &self.cashier_public
+    }
+    fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
+        self.merkle_roots.iter().any(|m| m == merkle_root)
+    }
+    fn nullifier_exists(&self, nullifier: &Nullifier) -> bool {
+        self.nullifiers.iter().any(|n| n == nullifier)
+    }
+
+    fn mint_vk(&self) -> &VerifyingKey {
+        &self.mint_vk
+    }
+    fn spend_vk(&self) -> &VerifyingKey {
+        &self.spend_vk
+    }
+}
+
+impl MemoryState {
+    fn apply(&mut self, mut update: StateUpdate) {
+        // Extend our list of nullifiers with the ones from the update
+        self.nullifiers.append(&mut update.nullifiers);
+
+        // Update merkle tree and witnesses
+        for (coin, enc_note) in update.coins.into_iter().zip(update.enc_notes.into_iter()) {
+            // Add the new coins to the merkle tree
+            let node = MerkleNode(coin.0);
+            self.tree.append(&node);
+
+            //// Keep track of all merkle roots that have existed
+            self.merkle_roots.push(self.tree.root());
+
+            if let Some((note, secret)) = self.try_decrypt_note(enc_note) {
+                self.own_coins.push((coin, note));
+                self.tree.witness();
+            }
+        }
+    }
+
+    fn try_decrypt_note(&self, ciphertext: EncryptedNote) -> Option<(Note, pallas::Base)> {
+        // Loop through all our secret keys...
+        for secret in &self.secrets {
+            // ... attempt to decrypt the note ...
+            if let Ok(note) = ciphertext.decrypt(secret) {
+                // ... and return the decrypted note for this coin.
+                return Some((note, *secret));
+            }
+        }
+        // We weren't able to decrypt the note with any of our keys.
+        None
+    }
+}
+
+fn main() -> std::result::Result<(), failure::Error> {
+    let cashier_secret = schnorr::SecretKey::random();
+    let cashier_public = cashier_secret.public_key();
+
+    let secret = pallas::Base::random(&mut OsRng);
+    let public = OrchardFixedBases::NullifierK.generator() * mod_r_p(secret);
+
+    const K: u32 = 11;
+    let mint_vk = VerifyingKey::build(K, MintContract::default());
+    let spend_vk = VerifyingKey::build(K, SpendContract::default());
+
+    let mut state = MemoryState {
+        tree: BridgeTree::<MerkleNode, 32>::new(100),
+        merkle_roots: vec![],
+        nullifiers: vec![],
+        own_coins: vec![],
+        mint_vk,
+        spend_vk,
+        cashier_public,
+        secrets: vec![secret],
+    };
+
+    let token_id = pallas::Base::from(110);
+
+    let builder = tx::TransactionBuilder {
+        clear_inputs: vec![tx::TransactionBuilderClearInputInfo {
+            value: 110,
+            token_id,
+            signature_secret: cashier_secret,
+        }],
+        inputs: vec![],
+        outputs: vec![tx::TransactionBuilderOutputInfo {
+            value: 110,
+            token_id,
+            public,
+        }],
+    };
+
+    let tx = builder.build()?;
+
+    tx.verify(&state.mint_vk, &state.spend_vk)
+        .expect("tx verify");
+
+    let note = tx.outputs[0].enc_note.decrypt(&secret)?;
+
+    let update = state_transition(&state, tx)?;
+    state.apply(update);
+
+    // Now spend
+    let (coin, note) = &state.own_coins[0];
+    let node = MerkleNode(coin.0.clone());
+    let (leaf_position, merkle_path) = state.tree.authentication_path(&node).unwrap();
+
+    let builder = tx::TransactionBuilder {
+        clear_inputs: vec![],
+        inputs: vec![tx::TransactionBuilderInputInfo {
+            leaf_position,
+            merkle_path,
+            secret,
+            note: note.clone(),
+        }],
+        outputs: vec![tx::TransactionBuilderOutputInfo {
+            value: 110,
+            token_id,
+            public,
+        }],
+    };
+
+    let tx = builder.build()?;
+
+    let update = state_transition(&state, tx)?;
+    state.apply(update);
+
+    Ok(())
+}

+ 153 - 0
src/bin/vm2.rs

@@ -0,0 +1,153 @@
+use halo2::{
+    circuit::{Layouter, SimpleFloorPlanner},
+    dev::MockProver,
+    plonk::{
+        Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector,
+    },
+    poly::Rotation,
+};
+use halo2_gadgets::{
+    ecc::{
+        chip::{EccChip, EccConfig},
+        FixedPoint, FixedPoints,
+    },
+    poseidon::{
+        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
+        StateWord, Word,
+    },
+    primitives,
+    primitives::{
+        poseidon::{ConstantLength, P128Pow5T3},
+        sinsemilla::S_PERSONALIZATION,
+    },
+    sinsemilla::{
+        chip::{SinsemillaChip, SinsemillaConfig},
+        merkle::chip::{MerkleChip, MerkleConfig},
+        merkle::MerklePath,
+    },
+    utilities::{
+        lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
+    },
+};
+use pasta_curves::{
+    arithmetic::{CurveAffine, Field},
+    group::{ff::PrimeFieldBits, Curve, Group},
+    pallas,
+};
+use rand::rngs::OsRng;
+use std::{collections::HashMap, fs::File, time::Instant};
+
+use drk::{
+    crypto::{
+        constants::{
+            sinsemilla::{OrchardCommitDomains, OrchardHashDomains, MERKLE_CRH_PERSONALIZATION},
+            OrchardFixedBases,
+        },
+        proof::{Proof, ProvingKey, VerifyingKey},
+        util::{pedersen_commitment_scalar, pedersen_commitment_u64},
+    },
+    serial::Decodable,
+    vm2,
+};
+
+fn main() -> std::result::Result<(), failure::Error> {
+    // The number of rows in our circuit cannot exceed 2^k
+    let k: u32 = 11;
+
+    let start = Instant::now();
+    let file = File::open("proof/mint.zk.bin")?;
+    let zkbin = vm2::ZkBinary::decode(file)?;
+    for contract_name in zkbin.contracts.keys() {
+        println!("Loaded '{}' contract.", contract_name);
+    }
+    println!("Load time: [{:?}]", start.elapsed());
+
+    let contract = &zkbin.contracts["Mint"];
+
+    //contract.witness_base(...);
+    //contract.witness_base(...);
+    //contract.witness_base(...);
+
+    let pubkey = pallas::Point::random(&mut OsRng);
+    let coords = pubkey.to_affine().coordinates().unwrap();
+
+    let value = 110;
+    let asset = 1;
+
+    let value_blind = pallas::Scalar::random(&mut OsRng);
+    let asset_blind = pallas::Scalar::random(&mut OsRng);
+
+    let serial = pallas::Base::random(&mut OsRng);
+    let coin_blind = pallas::Base::random(&mut OsRng);
+
+    let mut coin = pallas::Base::zero();
+
+    let messages = [
+        [*coords.x(), *coords.y()],
+        [pallas::Base::from(value), pallas::Base::from(asset)],
+        [serial, coin_blind],
+    ];
+
+    for msg in messages.iter() {
+        coin += primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(*msg);
+    }
+
+    let coin2 = primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>)
+        .hash([*coords.x(), *coords.y()]);
+
+    let value_commit = pedersen_commitment_u64(value, value_blind);
+    let value_coords = value_commit.to_affine().coordinates().unwrap();
+
+    let asset_commit = pedersen_commitment_u64(asset, asset_blind);
+    let asset_coords = asset_commit.to_affine().coordinates().unwrap();
+
+    let mut public_inputs = vec![
+        coin,
+        *value_coords.x(),
+        *value_coords.y(),
+        *asset_coords.x(),
+        *asset_coords.y(),
+    ];
+
+    let mut const_fixed_points = HashMap::new();
+    const_fixed_points.insert(
+        "VALUE_COMMIT_VALUE".to_string(),
+        OrchardFixedBases::ValueCommitV,
+    );
+    const_fixed_points.insert(
+        "VALUE_COMMIT_RANDOM".to_string(),
+        OrchardFixedBases::ValueCommitR,
+    );
+
+    let mut circuit = vm2::ZkCircuit::new(const_fixed_points, &zkbin.constants, contract);
+    let empty_circuit = circuit.clone();
+
+    circuit.witness_base("pub_x", *coords.x())?;
+    circuit.witness_base("pub_y", *coords.y())?;
+    circuit.witness_base("value", pallas::Base::from(value))?;
+    circuit.witness_base("asset", pallas::Base::from(asset))?;
+    circuit.witness_base("serial", serial)?;
+    circuit.witness_base("coin_blind", coin_blind)?;
+    circuit.witness_scalar("value_blind", value_blind)?;
+    circuit.witness_scalar("asset_blind", asset_blind)?;
+
+    // Valid MockProver
+    let prover = MockProver::run(k, &circuit, vec![public_inputs.clone()]).unwrap();
+    assert_eq!(prover.verify(), Ok(()));
+
+    // Actual ZK proof
+    let start = Instant::now();
+    let vk = VerifyingKey::build(k, empty_circuit.clone());
+    let pk = ProvingKey::build(k, empty_circuit.clone());
+    println!("\nSetup: [{:?}]", start.elapsed());
+
+    let start = Instant::now();
+    let proof = Proof::create(&pk, &[circuit], &public_inputs).unwrap();
+    println!("Prove: [{:?}]", start.elapsed());
+
+    let start = Instant::now();
+    assert!(proof.verify(&vk, &public_inputs).is_ok());
+    println!("Verify: [{:?}]", start.elapsed());
+
+    Ok(())
+}

+ 210 - 0
src/bin/vm2_burn.rs

@@ -0,0 +1,210 @@
+use std::iter;
+
+use halo2::{
+    circuit::{Layouter, SimpleFloorPlanner},
+    dev::MockProver,
+    plonk::{
+        Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector,
+    },
+    poly::Rotation,
+};
+use halo2_gadgets::{
+    ecc::{
+        chip::{EccChip, EccConfig},
+        FixedPoint, FixedPoints,
+    },
+    poseidon::{
+        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
+        StateWord, Word,
+    },
+    primitives,
+    primitives::{
+        poseidon::{ConstantLength, P128Pow5T3},
+        sinsemilla::S_PERSONALIZATION,
+    },
+    sinsemilla::{
+        chip::{SinsemillaChip, SinsemillaConfig},
+        merkle::chip::{MerkleChip, MerkleConfig},
+        merkle::MerklePath,
+    },
+    utilities::{
+        lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
+    },
+};
+use pasta_curves::{
+    arithmetic::{CurveAffine, Field},
+    group::{ff::PrimeFieldBits, Curve, Group},
+    pallas,
+};
+use rand::rngs::OsRng;
+use std::{collections::HashMap, fs::File, time::Instant};
+
+use drk::{
+    crypto::{
+        constants::{
+            sinsemilla::{
+                i2lebsp, OrchardCommitDomains, OrchardHashDomains, MERKLE_CRH_PERSONALIZATION,
+            },
+            OrchardFixedBases,
+        },
+        proof::{Proof, ProvingKey, VerifyingKey},
+        util::{pedersen_commitment_scalar, pedersen_commitment_u64},
+    },
+    serial::Decodable,
+    vm2,
+};
+
+fn root(path: [pallas::Base; 32], leaf_pos: u32, leaf: pallas::Base) -> pallas::Base {
+    let domain = primitives::sinsemilla::HashDomain::new(MERKLE_CRH_PERSONALIZATION);
+
+    let pos_bool = i2lebsp::<32>(leaf_pos as u64);
+
+    let mut node = leaf;
+    for (l, (sibling, pos)) in path.iter().zip(pos_bool.iter()).enumerate() {
+        let (left, right) = if *pos {
+            (*sibling, node)
+        } else {
+            (node, *sibling)
+        };
+
+        let l_star = i2lebsp::<10>(l as u64);
+        let left: Vec<_> = left.to_le_bits().iter().by_val().take(255).collect();
+        let right: Vec<_> = right.to_le_bits().iter().by_val().take(255).collect();
+
+        let mut message = l_star.to_vec();
+        message.extend_from_slice(&left);
+        message.extend_from_slice(&right);
+
+        node = domain.hash(message.into_iter()).unwrap();
+    }
+    node
+}
+
+fn main() -> std::result::Result<(), failure::Error> {
+    // The number of rows in our circuit cannot exceed 2^k
+    let k: u32 = 11;
+
+    let start = Instant::now();
+    let file = File::open("proof/burn.zk.bin")?;
+    let zkbin = vm2::ZkBinary::decode(file)?;
+    for contract_name in zkbin.contracts.keys() {
+        println!("Loaded '{}' contract.", contract_name);
+    }
+    println!("Load time: [{:?}]", start.elapsed());
+
+    let contract = &zkbin.contracts["Burn"];
+
+    //contract.witness_base(...);
+    //contract.witness_base(...);
+    //contract.witness_base(...);
+
+    let secret = pallas::Scalar::random(&mut OsRng);
+    let serial = pallas::Base::random(&mut OsRng);
+
+    let value = 110;
+    let asset = 1;
+
+    // Nullifier = poseidon(sinsemilla(secret_key), serial)
+    let domain = primitives::sinsemilla::HashDomain::new(S_PERSONALIZATION);
+    let bits_secretkey: Vec<bool> = secret.to_le_bits().iter().by_val().collect();
+    let hashed_secret_key = domain.hash(iter::empty().chain(bits_secretkey)).unwrap();
+
+    let nullifier = [hashed_secret_key, serial];
+    let nullifier =
+        primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(nullifier);
+
+    // Public key derivation
+    let public_key = OrchardFixedBases::SpendAuthG.generator() * secret;
+    let coords = public_key.to_affine().coordinates().unwrap();
+
+    // Construct Coin
+    let mut coin = pallas::Base::zero();
+    let coin_blind = pallas::Base::random(&mut OsRng);
+    let messages = [
+        [*coords.x(), *coords.y()],
+        [pallas::Base::from(value), pallas::Base::from(asset)],
+        [serial, coin_blind],
+    ];
+
+    for msg in messages.iter() {
+        let hash = primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(*msg);
+        coin += hash;
+    }
+
+    // Merkle root
+    let leaf = pallas::Base::random(&mut OsRng);
+    let leaf_pos = rand::random::<u32>();
+    let path: Vec<_> = (0..32).map(|_| pallas::Base::random(&mut OsRng)).collect();
+    let merkle_root = root(path.clone().try_into().unwrap(), leaf_pos, leaf);
+
+    // Value and asset commitments
+    let value_blind = pallas::Scalar::random(&mut OsRng);
+    let asset_blind = pallas::Scalar::random(&mut OsRng);
+    let value_commit = pedersen_commitment_u64(value, value_blind);
+    let asset_commit = pedersen_commitment_u64(asset, asset_blind);
+
+    let value_coords = value_commit.to_affine().coordinates().unwrap();
+    let asset_coords = asset_commit.to_affine().coordinates().unwrap();
+
+    // Derive signature public key from signature secret key
+    let sig_secret = pallas::Scalar::random(&mut OsRng);
+    let sig_pubkey = OrchardFixedBases::SpendAuthG.generator() * sig_secret;
+    let sig_coords = sig_pubkey.to_affine().coordinates().unwrap();
+
+    let public_inputs = vec![
+        nullifier,
+        merkle_root,
+        *value_coords.x(),
+        *value_coords.y(),
+        *asset_coords.x(),
+        *asset_coords.y(),
+        *sig_coords.x(),
+        *sig_coords.y(),
+    ];
+
+    //
+
+    let mut const_fixed_points = HashMap::new();
+    const_fixed_points.insert(
+        "VALUE_COMMIT_VALUE".to_string(),
+        OrchardFixedBases::ValueCommitV,
+    );
+    const_fixed_points.insert(
+        "VALUE_COMMIT_RANDOM".to_string(),
+        OrchardFixedBases::ValueCommitR,
+    );
+    const_fixed_points.insert("SPEND_AUTH_G".to_string(), OrchardFixedBases::SpendAuthG);
+
+    let mut circuit = vm2::ZkCircuit::new(const_fixed_points, &zkbin.constants, contract);
+    let empty_circuit = circuit.clone();
+
+    circuit.witness_base("secret", hashed_secret_key)?;
+    circuit.witness_base("serial", serial)?;
+    circuit.witness_merkle_path("path", leaf_pos, path.try_into().unwrap())?;
+    circuit.witness_base("leaf", leaf)?;
+    circuit.witness_base("value", pallas::Base::from(value))?;
+    circuit.witness_base("asset", pallas::Base::from(asset))?;
+    circuit.witness_scalar("value_blind", value_blind)?;
+    circuit.witness_scalar("asset_blind", asset_blind)?;
+    circuit.witness_scalar("sig_secret", sig_secret)?;
+
+    // Valid MockProver
+    let prover = MockProver::run(k, &circuit, vec![public_inputs.clone()]).unwrap();
+    assert_eq!(prover.verify(), Ok(()));
+
+    // Actual ZK proof
+    let start = Instant::now();
+    let vk = VerifyingKey::build(k, empty_circuit.clone());
+    let pk = ProvingKey::build(k, empty_circuit.clone());
+    println!("\nSetup: [{:?}]", start.elapsed());
+
+    let start = Instant::now();
+    let proof = Proof::create(&pk, &[circuit], &public_inputs).unwrap();
+    println!("Prove: [{:?}]", start.elapsed());
+
+    let start = Instant::now();
+    assert!(proof.verify(&vk, &public_inputs).is_ok());
+    println!("Verify: [{:?}]", start.elapsed());
+
+    Ok(())
+}

+ 1 - 1
src/blockchain/rocks.rs

@@ -1,7 +1,7 @@
-use async_std::sync::Arc;
 use std::marker::PhantomData;
 use std::path::Path;
 
+use async_std::sync::Arc;
 use rocksdb::{ColumnFamily, ColumnFamilyDescriptor, Options, DB};
 
 use crate::serial::{deserialize, serialize, Decodable, Encodable};

+ 392 - 143
src/circuit/mint_contract.rs

@@ -1,179 +1,428 @@
-#![allow(unused_imports)]
-#![allow(unused_mut)]
-use crate::crypto::merkle_node::SAPLING_COMMITMENT_TREE_DEPTH;
-use bellman::{
-    gadgets::{
-        blake2s, boolean,
-        boolean::{AllocatedBit, Boolean},
-        multipack, num, Assignment,
+use pasta_curves::pallas;
+
+use halo2::{
+    circuit::{Layouter, SimpleFloorPlanner},
+    plonk,
+    plonk::{Advice, Circuit, Column, ConstraintSystem, Instance as InstanceColumn, Selector},
+    poly::Rotation,
+};
+use halo2_gadgets::{
+    ecc::{
+        chip::{EccChip, EccConfig},
+        FixedPoint,
+    },
+    poseidon::{
+        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
+        StateWord, Word,
+    },
+    primitives::poseidon::{ConstantLength, P128Pow5T3},
+    sinsemilla::{
+        chip::{SinsemillaChip, SinsemillaConfig},
+        merkle::chip::{MerkleChip, MerkleConfig},
+    },
+    utilities::{
+        copy, lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
     },
-    groth16, Circuit, ConstraintSystem, SynthesisError,
 };
-use bls12_381::Bls12;
-use ff::{Field, PrimeField};
-use group::Curve;
-use zcash_proofs::circuit::{ecc, pedersen_hash};
 
-pub struct MintContract {
-    pub value: Option<u64>,
-    pub token_id: Option<jubjub::Fr>,
-    pub randomness_value: Option<jubjub::Fr>,
-    pub randomness_token: Option<jubjub::Fr>,
-    pub serial: Option<jubjub::Fr>,
-    pub randomness_coin: Option<jubjub::Fr>,
-    pub public: Option<jubjub::SubgroupPoint>,
+use crate::crypto::constants::{
+    sinsemilla::{OrchardCommitDomains, OrchardHashDomains},
+    OrchardFixedBases,
+};
+
+#[derive(Clone, Debug)]
+pub struct MintConfig {
+    primary: Column<InstanceColumn>,
+    q_add: Selector,
+    advices: [Column<Advice>; 10],
+    ecc_config: EccConfig,
+    merkle_config_1: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    merkle_config_2: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_1:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_2:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    poseidon_config: PoseidonConfig<pallas::Base>,
 }
-impl Circuit<bls12_381::Scalar> for MintContract {
-    fn synthesize<CS: ConstraintSystem<bls12_381::Scalar>>(
-        self,
-        cs: &mut CS,
-    ) -> Result<(), SynthesisError> {
-        // Line 20: u64_as_binary_le value param:value
-        let value = boolean::u64_into_boolean_vec_le(
-            cs.namespace(|| "Line 20: u64_as_binary_le value param:value"),
-            self.value,
-        )?;
 
-        // Line 21: fr_as_binary_le token_id param:token_id
-        let token_id = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 21: fr_as_binary_le token_id param:token_id"),
-            self.token_id,
-        )?;
+impl MintConfig {
+    fn ecc_chip(&self) -> EccChip<OrchardFixedBases> {
+        EccChip::construct(self.ecc_config.clone())
+    }
 
-        // Line 22: fr_as_binary_le randomness_value param:randomness_value
-        let randomness_value = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 22: fr_as_binary_le randomness_value param:randomness_value"),
-            self.randomness_value,
-        )?;
+    fn poseidon_chip(&self) -> PoseidonChip<pallas::Base> {
+        PoseidonChip::construct(self.poseidon_config.clone())
+    }
+}
 
-        // Line 23: fr_as_binary_le randomness_token param:randomness_token
-        let randomness_token = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 23: fr_as_binary_le randomness_token param:randomness_token"),
-            self.randomness_token,
-        )?;
+// The public input array offsets
+const MINT_COIN_OFFSET: usize = 0;
+const MINT_VALCOMX_OFFSET: usize = 1;
+const MINT_VALCOMY_OFFSET: usize = 2;
+const MINT_ASSCOMX_OFFSET: usize = 3;
+const MINT_ASSCOMY_OFFSET: usize = 4;
 
-        // Line 24: fr_as_binary_le serial param:serial
-        let serial = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 24: fr_as_binary_le serial param:serial"),
-            self.serial,
-        )?;
+#[derive(Default, Debug)]
+pub struct MintContract {
+    pub pub_x: Option<pallas::Base>,         // x coordinate for pubkey
+    pub pub_y: Option<pallas::Base>,         // y coordinate for pubkey
+    pub value: Option<pallas::Base>,         // The value of this coin
+    pub asset: Option<pallas::Base>,         // The asset ID
+    pub serial: Option<pallas::Base>,        // Unique serial number corresponding to this coin
+    pub coin_blind: Option<pallas::Base>,    // Random blinding factor for coin
+    pub value_blind: Option<pallas::Scalar>, // Random blinding factor for value commitment
+    pub asset_blind: Option<pallas::Scalar>, // Random blinding factor for the asset ID
+}
 
-        // Line 25: fr_as_binary_le randomness_coin param:randomness_coin
-        let randomness_coin = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 25: fr_as_binary_le randomness_coin param:randomness_coin"),
-            self.randomness_coin,
-        )?;
+impl UtilitiesInstructions<pallas::Base> for MintContract {
+    type Var = CellValue<pallas::Base>;
+}
 
-        // Line 27: witness public param:public
-        let public = ecc::EdwardsPoint::witness(
-            cs.namespace(|| "Line 27: witness public param:public"),
-            self.public.map(jubjub::ExtendedPoint::from),
-        )?;
+impl Circuit<pallas::Base> for MintContract {
+    type Config = MintConfig;
+    type FloorPlanner = SimpleFloorPlanner;
 
-        // Line 28: assert_not_small_order public
-        public.assert_not_small_order(cs.namespace(|| "Line 28: assert_not_small_order public"))?;
+    fn without_witnesses(&self) -> Self {
+        Self::default()
+    }
 
-        // Line 33: ec_mul_const vcv value G_VCV
-        let vcv = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 33: ec_mul_const vcv value G_VCV"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_VALUE_GENERATOR,
-            &value,
-        )?;
+    fn configure(meta: &mut ConstraintSystem<pallas::Base>) -> Self::Config {
+        // Advice columns used in the circuit
+        let advices = [
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+        ];
+
+        // Addition of two field elements
+        /*
+        let q_add = meta.selector();
+        meta.create_gate("poseidon_hash(a, b) + c", |meta| {
+            let q_add = meta.query_selector(q_add);
+            let sum = meta.query_advice(advices[6], Rotation::cur());
+            let hash = meta.query_advice(advices[7], Rotation::cur());
+            let c = meta.query_advice(advices[8], Rotation::cur());
+
+            vec![q_add * (hash + c - sum)]
+        });
+        */
+        let q_add = meta.selector();
+        meta.create_gate("a+b+c", |meta| {
+            let q_add = meta.query_selector(q_add);
+            let sum = meta.query_advice(advices[5], Rotation::cur());
+            let a = meta.query_advice(advices[6], Rotation::cur());
+            let b = meta.query_advice(advices[7], Rotation::cur());
+            let c = meta.query_advice(advices[8], Rotation::cur());
+
+            vec![q_add * (a + b + c - sum)]
+        });
+
+        // Fixed columns for the Sinsemilla generator lookup table
+        let table_idx = meta.lookup_table_column();
+        let lookup = (
+            table_idx,
+            meta.lookup_table_column(),
+            meta.lookup_table_column(),
+        );
+
+        // Instance column used for public inputs
+        let primary = meta.instance_column();
+        meta.enable_equality(primary.into());
+
+        // Permutation over all advice columns
+        for advice in advices.iter() {
+            meta.enable_equality((*advice).into());
+        }
 
-        // Line 34: ec_mul_const rcv randomness_value G_VCR
-        let rcv = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 34: ec_mul_const rcv randomness_value G_VCR"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR,
-            &randomness_value,
-        )?;
+        // Poseidon requires four advice columns, while ECC incomplete addition
+        // requires six. We can reduce the proof size by sharing fixed columns
+        // between the ECC and Poseidon chips.
+        // TODO: For multiple invocations they could/should be configured in
+        // parallel rather than sharing perhaps?
+        let lagrange_coeffs = [
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+        ];
+        let rc_a = lagrange_coeffs[2..5].try_into().unwrap();
+        let rc_b = lagrange_coeffs[5..8].try_into().unwrap();
+
+        // Also use the first Lagrange coefficient column for loading global constants.
+        meta.enable_constant(lagrange_coeffs[0]);
+
+        // Use one of the right-most advice columns for all of our range checks.
+        let range_check = LookupRangeCheckConfig::configure(meta, advices[9], table_idx);
+
+        // Configuration for curve point operations.
+        // This uses 10 advice columns and spans the whole circuit.
+        let ecc_config = EccChip::<OrchardFixedBases>::configure(
+            meta,
+            advices,
+            lagrange_coeffs,
+            range_check.clone(),
+        );
+
+        // Configuration for the Poseidon hash
+        let poseidon_config = PoseidonChip::configure(
+            meta,
+            P128Pow5T3,
+            advices[6..9].try_into().unwrap(),
+            advices[5],
+            rc_a,
+            rc_b,
+        );
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_1, merkle_config_1) = {
+            let sinsemilla_config_1 = SinsemillaChip::configure(
+                meta,
+                advices[..5].try_into().unwrap(),
+                advices[6],
+                lagrange_coeffs[0],
+                lookup,
+                range_check.clone(),
+            );
+            let merkle_config_1 = MerkleChip::configure(meta, sinsemilla_config_1.clone());
+            (sinsemilla_config_1, merkle_config_1)
+        };
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_2, merkle_config_2) = {
+            let sinsemilla_config_2 = SinsemillaChip::configure(
+                meta,
+                advices[5..].try_into().unwrap(),
+                advices[7],
+                lagrange_coeffs[1],
+                lookup,
+                range_check,
+            );
+            let merkle_config_2 = MerkleChip::configure(meta, sinsemilla_config_2.clone());
+
+            (sinsemilla_config_2, merkle_config_2)
+        };
+
+        MintConfig {
+            primary,
+            q_add,
+            advices,
+            ecc_config,
+            merkle_config_1,
+            merkle_config_2,
+            sinsemilla_config_1,
+            sinsemilla_config_2,
+            poseidon_config,
+        }
+    }
 
-        // Line 35: ec_add cv vcv rcv
-        let cv = vcv.add(cs.namespace(|| "Line 35: ec_add cv vcv rcv"), &rcv)?;
+    fn synthesize(
+        &self,
+        config: Self::Config,
+        mut layouter: impl Layouter<pallas::Base>,
+    ) -> Result<(), plonk::Error> {
+        // Load the Sinsemilla generator lookup table used by the whole circuit.
+        SinsemillaChip::load(config.sinsemilla_config_1.clone(), &mut layouter)?;
 
-        // Line 37: emit_ec cv
-        cv.inputize(cs.namespace(|| "Line 37: emit_ec cv"))?;
+        let ecc_chip = config.ecc_chip();
 
-        // Line 42: ec_mul_const vca token_id G_VCV
-        let vca = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 42: ec_mul_const vca token_id G_VCV"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_VALUE_GENERATOR,
-            &token_id,
+        let pub_x = self.load_private(
+            layouter.namespace(|| "load pubkey x"),
+            config.advices[0],
+            self.pub_x,
         )?;
 
-        // Line 43: ec_mul_const rca randomness_token G_VCR
-        let rca = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 43: ec_mul_const rca randomness_token G_VCR"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR,
-            &randomness_token,
+        let pub_y = self.load_private(
+            layouter.namespace(|| "load pubkey y"),
+            config.advices[0],
+            self.pub_y,
         )?;
 
-        // Line 44: ec_add ca vca rca
-        let ca = vca.add(cs.namespace(|| "Line 44: ec_add ca vca rca"), &rca)?;
-
-        // Line 46: emit_ec ca
-        ca.inputize(cs.namespace(|| "Line 46: emit_ec ca"))?;
-
-        // Line 53: alloc_binary preimage
-        let mut preimage = vec![];
-
-        // Line 56: ec_repr repr_public public
-        let repr_public = public.repr(cs.namespace(|| "Line 56: ec_repr repr_public public"))?;
-
-        // Line 57: binary_extend preimage repr_public
-        preimage.extend(repr_public);
-
-        // Line 60: binary_extend preimage value
-        preimage.extend(value);
-
-        // Line 99: binary_extend preimage token_id
-        preimage.extend(token_id);
-
-        // add 4 zero bits
-        for _ in 0..4 {
-            // Line 71: alloc_const_bit zero_bit false
-            let zero_bit = Boolean::constant(false);
+        let value = self.load_private(
+            layouter.namespace(|| "load value"),
+            config.advices[0],
+            self.value,
+        )?;
 
-            // Line 72: binary_push preimage zero_bit
-            preimage.push(zero_bit);
-        }
+        let asset = self.load_private(
+            layouter.namespace(|| "load asset"),
+            config.advices[0],
+            self.asset,
+        )?;
 
-        // Line 67: binary_extend preimage serial
-        preimage.extend(serial);
+        let serial = self.load_private(
+            layouter.namespace(|| "load serial"),
+            config.advices[0],
+            self.serial,
+        )?;
 
-        // add 4 zero bits
-        for _ in 0..4 {
-            // Line 71: alloc_const_bit zero_bit false
-            let zero_bit = Boolean::constant(false);
+        let coin_blind = self.load_private(
+            layouter.namespace(|| "load coin_blind"),
+            config.advices[0],
+            self.coin_blind,
+        )?;
 
-            // Line 72: binary_push preimage zero_bit
-            preimage.push(zero_bit);
+        // =========
+        // Coin hash
+        // =========
+        let messages = [[pub_x, pub_y], [value, asset], [serial, coin_blind]];
+        let mut hashes = vec![];
+
+        for message in messages.iter() {
+            let hash = {
+                let poseidon_message = layouter.assign_region(
+                    || "load message",
+                    |mut region| {
+                        let mut message_word = |i: usize| {
+                            let value = message[i].value();
+                            let var = region.assign_advice(
+                                || format!("load message_{}", i),
+                                config.poseidon_config.state()[i],
+                                0,
+                                || value.ok_or(plonk::Error::SynthesisError),
+                            )?;
+                            region.constrain_equal(var, message[i].cell())?;
+                            Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
+                                var, value,
+                            )))
+                        };
+                        Ok([message_word(0)?, message_word(1)?])
+                    },
+                )?;
+
+                let poseidon_hasher = PoseidonHash::init(
+                    config.poseidon_chip(),
+                    layouter.namespace(|| "Poseidon init"),
+                    ConstantLength::<2>,
+                )?;
+
+                let poseidon_output = poseidon_hasher.hash(
+                    layouter.namespace(|| "Poseidon hash (a, b)"),
+                    poseidon_message,
+                )?;
+
+                let poseidon_output: CellValue<pallas::Base> = poseidon_output.inner().into();
+                poseidon_output
+            };
+
+            hashes.push(hash);
         }
 
-        // Line 83: binary_extend preimage randomness_coin
-        preimage.extend(randomness_coin);
+        let coin = layouter.assign_region(
+            || " `coin` = hash(a,b) + hash(c, d) + hash(e, f)",
+            |mut region| {
+                config.q_add.enable(&mut region, 0)?;
+
+                copy(&mut region, || "copy ab", config.advices[6], 0, &hashes[0])?;
+                copy(&mut region, || "copy cd", config.advices[7], 0, &hashes[1])?;
+                copy(&mut region, || "copy ef", config.advices[8], 0, &hashes[2])?;
+
+                let scalar_val = hashes[0]
+                    .value()
+                    .zip(hashes[1].value())
+                    .zip(hashes[2].value())
+                    .map(|(abcd, ef)| abcd.0 + abcd.1 + ef);
+
+                let cell = region.assign_advice(
+                    || "hash(a,b)+hash(c,d)+hash(e,f)",
+                    config.advices[5],
+                    0,
+                    || scalar_val.ok_or(plonk::Error::SynthesisError),
+                )?;
+                Ok(CellValue::new(cell, scalar_val))
+            },
+        )?;
 
-        // add 4 zero bits
-        for _ in 0..4 {
-            // Line 71: alloc_const_bit zero_bit false
-            let zero_bit = Boolean::constant(false);
+        // Constrain the coin C
+        layouter.constrain_instance(coin.cell(), config.primary, MINT_COIN_OFFSET)?;
 
-            // Line 72: binary_push preimage zero_bit
-            preimage.push(zero_bit);
-        }
+        // ================
+        // Value commitment
+        // ================
 
-        // Line 120: static_assert_binary_size preimage 1088
-        assert_eq!(preimage.len(), 1088);
+        // This constant one is used for short multiplication
+        let one = self.load_private(
+            layouter.namespace(|| "load constant one"),
+            config.advices[0],
+            Some(pallas::Base::one()),
+        )?;
 
-        // Line 121: blake2s coin preimage CRH_IVK
-        let mut coin = blake2s::blake2s(
-            cs.namespace(|| "Line 121: blake2s coin preimage CRH_IVK"),
-            &preimage,
-            zcash_primitives::constants::CRH_IVK_PERSONALIZATION,
+        // v * G_1
+        let (commitment, _) = {
+            let value_commit_v = OrchardFixedBases::ValueCommitV;
+            let value_commit_v = FixedPoint::from_inner(ecc_chip.clone(), value_commit_v);
+            value_commit_v.mul_short(layouter.namespace(|| "[value] ValueCommitV"), (value, one))?
+        };
+
+        // r_V * G_2
+        let (blind, _rcv) = {
+            let rcv = self.value_blind;
+            let value_commit_r = OrchardFixedBases::ValueCommitR;
+            let value_commit_r = FixedPoint::from_inner(ecc_chip.clone(), value_commit_r);
+            value_commit_r.mul(layouter.namespace(|| "[value_blind] ValueCommitR"), rcv)?
+        };
+
+        // Constrain the value commitment coordinates
+        let value_commit = commitment.add(layouter.namespace(|| "valuecommit"), &blind)?;
+        layouter.constrain_instance(
+            value_commit.inner().x().cell(),
+            config.primary,
+            MINT_VALCOMX_OFFSET,
+        )?;
+        layouter.constrain_instance(
+            value_commit.inner().y().cell(),
+            config.primary,
+            MINT_VALCOMY_OFFSET,
         )?;
 
-        // Line 122: emit_binary coin
-        multipack::pack_into_inputs(cs.namespace(|| "Line 122: emit_binary coin"), &coin)?;
+        // ================
+        // Asset commitment
+        // ================
+        // a * G_1
+        let (commitment, _) = {
+            let asset_commit_v = OrchardFixedBases::ValueCommitV;
+            let asset_commit_v = FixedPoint::from_inner(ecc_chip.clone(), asset_commit_v);
+            asset_commit_v.mul_short(layouter.namespace(|| "[asset] ValueCommitV"), (asset, one))?
+        };
+
+        // r_A * G_2
+        let (blind, _rca) = {
+            let rca = self.asset_blind;
+            let asset_commit_r = OrchardFixedBases::ValueCommitR;
+            let asset_commit_r = FixedPoint::from_inner(ecc_chip, asset_commit_r);
+            asset_commit_r.mul(layouter.namespace(|| "[asset_blind] ValueCommitR"), rca)?
+        };
+
+        // Constrain the asset commitment coordinates
+        let asset_commit = commitment.add(layouter.namespace(|| "assetcommit"), &blind)?;
+        layouter.constrain_instance(
+            asset_commit.inner().x().cell(),
+            config.primary,
+            MINT_ASSCOMX_OFFSET,
+        )?;
+        layouter.constrain_instance(
+            asset_commit.inner().y().cell(),
+            config.primary,
+            MINT_ASSCOMY_OFFSET,
+        )?;
 
+        // At this point we've enforced all of our public inputs.
         Ok(())
     }
 }

+ 494 - 453
src/circuit/spend_contract.rs

@@ -1,516 +1,557 @@
-#![allow(unused_imports)]
-#![allow(unused_mut)]
-use bellman::{
-    gadgets::{
-        blake2s, boolean,
-        boolean::{AllocatedBit, Boolean},
-        multipack, num, Assignment,
+use pasta_curves as pasta;
+
+use halo2::{
+    circuit::{Layouter, SimpleFloorPlanner},
+    plonk::{
+        Advice, Circuit, Column, ConstraintSystem, Error, Instance as InstanceColumn, Selector,
+    },
+    poly::Rotation,
+};
+use halo2_gadgets::{
+    ecc::{
+        chip::{EccChip, EccConfig},
+        FixedPoint,
+    },
+    poseidon::{
+        Hash as PoseidonHash, Pow5T3Chip as PoseidonChip, Pow5T3Config as PoseidonConfig,
+        StateWord, Word,
+    },
+    primitives::poseidon::{ConstantLength, P128Pow5T3},
+    sinsemilla::{
+        chip::{SinsemillaChip, SinsemillaConfig},
+        merkle::chip::{MerkleChip, MerkleConfig},
+        merkle::MerklePath,
+    },
+    utilities::{
+        copy, lookup_range_check::LookupRangeCheckConfig, CellValue, UtilitiesInstructions, Var,
     },
-    groth16, Circuit, ConstraintSystem, SynthesisError,
 };
-use bls12_381::Bls12;
-use ff::{Field, PrimeField};
-use group::Curve;
-use zcash_proofs::circuit::{ecc, pedersen_hash};
 
-use crate::crypto::merkle_node::SAPLING_COMMITMENT_TREE_DEPTH;
+use crate::crypto::constants::{
+    sinsemilla::{OrchardCommitDomains, OrchardHashDomains},
+    OrchardFixedBases,
+};
 
-pub struct SpendContract {
-    pub value: Option<u64>,
-    pub token_id: Option<jubjub::Fr>,
-    pub randomness_value: Option<jubjub::Fr>,
-    pub randomness_token: Option<jubjub::Fr>,
-    pub serial: Option<jubjub::Fr>,
-    pub randomness_coin: Option<jubjub::Fr>,
-    pub secret: Option<jubjub::Fr>,
-    pub branch: [Option<bls12_381::Scalar>; SAPLING_COMMITMENT_TREE_DEPTH],
-    pub is_right: [Option<bool>; SAPLING_COMMITMENT_TREE_DEPTH],
-    pub signature_secret: Option<jubjub::Fr>,
+#[derive(Clone, Debug)]
+pub struct SpendConfig {
+    primary: Column<InstanceColumn>,
+    q_add: Selector,
+    advices: [Column<Advice>; 10],
+    ecc_config: EccConfig,
+    merkle_config_1: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    merkle_config_2: MerkleConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_1:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    sinsemilla_config_2:
+        SinsemillaConfig<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases>,
+    poseidon_config: PoseidonConfig<pasta::Fp>,
 }
-impl Circuit<bls12_381::Scalar> for SpendContract {
-    fn synthesize<CS: ConstraintSystem<bls12_381::Scalar>>(
-        self,
-        cs: &mut CS,
-    ) -> Result<(), SynthesisError> {
-        // Line 40: u64_as_binary_le value param:value
-        let value = boolean::u64_into_boolean_vec_le(
-            cs.namespace(|| "Line 40: u64_as_binary_le value param:value"),
-            self.value,
-        )?;
-
-        // Line 41: u64_as_binary_le token_id param:token_id
-        let token_id = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 41: u64_as_binary_le value param:value"),
-            self.token_id,
-        )?;
-
-        // Line 41: fr_as_binary_le randomness_value param:randomness_value
-        let randomness_value = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 41: fr_as_binary_le randomness_value param:randomness_value"),
-            self.randomness_value,
-        )?;
-
-        // Line 41: fr_as_binary_le randomness_token param:randomness_token
-        let randomness_token = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 41: fr_as_binary_le randomness_token param:randomness_token"),
-            self.randomness_token,
-        )?;
-
-        // Line 46: ec_mul_const vcv value G_VCV
-        let vcv = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 46: ec_mul_const vcv value G_VCV"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_VALUE_GENERATOR,
-            &value,
-        )?;
-
-        // Line 47: ec_mul_const rcv randomness_value G_VCR
-        let rcv = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 47: ec_mul_const rcv randomness_value G_VCR"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR,
-            &randomness_value,
-        )?;
-
-        // Line 48: ec_add cv vcv rcv
-        let cv = vcv.add(cs.namespace(|| "Line 48: ec_add cv vcv rcv"), &rcv)?;
-
-        // Line 50: emit_ec cv
-        cv.inputize(cs.namespace(|| "Line 50: emit_ec cv"))?;
-
-        // Line 46: ec_mul_const vca token_id G_VCV
-        let vca = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 46: ec_mul_const vca token_id G_VCV"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_VALUE_GENERATOR,
-            &token_id,
-        )?;
-
-        // Line 47: ec_mul_const rca randomness_token G_VCR
-        let rca = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 47: ec_mul_const rca randomness_token G_VCR"),
-            &zcash_proofs::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR,
-            &randomness_token,
-        )?;
-
-        // Line 48: ec_add ca vca rca
-        let ca = vca.add(cs.namespace(|| "Line 48: ec_add ca vca rca"), &rca)?;
-
-        // Line 50: emit_ec ca
-        ca.inputize(cs.namespace(|| "Line 50: emit_ec ca"))?;
-
-        // Line 54: fr_as_binary_le serial param:serial
-        let serial = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 54: fr_as_binary_le serial param:serial"),
-            self.serial,
-        )?;
-
-        // Line 55: fr_as_binary_le secret param:secret
-        let secret = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 55: fr_as_binary_le secret param:secret"),
-            self.secret,
-        )?;
-
-        // Line 57: alloc_binary nf_preimage
-        let mut nf_preimage = vec![];
-
-        // Line 64: binary_clone secret2 secret
-        let mut secret2: Vec<_> = secret.to_vec();
-
-        // Line 65: binary_extend nf_preimage secret2
-        nf_preimage.extend(secret2);
-
-        // Line 67: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 68: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 70: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 71: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 73: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 74: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 76: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 77: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 81: binary_clone serial2 serial
-        let mut serial2: Vec<_> = serial.to_vec();
-
-        // Line 82: binary_extend nf_preimage serial2
-        nf_preimage.extend(serial2);
-
-        // Line 84: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 85: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 87: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 88: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 90: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 91: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 93: alloc_const_bit zero_bit false
-        let zero_bit = Boolean::constant(false);
-
-        // Line 94: binary_push nf_preimage zero_bit
-        nf_preimage.push(zero_bit);
-
-        // Line 100: static_assert_binary_size nf_preimage 512
-        assert_eq!(nf_preimage.len(), 512);
-
-        // Line 101: blake2s nf nf_preimage PRF_NF
-        let mut nf = blake2s::blake2s(
-            cs.namespace(|| "Line 101: blake2s nf nf_preimage PRF_NF"),
-            &nf_preimage,
-            zcash_primitives::constants::PRF_NF_PERSONALIZATION,
-        )?;
-
-        // Line 102: emit_binary nf
-        multipack::pack_into_inputs(cs.namespace(|| "Line 102: emit_binary nf"), &nf)?;
-
-        // Line 106: ec_mul_const public secret G_SPEND
-        let public = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Line 106: ec_mul_const public secret G_SPEND"),
-            &zcash_proofs::constants::SPENDING_KEY_GENERATOR,
-            &secret,
-        )?;
 
-        // Line 110: fr_as_binary_le randomness_coin param:randomness_coin
-        let randomness_coin = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Line 110: fr_as_binary_le randomness_coin param:randomness_coin"),
-            self.randomness_coin,
-        )?;
+impl SpendConfig {
+    fn ecc_chip(&self) -> EccChip<OrchardFixedBases> {
+        EccChip::construct(self.ecc_config.clone())
+    }
 
-        // Line 113: alloc_binary preimage
-        let mut preimage = vec![];
+    /*
+    fn sinsemilla_chip_1(
+        &self,
+    ) -> SinsemillaChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        SinsemillaChip::construct(self.sinsemilla_config_1.clone())
+    }
 
-        // Line 116: ec_repr repr_public public
-        let repr_public = public.repr(cs.namespace(|| "Line 116: ec_repr repr_public public"))?;
+    fn sinsemilla_chip_2(
+        &self,
+    ) -> SinsemillaChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        SinsemillaChip::construct(self.sinsemilla_config_2.clone())
+    }
+    */
 
-        // Line 117: binary_extend preimage repr_public
-        preimage.extend(repr_public);
+    fn merkle_chip_1(
+        &self,
+    ) -> MerkleChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        MerkleChip::construct(self.merkle_config_1.clone())
+    }
 
-        // Line 120: binary_extend preimage value
-        preimage.extend(value);
+    fn merkle_chip_2(
+        &self,
+    ) -> MerkleChip<OrchardHashDomains, OrchardCommitDomains, OrchardFixedBases> {
+        MerkleChip::construct(self.merkle_config_2.clone())
+    }
 
-        // Line 109: binary_extend preimage token_id
-        preimage.extend(token_id);
+    fn poseidon_chip(&self) -> PoseidonChip<pasta::Fp> {
+        PoseidonChip::construct(self.poseidon_config.clone())
+    }
+}
 
-        // add 4 zero bits
-        for _ in 0..4 {
-            // Line 71: alloc_const_bit zero_bit false
-            let zero_bit = Boolean::constant(false);
+// The public input array offsets
+const BURN_NULLIFIER_OFFSET: usize = 0;
+const BURN_VALCOMX_OFFSET: usize = 1;
+const BURN_VALCOMY_OFFSET: usize = 2;
+const BURN_ASSCOMX_OFFSET: usize = 3;
+const BURN_ASSCOMY_OFFSET: usize = 4;
+const BURN_MERKLEROOT_OFFSET: usize = 5;
+const BURN_SIGKEYX_OFFSET: usize = 6;
+const BURN_SIGKEYY_OFFSET: usize = 7;
+
+#[derive(Default, Debug)]
+pub struct SpendContract {
+    pub secret_key: Option<pasta::Fp>,
+    pub serial: Option<pasta::Fp>,
+    pub value: Option<pasta::Fp>,
+    pub asset: Option<pasta::Fp>,
+    pub coin_blind: Option<pasta::Fp>,
+    pub value_blind: Option<pasta::Fq>,
+    pub asset_blind: Option<pasta::Fq>,
+    pub leaf_pos: Option<u32>,
+    pub merkle_path: Option<[pasta::Fp; 32]>,
+    pub sig_secret: Option<pasta::Fq>,
+}
 
-            // Line 72: binary_push preimage zero_bit
-            preimage.push(zero_bit);
-        }
+impl UtilitiesInstructions<pasta::Fp> for SpendContract {
+    type Var = CellValue<pasta::Fp>;
+}
 
-        // Line 123: binary_extend preimage serial
-        preimage.extend(serial);
+impl Circuit<pasta::Fp> for SpendContract {
+    type Config = SpendConfig;
+    type FloorPlanner = SimpleFloorPlanner;
 
-        // add 4 zero bits
-        for _ in 0..4 {
-            // Line 71: alloc_const_bit zero_bit false
-            let zero_bit = Boolean::constant(false);
+    fn without_witnesses(&self) -> Self {
+        Self::default()
+    }
 
-            // Line 72: binary_push preimage zero_bit
-            preimage.push(zero_bit);
+    fn configure(meta: &mut ConstraintSystem<pasta::Fp>) -> Self::Config {
+        // Advice columns used in the circuit
+        let advices = [
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+            meta.advice_column(),
+        ];
+
+        // Addition of three field elements
+        let q_add = meta.selector();
+        meta.create_gate("a+b+c", |meta| {
+            let q_add = meta.query_selector(q_add);
+            let sum = meta.query_advice(advices[5], Rotation::cur());
+            let a = meta.query_advice(advices[6], Rotation::cur());
+            let b = meta.query_advice(advices[7], Rotation::cur());
+            let c = meta.query_advice(advices[8], Rotation::cur());
+
+            vec![q_add * (a + b + c - sum)]
+        });
+
+        // Fixed columns for the Sinsemilla generator lookup table
+        let table_idx = meta.lookup_table_column();
+        let lookup = (
+            table_idx,
+            meta.lookup_table_column(),
+            meta.lookup_table_column(),
+        );
+
+        // Instance column used for public inputs
+        let primary = meta.instance_column();
+        meta.enable_equality(primary.into());
+
+        // Permutation over all advice columns
+        for advice in advices.iter() {
+            meta.enable_equality((*advice).into());
         }
 
-        // Line 139: binary_extend preimage randomness_coin
-        preimage.extend(randomness_coin);
-
-        // add 4 zero bits
-        for _ in 0..4 {
-            // Line 71: alloc_const_bit zero_bit false
-            let zero_bit = Boolean::constant(false);
-
-            // Line 72: binary_push preimage zero_bit
-            preimage.push(zero_bit);
+        // Poseidon requires four advice columns, while ECC incomplete addition
+        // requires six. We can reduce the proof size by sharing fixed columns
+        // between the ECC and Poseidon chips.
+        // TODO: For multiple invocations they could/should be configured in
+        // parallel rather than sharing perhaps?
+        let lagrange_coeffs = [
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+            meta.fixed_column(),
+        ];
+        let rc_a = lagrange_coeffs[2..5].try_into().unwrap();
+        let rc_b = lagrange_coeffs[5..8].try_into().unwrap();
+
+        // Also use the first Lagrange coefficient column for loading global constants.
+        meta.enable_constant(lagrange_coeffs[0]);
+
+        // Use one of the right-most advice columns for all of our range checks.
+        let range_check = LookupRangeCheckConfig::configure(meta, advices[9], table_idx);
+
+        // Configuration for curve point operations.
+        // This uses 10 advice columns and spans the whole circuit.
+        let ecc_config = EccChip::<OrchardFixedBases>::configure(
+            meta,
+            advices,
+            lagrange_coeffs,
+            range_check.clone(),
+        );
+
+        // Configuration for the Poseidon hash
+        let poseidon_config = PoseidonChip::configure(
+            meta,
+            P128Pow5T3,
+            advices[6..9].try_into().unwrap(),
+            advices[5],
+            rc_a,
+            rc_b,
+        );
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_1, merkle_config_1) = {
+            let sinsemilla_config_1 = SinsemillaChip::configure(
+                meta,
+                advices[..5].try_into().unwrap(),
+                advices[6],
+                lagrange_coeffs[0],
+                lookup,
+                range_check.clone(),
+            );
+            let merkle_config_1 = MerkleChip::configure(meta, sinsemilla_config_1.clone());
+            (sinsemilla_config_1, merkle_config_1)
+        };
+
+        // Configuration for a Sinsemilla hash instantiation and a
+        // Merkle hash instantiation using this Sinsemilla instance.
+        // Since the Sinsemilla config uses only 5 advice columns,
+        // we can fit two instances side-by-side.
+        let (sinsemilla_config_2, merkle_config_2) = {
+            let sinsemilla_config_2 = SinsemillaChip::configure(
+                meta,
+                advices[5..].try_into().unwrap(),
+                advices[7],
+                lagrange_coeffs[1],
+                lookup,
+                range_check,
+            );
+            let merkle_config_2 = MerkleChip::configure(meta, sinsemilla_config_2.clone());
+
+            (sinsemilla_config_2, merkle_config_2)
+        };
+
+        SpendConfig {
+            primary,
+            q_add,
+            advices,
+            ecc_config,
+            merkle_config_1,
+            merkle_config_2,
+            sinsemilla_config_1,
+            sinsemilla_config_2,
+            poseidon_config,
         }
+    }
 
-        // Line 159: static_assert_binary_size preimage 1088
-        assert_eq!(preimage.len(), 1088);
-
-        // Line 160: blake2s coin preimage CRH_IVK
-        let mut coin = blake2s::blake2s(
-            cs.namespace(|| "Line 160: blake2s coin preimage CRH_IVK"),
-            &preimage,
-            zcash_primitives::constants::CRH_IVK_PERSONALIZATION,
+    fn synthesize(
+        &self,
+        config: Self::Config,
+        mut layouter: impl Layouter<pasta::Fp>,
+    ) -> Result<(), Error> {
+        // Load the Sinsemilla generator lookup table used by the whole circuit.
+        SinsemillaChip::load(config.sinsemilla_config_1.clone(), &mut layouter)?;
+
+        // Construct the ECC chip.
+        let ecc_chip = config.ecc_chip();
+
+        // Construct the merkle chips
+        let merkle_chip_1 = config.merkle_chip_1();
+        let merkle_chip_2 = config.merkle_chip_2();
+
+        // =========
+        // Nullifier
+        // =========
+        let secret_key = self.load_private(
+            layouter.namespace(|| "load sinsemilla(secret key)"),
+            config.advices[0],
+            self.secret_key,
         )?;
 
-        // Line 166: pedersen_hash cm coin NOTE_COMMIT
-        let mut cm = pedersen_hash::pedersen_hash(
-            cs.namespace(|| "Line 166: pedersen_hash cm coin NOTE_COMMIT"),
-            pedersen_hash::Personalization::NoteCommitment,
-            &coin,
+        let serial = self.load_private(
+            layouter.namespace(|| "load serial"),
+            config.advices[0],
+            self.serial,
         )?;
 
-        // Line 168: ec_get_u current cm
-        let mut current = cm.get_u().clone();
-
-        for i in 0..SAPLING_COMMITMENT_TREE_DEPTH {
-            // Line 174: alloc_scalar branch param:branch_0
-            let branch = num::AllocatedNum::alloc(
-                cs.namespace(|| "Line 174: alloc_scalar branch param:branch_0"),
-                || Ok(*self.branch[i].get()?),
+        let message = [secret_key, serial];
+        let hash = {
+            let poseidon_message = layouter.assign_region(
+                || "load message",
+                |mut region| {
+                    let mut message_word = |i: usize| {
+                        let value = message[i].value();
+                        let var = region.assign_advice(
+                            || format!("load message_{}", i),
+                            config.poseidon_config.state()[i],
+                            0,
+                            || value.ok_or(Error::SynthesisError),
+                        )?;
+                        region.constrain_equal(var, message[i].cell())?;
+                        Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
+                            var, value,
+                        )))
+                    };
+                    Ok([message_word(0)?, message_word(1)?])
+                },
             )?;
 
-            // Line 177: alloc_bit is_right param:is_right_0
-            let is_right = boolean::Boolean::from(boolean::AllocatedBit::alloc(
-                cs.namespace(|| "Line 177: alloc_bit is_right param:is_right_0"),
-                self.is_right[i],
-            )?);
-
-            // Line 180: conditionally_reverse left right current branch is_right
-            let (left, right) = num::AllocatedNum::conditionally_reverse(
-                cs.namespace(|| {
-                    "Line 180: conditionally_reverse left right current branch is_right"
-                }),
-                &current,
-                &branch,
-                &is_right,
+            let poseidon_hasher = PoseidonHash::init(
+                config.poseidon_chip(),
+                layouter.namespace(|| "Poseidon init"),
+                ConstantLength::<2>,
             )?;
 
-            // Line 183: scalar_as_binary left left
-            let left = left.to_bits_le(cs.namespace(|| "Line 183: scalar_as_binary left left"))?;
-
-            // Line 184: scalar_as_binary right right
-            let right =
-                right.to_bits_le(cs.namespace(|| "Line 184: scalar_as_binary right right"))?;
-
-            // Line 185: alloc_binary preimage
-            let mut preimage = vec![];
-
-            // Line 186: binary_extend preimage left
-            preimage.extend(left);
+            let poseidon_output = poseidon_hasher.hash(
+                layouter.namespace(|| "Poseidon hash (secretkey, serial)"),
+                poseidon_message,
+            )?;
 
-            // Line 187: binary_extend preimage right
-            preimage.extend(right);
+            let poseidon_output: CellValue<pasta::Fp> = poseidon_output.inner().into();
+            poseidon_output
+        };
 
-            // Line 188: pedersen_hash cm preimage MERKLE_0
-            let mut cm = pedersen_hash::pedersen_hash(
-                cs.namespace(|| "Line 188: pedersen_hash cm preimage MERKLE_0"),
-                pedersen_hash::Personalization::MerkleTree(i),
-                &preimage,
-            )?;
+        layouter.constrain_instance(hash.cell(), config.primary, BURN_NULLIFIER_OFFSET)?;
 
-            // Line 190: ec_get_u current cm
-            current = cm.get_u().clone();
-        }
+        // let nullifier_k = FixedPointBaseField::from_inner(ecc_chip.clone(), NullifierK);
+        //     nullifier_k.mul(
+        //         layouter.namespace(|| "[poseidon_output + psi_old] NullifierK"),
+        //         scalar,
+        //     )?
 
-        /*
-        // Line 174: alloc_scalar branch param:branch_0
-        let branch = num::AllocatedNum::alloc(
-            cs.namespace(|| "Line 174: alloc_scalar branch param:branch_0"),
-            || Ok(*self.branch_0.get()?),
+        let value = self.load_private(
+            layouter.namespace(|| "load value"),
+            config.advices[0],
+            self.value,
         )?;
 
-        // Line 177: alloc_bit is_right param:is_right_0
-        let is_right = boolean::Boolean::from(boolean::AllocatedBit::alloc(
-            cs.namespace(|| "Line 177: alloc_bit is_right param:is_right_0"),
-            self.is_right_0,
-        )?);
-
-        // Line 180: conditionally_reverse left right current branch is_right
-        let (left, right) = num::AllocatedNum::conditionally_reverse(
-            cs.namespace(|| "Line 180: conditionally_reverse left right current branch is_right"),
-            &current,
-            &branch,
-            &is_right,
+        let asset = self.load_private(
+            layouter.namespace(|| "load asset"),
+            config.advices[0],
+            self.asset,
         )?;
 
-        // Line 183: scalar_as_binary left left
-        let left = left.to_bits_le(cs.namespace(|| "Line 183: scalar_as_binary left left"))?;
-
-        // Line 184: scalar_as_binary right right
-        let right = right.to_bits_le(cs.namespace(|| "Line 184: scalar_as_binary right right"))?;
-
-        // Line 185: alloc_binary preimage
-        let mut preimage = vec![];
-
-        // Line 186: binary_extend preimage left
-        preimage.extend(left);
-
-        // Line 187: binary_extend preimage right
-        preimage.extend(right);
-
-        // Line 188: pedersen_hash cm preimage MERKLE_0
-        let mut cm = pedersen_hash::pedersen_hash(
-            cs.namespace(|| "Line 188: pedersen_hash cm preimage MERKLE_0"),
-            pedersen_hash::Personalization::MerkleTree(0),
-            &preimage,
+        let coin_blind = self.load_private(
+            layouter.namespace(|| "load coin_blind"),
+            config.advices[0],
+            self.coin_blind,
         )?;
 
-        // Line 190: ec_get_u current cm
-        let mut current = cm.get_u().clone();
+        let public_key = {
+            let nullifier_k = OrchardFixedBases::NullifierK;
+            let nullifier_k = FixedPoint::from_inner(ecc_chip.clone(), nullifier_k);
+            nullifier_k.mul_base_field(layouter.namespace(|| "[x_s] Nullifier"), secret_key)?
+        };
+
+        let (pub_x, pub_y) = (public_key.inner().x(), public_key.inner().y());
+
+        // =========
+        // Coin hash
+        // =========
+        let messages = [[pub_x, pub_y], [value, asset], [serial, coin_blind]];
+        let mut hashes = vec![];
+
+        for message in messages.iter() {
+            let hash = {
+                let poseidon_message = layouter.assign_region(
+                    || "load message",
+                    |mut region| {
+                        let mut message_word = |i: usize| {
+                            let value = message[i].value();
+                            let var = region.assign_advice(
+                                || format!("load message_{}", i),
+                                config.poseidon_config.state()[i],
+                                0,
+                                || value.ok_or(Error::SynthesisError),
+                            )?;
+                            region.constrain_equal(var, message[i].cell())?;
+                            Ok(Word::<_, _, P128Pow5T3, 3, 2>::from_inner(StateWord::new(
+                                var, value,
+                            )))
+                        };
+                        Ok([message_word(0)?, message_word(1)?])
+                    },
+                )?;
+
+                let poseidon_hasher = PoseidonHash::init(
+                    config.poseidon_chip(),
+                    layouter.namespace(|| "Poseidon init"),
+                    ConstantLength::<2>,
+                )?;
+
+                let poseidon_output = poseidon_hasher.hash(
+                    layouter.namespace(|| "Poseidon hash (a, b)"),
+                    poseidon_message,
+                )?;
+
+                let poseidon_output: CellValue<pasta::Fp> = poseidon_output.inner().into();
+                poseidon_output
+            };
+
+            hashes.push(hash);
+        }
 
-        // Line 194: alloc_scalar branch param:branch_1
-        let branch = num::AllocatedNum::alloc(
-            cs.namespace(|| "Line 194: alloc_scalar branch param:branch_1"),
-            || Ok(*self.branch_1.get()?),
+        let coin = layouter.assign_region(
+            || " `coin` = hash(a,b) + hash(c, d) + hash(e, f)",
+            |mut region| {
+                config.q_add.enable(&mut region, 0)?;
+
+                copy(&mut region, || "copy ab", config.advices[6], 0, &hashes[0])?;
+                copy(&mut region, || "copy cd", config.advices[7], 0, &hashes[1])?;
+                copy(&mut region, || "copy ef", config.advices[8], 0, &hashes[2])?;
+
+                let scalar_val = hashes[0]
+                    .value()
+                    .zip(hashes[1].value())
+                    .zip(hashes[2].value())
+                    .map(|(abcd, ef)| abcd.0 + abcd.1 + ef);
+
+                let cell = region.assign_advice(
+                    || "hash(a,b)+hash(c,d)+hash(e,f)",
+                    config.advices[5],
+                    0,
+                    || scalar_val.ok_or(Error::SynthesisError),
+                )?;
+                Ok(CellValue::new(cell, scalar_val))
+            },
         )?;
 
-        // Line 197: alloc_bit is_right param:is_right_1
-        let is_right = boolean::Boolean::from(boolean::AllocatedBit::alloc(
-            cs.namespace(|| "Line 197: alloc_bit is_right param:is_right_1"),
-            self.is_right_1,
-        )?);
-
-        // Line 200: conditionally_reverse left right current branch is_right
-        let (left, right) = num::AllocatedNum::conditionally_reverse(
-            cs.namespace(|| "Line 200: conditionally_reverse left right current branch is_right"),
-            &current,
-            &branch,
-            &is_right,
+        // ===========
+        // Merkle root
+        // ===========
+
+        let path = MerklePath {
+            chip_1: merkle_chip_1,
+            chip_2: merkle_chip_2,
+            domain: OrchardHashDomains::MerkleCrh,
+            leaf_pos: self.leaf_pos,
+            path: self.merkle_path,
+        };
+
+        let computed_final_root =
+            path.calculate_root(layouter.namespace(|| "calculate root"), coin)?;
+
+        layouter.constrain_instance(
+            computed_final_root.cell(),
+            config.primary,
+            BURN_MERKLEROOT_OFFSET,
         )?;
 
-        // Line 203: scalar_as_binary left left
-        let left = left.to_bits_le(cs.namespace(|| "Line 203: scalar_as_binary left left"))?;
-
-        // Line 204: scalar_as_binary right right
-        let right = right.to_bits_le(cs.namespace(|| "Line 204: scalar_as_binary right right"))?;
-
-        // Line 205: alloc_binary preimage
-        let mut preimage = vec![];
-
-        // Line 206: binary_extend preimage left
-        preimage.extend(left);
+        // ================
+        // Value commitment
+        // ================
 
-        // Line 207: binary_extend preimage right
-        preimage.extend(right);
-
-        // Line 208: pedersen_hash cm preimage MERKLE_1
-        let mut cm = pedersen_hash::pedersen_hash(
-            cs.namespace(|| "Line 208: pedersen_hash cm preimage MERKLE_1"),
-            pedersen_hash::Personalization::MerkleTree(1),
-            &preimage,
+        // This constant one is used for multiplication
+        let one = self.load_private(
+            layouter.namespace(|| "load constant one"),
+            config.advices[0],
+            Some(pasta::Fp::one()),
         )?;
 
-        // Line 210: ec_get_u current cm
-        let mut current = cm.get_u().clone();
-
-        // Line 214: alloc_scalar branch param:branch_2
-        let branch = num::AllocatedNum::alloc(
-            cs.namespace(|| "Line 214: alloc_scalar branch param:branch_2"),
-            || Ok(*self.branch_2.get()?),
+        let value = self.load_private(
+            layouter.namespace(|| "load value"),
+            config.advices[0],
+            self.value,
         )?;
 
-        // Line 217: alloc_bit is_right param:is_right_2
-        let is_right = boolean::Boolean::from(boolean::AllocatedBit::alloc(
-            cs.namespace(|| "Line 217: alloc_bit is_right param:is_right_2"),
-            self.is_right_2,
-        )?);
-
-        // Line 220: conditionally_reverse left right current branch is_right
-        let (left, right) = num::AllocatedNum::conditionally_reverse(
-            cs.namespace(|| "Line 220: conditionally_reverse left right current branch is_right"),
-            &current,
-            &branch,
-            &is_right,
+        // v * G_1
+        let (commitment, _) = {
+            let value_commit_v = OrchardFixedBases::ValueCommitV;
+            let value_commit_v = FixedPoint::from_inner(ecc_chip.clone(), value_commit_v);
+            value_commit_v.mul_short(layouter.namespace(|| "[value] ValueCommitV"), (value, one))?
+        };
+
+        // r_V * G_2
+        let (blind, _rcv) = {
+            let rcv = self.value_blind;
+            let value_commit_r = OrchardFixedBases::ValueCommitR;
+            let value_commit_r = FixedPoint::from_inner(ecc_chip.clone(), value_commit_r);
+            value_commit_r.mul(layouter.namespace(|| "[value_blind] ValueCommitR"), rcv)?
+        };
+
+        // Constrain the value commitment coordinates
+        let value_commit = commitment.add(layouter.namespace(|| "valuecommit"), &blind)?;
+        layouter.constrain_instance(
+            value_commit.inner().x().cell(),
+            config.primary,
+            BURN_VALCOMX_OFFSET,
         )?;
-
-        // Line 223: scalar_as_binary left left
-        let left = left.to_bits_le(cs.namespace(|| "Line 223: scalar_as_binary left left"))?;
-
-        // Line 224: scalar_as_binary right right
-        let right = right.to_bits_le(cs.namespace(|| "Line 224: scalar_as_binary right right"))?;
-
-        // Line 225: alloc_binary preimage
-        let mut preimage = vec![];
-
-        // Line 226: binary_extend preimage left
-        preimage.extend(left);
-
-        // Line 227: binary_extend preimage right
-        preimage.extend(right);
-
-        // Line 228: pedersen_hash cm preimage MERKLE_2
-        let mut cm = pedersen_hash::pedersen_hash(
-            cs.namespace(|| "Line 228: pedersen_hash cm preimage MERKLE_2"),
-            pedersen_hash::Personalization::MerkleTree(2),
-            &preimage,
+        layouter.constrain_instance(
+            value_commit.inner().y().cell(),
+            config.primary,
+            BURN_VALCOMY_OFFSET,
         )?;
 
-        // Line 230: ec_get_u current cm
-        let mut current = cm.get_u().clone();
+        // ================
+        // Asset commitment
+        // ================
 
-        // Line 234: alloc_scalar branch param:branch_3
-        let branch = num::AllocatedNum::alloc(
-            cs.namespace(|| "Line 234: alloc_scalar branch param:branch_3"),
-            || Ok(*self.branch_3.get()?),
+        let asset = self.load_private(
+            layouter.namespace(|| "load asset"),
+            config.advices[0],
+            self.asset,
         )?;
 
-        // Line 237: alloc_bit is_right param:is_right_3
-        let is_right = boolean::Boolean::from(boolean::AllocatedBit::alloc(
-            cs.namespace(|| "Line 237: alloc_bit is_right param:is_right_3"),
-            self.is_right_3,
-        )?);
-
-        // Line 240: conditionally_reverse left right current branch is_right
-        let (left, right) = num::AllocatedNum::conditionally_reverse(
-            cs.namespace(|| "Line 240: conditionally_reverse left right current branch is_right"),
-            &current,
-            &branch,
-            &is_right,
+        // a * G_1
+        let (commitment, _) = {
+            let asset_commit_v = OrchardFixedBases::ValueCommitV;
+            let asset_commit_v = FixedPoint::from_inner(ecc_chip.clone(), asset_commit_v);
+            asset_commit_v.mul_short(layouter.namespace(|| "[asset] ValueCommitV"), (asset, one))?
+        };
+
+        // r_A * G_2
+        let (blind, _rca) = {
+            let rca = self.asset_blind;
+            let asset_commit_r = OrchardFixedBases::ValueCommitR;
+            let asset_commit_r = FixedPoint::from_inner(ecc_chip.clone(), asset_commit_r);
+            asset_commit_r.mul(layouter.namespace(|| "[asset_blind] ValueCommitR"), rca)?
+        };
+
+        // Constrain the asset commitment coordinates
+        let asset_commit = commitment.add(layouter.namespace(|| "assetcommit"), &blind)?;
+        layouter.constrain_instance(
+            asset_commit.inner().x().cell(),
+            config.primary,
+            BURN_ASSCOMX_OFFSET,
         )?;
-
-        // Line 243: scalar_as_binary left left
-        let left = left.to_bits_le(cs.namespace(|| "Line 243: scalar_as_binary left left"))?;
-
-        // Line 244: scalar_as_binary right right
-        let right = right.to_bits_le(cs.namespace(|| "Line 244: scalar_as_binary right right"))?;
-
-        // Line 245: alloc_binary preimage
-        let mut preimage = vec![];
-
-        // Line 246: binary_extend preimage left
-        preimage.extend(left);
-
-        // Line 247: binary_extend preimage right
-        preimage.extend(right);
-
-        // Line 248: pedersen_hash cm preimage MERKLE_3
-        let mut cm = pedersen_hash::pedersen_hash(
-            cs.namespace(|| "Line 248: pedersen_hash cm preimage MERKLE_3"),
-            pedersen_hash::Personalization::MerkleTree(3),
-            &preimage,
+        layouter.constrain_instance(
+            asset_commit.inner().y().cell(),
+            config.primary,
+            BURN_ASSCOMY_OFFSET,
         )?;
 
-        // Line 250: ec_get_u current cm
-        let mut current = cm.get_u().clone();
-        */
-
-        // Line 253: emit_scalar current
-        current.inputize(cs.namespace(|| "Line 253: emit_scalar current"))?;
-
-        let signature_secret = boolean::field_into_boolean_vec_le(
-            cs.namespace(|| "Signature secret"),
-            self.signature_secret,
+        // ========================
+        // Signature key derivation
+        // ========================
+        let (sig_pub, _) = {
+            let spend_auth_g = OrchardFixedBases::SpendAuthG;
+            let spend_auth_g = FixedPoint::from_inner(ecc_chip, spend_auth_g);
+            // TODO: Do we need to load sig_secret somewhere first?
+            spend_auth_g.mul(layouter.namespace(|| "[x_s] SpendAuthG"), self.sig_secret)?
+        };
+
+        layouter.constrain_instance(
+            sig_pub.inner().x().cell(),
+            config.primary,
+            BURN_SIGKEYX_OFFSET,
         )?;
-        let signature_public = ecc::fixed_base_multiplication(
-            cs.namespace(|| "Signature public"),
-            &zcash_proofs::constants::SPENDING_KEY_GENERATOR,
-            &signature_secret,
+        layouter.constrain_instance(
+            sig_pub.inner().y().cell(),
+            config.primary,
+            BURN_SIGKEYY_OFFSET,
         )?;
-        signature_public.inputize(cs.namespace(|| "Signature public inputize"))?;
 
+        // At this point we've enforced all of our public inputs.
         Ok(())
     }
 }

+ 4 - 0
src/client.rs

@@ -1,3 +1,4 @@
+/*
 use async_executor::Executor;
 use async_std::sync::{Arc, Mutex};
 
@@ -24,6 +25,7 @@ use crate::{
     wallet::{walletdb::Balances, CashierDbPtr, Keypair, WalletPtr},
     Result,
 };
+*/
 
 #[derive(Debug, Clone, thiserror::Error)]
 pub enum ClientFailed {
@@ -53,6 +55,7 @@ pub enum ClientFailed {
     VerifyError(String),
 }
 
+/*
 pub struct Client {
     mint_params: bellman::groth16::Parameters<Bls12>,
     spend_params: bellman::groth16::Parameters<Bls12>,
@@ -544,6 +547,7 @@ impl State {
         }
     }
 }
+*/
 
 impl From<super::error::Error> for ClientFailed {
     fn from(err: super::error::Error) -> ClientFailed {

+ 208 - 0
src/crypto/arith_chip.rs

@@ -0,0 +1,208 @@
+use halo2::{
+    circuit::{Chip, Layouter},
+    plonk::{Advice, Column, ConstraintSystem, Error, Selector},
+    poly::Rotation,
+};
+use halo2_gadgets::utilities::{CellValue, Var};
+use pasta_curves::pallas;
+
+type Variable = CellValue<pallas::Base>;
+
+// Replace with use pasta::Fp and pasta::Fq
+type Fp = pallas::Base;
+//type Fq = pallas::Scalar;
+
+#[derive(Clone, Debug)]
+pub struct ArithmeticChipConfig {
+    a_col: Column<Advice>,
+    b_col: Column<Advice>,
+    //permute: Permutation,
+    s_add: Selector,
+    s_mul: Selector,
+    //s_pub: Selector,
+}
+
+pub struct ArithmeticChip {
+    config: ArithmeticChipConfig,
+}
+
+impl Chip<Fp> for ArithmeticChip {
+    type Config = ArithmeticChipConfig;
+    type Loaded = ();
+
+    fn config(&self) -> &Self::Config {
+        &self.config
+    }
+
+    fn loaded(&self) -> &Self::Loaded {
+        &()
+    }
+}
+
+impl ArithmeticChip {
+    pub fn construct(config: ArithmeticChipConfig) -> Self {
+        Self { config }
+    }
+
+    pub fn configure(cs: &mut ConstraintSystem<Fp>) -> ArithmeticChipConfig {
+        let a_col = cs.advice_column();
+        let b_col = cs.advice_column();
+
+        cs.enable_equality(a_col.into());
+        cs.enable_equality(b_col.into());
+
+        //let instance = cs.instance_column();
+
+        /*let permute = {
+            // Convert advice columns into an "any" columns.
+            let cols: [Column<Any>; 2] = [a_col.into(), b_col.into()];
+            Permutation::new(cs, &cols)
+        };*/
+
+        let s_add = cs.selector();
+        let s_mul = cs.selector();
+        //let s_pub = cs.selector();
+
+        cs.create_gate("add", |cs| {
+            let lhs = cs.query_advice(a_col, Rotation::cur());
+            let rhs = cs.query_advice(b_col, Rotation::cur());
+            let out = cs.query_advice(a_col, Rotation::next());
+            let s_add = cs.query_selector(s_add);
+
+            vec![s_add * (lhs + rhs - out)]
+        });
+
+        cs.create_gate("mul", |cs| {
+            let lhs = cs.query_advice(a_col, Rotation::cur());
+            let rhs = cs.query_advice(b_col, Rotation::cur());
+            let out = cs.query_advice(a_col, Rotation::next());
+            let s_mul = cs.query_selector(s_mul);
+
+            vec![s_mul * (lhs * rhs - out)]
+        });
+
+        /*
+        cs.create_gate("pub", |cs| {
+            let a = cs.query_advice(a_col, Rotation::cur());
+            let p = cs.query_instance(instance, Rotation::cur());
+            let s_pub = cs.query_selector(s_pub);
+
+            vec![s_pub * (p - a)]
+        });
+        */
+
+        ArithmeticChipConfig {
+            a_col,
+            b_col,
+            /*permute,*/ s_add,
+            s_mul, /*, s_pub*/
+        }
+    }
+
+    pub fn add(
+        &self,
+        mut layouter: impl Layouter<Fp>,
+        a: Variable,
+        b: Variable,
+    ) -> Result<Variable, Error> {
+        let mut out = None;
+        layouter.assign_region(
+            || "mul",
+            |mut region| {
+                self.config.s_add.enable(&mut region, 0)?;
+
+                let lhs = region.assign_advice(
+                    || "lhs",
+                    self.config.a_col,
+                    0,
+                    || a.value().ok_or(Error::SynthesisError),
+                )?;
+                let rhs = region.assign_advice(
+                    || "rhs",
+                    self.config.b_col,
+                    0,
+                    || b.value().ok_or(Error::SynthesisError),
+                )?;
+                region.constrain_equal(a.cell(), lhs)?;
+                region.constrain_equal(b.cell(), rhs)?;
+
+                let value = a.value().and_then(|a| b.value().map(|b| a + b));
+                let cell = region.assign_advice(
+                    || "lhs + rhs",
+                    self.config.a_col,
+                    1,
+                    || value.ok_or(Error::SynthesisError),
+                )?;
+
+                out = Some(Var::new(cell, value));
+                Ok(())
+            },
+        )?;
+
+        Ok(out.unwrap())
+    }
+
+    pub fn mul(
+        &self,
+        mut layouter: impl Layouter<Fp>,
+        a: Variable,
+        b: Variable,
+    ) -> Result<Variable, Error> {
+        let mut out = None;
+        layouter.assign_region(
+            || "mul",
+            |mut region| {
+                self.config.s_mul.enable(&mut region, 0)?;
+
+                let lhs = region.assign_advice(
+                    || "lhs",
+                    self.config.a_col,
+                    0,
+                    || a.value().ok_or(Error::SynthesisError),
+                )?;
+                let rhs = region.assign_advice(
+                    || "rhs",
+                    self.config.b_col,
+                    0,
+                    || b.value().ok_or(Error::SynthesisError),
+                )?;
+                region.constrain_equal(a.cell(), lhs)?;
+                region.constrain_equal(b.cell(), rhs)?;
+
+                let value = a.value().and_then(|a| b.value().map(|b| a * b));
+                let cell = region.assign_advice(
+                    || "lhs * rhs",
+                    self.config.a_col,
+                    1,
+                    || value.ok_or(Error::SynthesisError),
+                )?;
+
+                out = Some(Var::new(cell, value));
+                Ok(())
+            },
+        )?;
+
+        Ok(out.unwrap())
+    }
+
+    /*
+    fn expose_public(&self, layouter: &mut impl Layouter<Fp>, num: Number) -> Result<(), Error> {
+        layouter.assign_region(
+            || "expose public",
+            |mut region| {
+                self.config.s_pub.enable(&mut region, 0)?;
+
+                let out = region.assign_advice(
+                    || "public advice",
+                    self.config.b_col,
+                    0,
+                    || num.value.ok_or(Error::SynthesisError),
+                )?;
+                region.constrain_equal(num.cell, out)?;
+
+                Ok(())
+            },
+        )
+    }
+    */
+}

+ 24 - 14
src/crypto/coin.rs

@@ -1,31 +1,41 @@
 use std::io;
 
+use pasta_curves::{arithmetic::FieldExt, pallas};
+
 use crate::{
-    error::Result,
-    serial::{Decodable, Encodable},
+    serial::{Decodable, Encodable, ReadExt, WriteExt},
+    Result,
 };
 
-#[derive(Clone, Debug, PartialEq)]
-pub struct Coin {
-    pub repr: [u8; 32],
-}
+#[derive(Clone, Copy, Debug)]
+pub struct Coin(pub pallas::Base);
 
 impl Coin {
-    pub fn new(repr: [u8; 32]) -> Self {
-        Self { repr }
+    pub fn from_bytes(bytes: &[u8; 32]) -> Self {
+        pallas::Base::from_bytes(bytes).map(Coin).unwrap()
+    }
+
+    pub fn to_bytes(self) -> [u8; 32] {
+        self.0.to_bytes()
+    }
+
+    pub(crate) fn inner(&self) -> pallas::Base {
+        self.0
     }
 }
 
 impl Encodable for Coin {
-    fn encode<S: io::Write>(&self, s: S) -> Result<usize> {
-        self.repr.encode(s)
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        s.write_slice(&self.to_bytes()[..])?;
+        Ok(32)
     }
 }
 
 impl Decodable for Coin {
-    fn decode<D: io::Read>(d: D) -> Result<Self> {
-        Ok(Self {
-            repr: Decodable::decode(d)?,
-        })
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let mut bytes = [0u8; 32];
+        d.read_slice(&mut bytes)?;
+        let result = Self::from_bytes(&bytes);
+        Ok(result)
     }
 }

+ 11 - 0
src/crypto/constants.rs

@@ -0,0 +1,11 @@
+pub mod fixed_bases;
+pub mod sinsemilla;
+pub mod util;
+
+pub use fixed_bases::OrchardFixedBases;
+
+pub const DRK_SCHNORR_DOMAIN: &[u8] = b"DarkFi_Schnorr";
+
+pub const MERKLE_DEPTH_ORCHARD: usize = 32;
+
+pub const L_ORCHARD_MERKLE: usize = 255;

+ 214 - 0
src/crypto/constants/fixed_bases.rs

@@ -0,0 +1,214 @@
+use arrayvec::ArrayVec;
+use halo2_gadgets::ecc::{
+    chip::{compute_lagrange_coeffs, NUM_WINDOWS, NUM_WINDOWS_SHORT},
+    FixedPoints, H,
+};
+use pasta_curves::pallas;
+use pasta_curves::{
+    arithmetic::{CurveAffine, Field, FieldExt},
+    group::Curve,
+};
+
+pub mod commit_ivk_r;
+pub mod note_commit_r;
+pub mod nullifier_k;
+pub mod spend_auth_g;
+pub mod value_commit_r;
+pub mod value_commit_v;
+
+/// SWU hash-to-curve personalization for the value commitment generator
+pub const VALUE_COMMITMENT_PERSONALIZATION: &str = "z.cash:Orchard-cv";
+
+/// SWU hash-to-curve value for the value commitment generator
+pub const VALUE_COMMITMENT_R_BYTES: [u8; 1] = *b"r";
+
+/// SWU hash-to-curve value for the value commitment generator
+pub const VALUE_COMMITMENT_V_BYTES: [u8; 1] = *b"v";
+
+/// SWU hash-to-curve personalization for the note commitment generator
+pub const NOTE_COMMITMENT_PERSONALIZATION: &str = "z.cash:Orchard-NoteCommit";
+
+/// SWU hash-to-curve personalization for the IVK commitment generator
+pub const COMMIT_IVK_PERSONALIZATION: &str = "z.cash:Orchard-CommitIvk";
+
+/// SWU hash-to-curve personalization for the spending key base point and
+/// the nullifier base point K^Orchard
+pub const ORCHARD_PERSONALIZATION: &str = "z.cash:Orchard";
+
+/// Window size for fixed-base scalar multiplication
+pub const FIXED_BASE_WINDOW_SIZE: usize = 3;
+
+#[derive(Copy, Clone, Debug, Eq, PartialEq)]
+pub enum OrchardFixedBases {
+    CommitIvkR,
+    NoteCommitR,
+    ValueCommitR,
+    SpendAuthG,
+    NullifierK,
+    ValueCommitV,
+}
+
+impl FixedPoints<pallas::Affine> for OrchardFixedBases {
+    fn generator(&self) -> pallas::Affine {
+        match self {
+            OrchardFixedBases::CommitIvkR => commit_ivk_r::generator(),
+            OrchardFixedBases::NoteCommitR => note_commit_r::generator(),
+            OrchardFixedBases::ValueCommitR => value_commit_r::generator(),
+            OrchardFixedBases::SpendAuthG => spend_auth_g::generator(),
+            OrchardFixedBases::NullifierK => nullifier_k::generator(),
+            OrchardFixedBases::ValueCommitV => value_commit_v::generator(),
+        }
+    }
+    fn u(&self) -> Vec<[[u8; 32]; H]> {
+        match self {
+            OrchardFixedBases::CommitIvkR => commit_ivk_r::U.to_vec(),
+            OrchardFixedBases::NoteCommitR => note_commit_r::U.to_vec(),
+            OrchardFixedBases::ValueCommitR => value_commit_r::U.to_vec(),
+            OrchardFixedBases::SpendAuthG => spend_auth_g::U.to_vec(),
+            OrchardFixedBases::NullifierK => nullifier_k::U.to_vec(),
+            OrchardFixedBases::ValueCommitV => value_commit_v::U_SHORT.to_vec(),
+        }
+    }
+
+    fn z(&self) -> Vec<u64> {
+        match self {
+            OrchardFixedBases::CommitIvkR => commit_ivk_r::Z.to_vec(),
+            OrchardFixedBases::NoteCommitR => note_commit_r::Z.to_vec(),
+            OrchardFixedBases::ValueCommitR => value_commit_r::Z.to_vec(),
+            OrchardFixedBases::SpendAuthG => spend_auth_g::Z.to_vec(),
+            OrchardFixedBases::NullifierK => nullifier_k::Z.to_vec(),
+            OrchardFixedBases::ValueCommitV => value_commit_v::Z_SHORT.to_vec(),
+        }
+    }
+
+    fn lagrange_coeffs(&self) -> Vec<[pallas::Base; H]> {
+        match self {
+            OrchardFixedBases::ValueCommitV => {
+                compute_lagrange_coeffs(self.generator(), NUM_WINDOWS_SHORT)
+            }
+            _ => compute_lagrange_coeffs(self.generator(), NUM_WINDOWS),
+        }
+    }
+}
+
+/// For each fixed base, we calculate its scalar multiples in three-bit windows.
+/// Each window will have $2^3 = 8$ points.
+#[allow(dead_code)]
+fn compute_window_table<C: CurveAffine>(base: C, num_windows: usize) -> Vec<[C; H]> {
+    let mut window_table: Vec<[C; H]> = Vec::with_capacity(num_windows);
+
+    // Generate window table entries for all windows but the last.
+    // For these first `num_windows - 1` windows, we compute the multiple [(k+2)*(2^3)^w]B.
+    // Here, w ranges from [0..`num_windows - 1`)
+    for w in 0..(num_windows - 1) {
+        window_table.push(
+            (0..H)
+                .map(|k| {
+                    // scalar = (k+2)*(8^w)
+                    let scalar = C::ScalarExt::from_u64(k as u64 + 2)
+                        * C::ScalarExt::from_u64(H as u64).pow(&[w as u64, 0, 0, 0]);
+                    (base * scalar).to_affine()
+                })
+                .collect::<ArrayVec<C, H>>()
+                .into_inner()
+                .unwrap(),
+        );
+    }
+
+    // Generate window table entries for the last window, w = `num_windows - 1`.
+    // For the last window, we compute [k * (2^3)^w - sum]B, where sum is defined
+    // as sum = \sum_{j = 0}^{`num_windows - 2`} 2^{3j+1}
+    let sum = (0..(num_windows - 1)).fold(C::ScalarExt::zero(), |acc, j| {
+        acc + C::ScalarExt::from_u64(2).pow(&[
+            FIXED_BASE_WINDOW_SIZE as u64 * j as u64 + 1,
+            0,
+            0,
+            0,
+        ])
+    });
+    window_table.push(
+        (0..H)
+            .map(|k| {
+                // scalar = k * (2^3)^w - sum, where w = `num_windows - 1`
+                let scalar = C::ScalarExt::from_u64(k as u64)
+                    * C::ScalarExt::from_u64(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0])
+                    - sum;
+                (base * scalar).to_affine()
+            })
+            .collect::<ArrayVec<C, H>>()
+            .into_inner()
+            .unwrap(),
+    );
+
+    window_table
+}
+
+#[cfg(test)]
+// Test that Lagrange interpolation coefficients reproduce the correct x-coordinate
+// for each fixed-base multiple in each window.
+fn test_lagrange_coeffs<C: CurveAffine>(base: C, num_windows: usize) {
+    let lagrange_coeffs = compute_lagrange_coeffs(base, num_windows);
+
+    // Check first 84 windows, i.e. `k_0, k_1, ..., k_83`
+    for (idx, coeffs) in lagrange_coeffs[0..(num_windows - 1)].iter().enumerate() {
+        // Test each three-bit chunk in this window.
+        for bits in 0..(1 << FIXED_BASE_WINDOW_SIZE) {
+            {
+                // Interpolate the x-coordinate using this window's coefficients
+                let interpolated_x = super::util::evaluate::<C>(bits, coeffs);
+
+                // Compute the actual x-coordinate of the multiple [(k+2)*(8^w)]B.
+                let point = base
+                    * C::Scalar::from_u64(bits as u64 + 2)
+                    * C::Scalar::from_u64(H as u64).pow(&[idx as u64, 0, 0, 0]);
+                let x = *point.to_affine().coordinates().unwrap().x();
+
+                // Check that the interpolated x-coordinate matches the actual one.
+                assert_eq!(x, interpolated_x);
+            }
+        }
+    }
+
+    // Check last window.
+    for bits in 0..(1 << FIXED_BASE_WINDOW_SIZE) {
+        // Interpolate the x-coordinate using the last window's coefficients
+        let interpolated_x = super::util::evaluate::<C>(bits, &lagrange_coeffs[num_windows - 1]);
+
+        // Compute the actual x-coordinate of the multiple [k * (8^84) - offset]B,
+        // where offset = \sum_{j = 0}^{83} 2^{3j+1}
+        let offset = (0..(num_windows - 1)).fold(C::Scalar::zero(), |acc, w| {
+            acc + C::Scalar::from_u64(2).pow(&[
+                FIXED_BASE_WINDOW_SIZE as u64 * w as u64 + 1,
+                0,
+                0,
+                0,
+            ])
+        });
+        let scalar = C::Scalar::from_u64(bits as u64)
+            * C::Scalar::from_u64(H as u64).pow(&[(num_windows - 1) as u64, 0, 0, 0])
+            - offset;
+        let point = base * scalar;
+        let x = *point.to_affine().coordinates().unwrap().x();
+
+        // Check that the interpolated x-coordinate matches the actual one.
+        assert_eq!(x, interpolated_x);
+    }
+}
+
+#[cfg(test)]
+// Test that the z-values and u-values satisfy the conditions:
+//      1. z + y = u^2,
+//      2. z - y is not a square
+// for the y-coordinate of each fixed-base multiple in each window.
+fn test_zs_and_us<C: CurveAffine>(base: C, z: &[u64], u: &[[[u8; 32]; H]], num_windows: usize) {
+    let window_table = compute_window_table(base, num_windows);
+
+    for ((u, z), window_points) in u.iter().zip(z.iter()).zip(window_table) {
+        for (u, point) in u.iter().zip(window_points.iter()) {
+            let y = *point.coordinates().unwrap().y();
+            let u = C::Base::from_bytes(u).unwrap();
+            assert_eq!(C::Base::from_u64(*z) + y, u * u); // allow either square root
+            assert!(bool::from((C::Base::from_u64(*z) - y).sqrt().is_none()));
+        }
+    }
+}

+ 2965 - 0
src/crypto/constants/fixed_bases/commit_ivk_r.rs

@@ -0,0 +1,2965 @@
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    pallas,
+};
+
+/// Generator used in SinsemillaCommit randomness for IVK commitment
+pub const GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        24, 161, 248, 95, 110, 72, 35, 152, 199, 237, 26, 211, 226, 127, 149, 2, 72, 137, 128, 64,
+        10, 41, 52, 22, 78, 19, 112, 80, 205, 44, 162, 37,
+    ],
+    [
+        169, 221, 127, 227, 179, 147, 231, 63, 199, 166, 88, 27, 251, 66, 68, 107, 148, 87, 75, 40,
+        196, 144, 200, 194, 235, 250, 162, 102, 153, 210, 207, 41,
+    ],
+);
+
+/// Full-width z-values for GENERATOR
+pub const Z: [u64; super::NUM_WINDOWS] = [
+    18172, 17390, 61749, 65182, 33835, 155942, 26189, 52444, 40096, 139582, 99218, 20669, 291337,
+    12465, 132211, 75527, 68003, 95835, 237325, 21348, 35494, 215451, 49456, 6332, 99036, 224845,
+    25324, 23649, 83567, 20531, 9280, 72505, 136089, 21180, 132741, 32676, 18421, 107173, 45630,
+    24851, 53914, 156083, 104170, 103364, 25728, 9482, 140699, 42185, 285585, 342, 78646, 326807,
+    68908, 10376, 335378, 138003, 41031, 105432, 37682, 15886, 9325, 42470, 27439, 11884, 13979,
+    214340, 53073, 76228, 67906, 44696, 178502, 130216, 4242, 142464, 211101, 13210, 66616, 103624,
+    7870, 143575, 13058, 27070, 30734, 41157, 2955,
+];
+
+/// Full-width u-values for GENERATOR
+pub const U: [[[u8; 32]; super::H]; super::NUM_WINDOWS] = [
+    [
+        [
+            38, 43, 235, 53, 200, 116, 153, 194, 47, 92, 18, 54, 194, 221, 170, 155, 205, 143, 92,
+            174, 249, 178, 182, 216, 217, 200, 148, 84, 184, 201, 111, 24,
+        ],
+        [
+            57, 210, 96, 16, 151, 52, 218, 250, 249, 5, 128, 232, 65, 231, 239, 167, 102, 8, 198,
+            79, 116, 245, 42, 45, 237, 3, 166, 7, 179, 115, 76, 47,
+        ],
+        [
+            148, 246, 234, 157, 72, 45, 221, 176, 144, 235, 23, 51, 13, 230, 80, 196, 122, 188, 56,
+            231, 230, 193, 9, 121, 49, 208, 79, 184, 14, 56, 178, 28,
+        ],
+        [
+            139, 148, 48, 95, 182, 176, 253, 110, 107, 242, 54, 21, 66, 103, 169, 9, 207, 182, 149,
+            92, 151, 154, 80, 129, 107, 53, 158, 194, 114, 17, 67, 9,
+        ],
+        [
+            194, 138, 153, 65, 192, 221, 4, 110, 115, 182, 50, 98, 165, 161, 49, 119, 63, 24, 149,
+            79, 48, 173, 90, 248, 95, 228, 20, 248, 76, 46, 207, 2,
+        ],
+        [
+            16, 137, 162, 110, 105, 192, 29, 133, 191, 64, 219, 94, 186, 194, 0, 7, 173, 221, 156,
+            4, 123, 86, 65, 138, 26, 16, 223, 218, 186, 247, 121, 47,
+        ],
+        [
+            247, 8, 62, 207, 128, 127, 80, 169, 185, 32, 34, 54, 198, 4, 121, 42, 44, 173, 233,
+            161, 24, 123, 170, 24, 37, 186, 147, 80, 34, 6, 65, 9,
+        ],
+        [
+            184, 197, 131, 138, 111, 145, 67, 140, 183, 100, 227, 73, 20, 230, 2, 163, 56, 202, 35,
+            231, 166, 47, 139, 177, 79, 128, 79, 50, 69, 94, 128, 11,
+        ],
+    ],
+    [
+        [
+            228, 55, 222, 252, 163, 143, 71, 34, 215, 169, 224, 143, 57, 193, 87, 79, 96, 233, 88,
+            62, 140, 245, 144, 229, 235, 154, 159, 134, 176, 74, 10, 13,
+        ],
+        [
+            203, 65, 45, 88, 76, 0, 165, 247, 212, 123, 12, 178, 115, 129, 81, 211, 5, 234, 61,
+            193, 134, 73, 14, 55, 219, 239, 40, 178, 81, 127, 137, 47,
+        ],
+        [
+            118, 42, 192, 222, 58, 225, 233, 65, 254, 82, 102, 94, 121, 192, 112, 149, 5, 80, 129,
+            239, 214, 4, 25, 194, 238, 75, 208, 226, 21, 125, 139, 21,
+        ],
+        [
+            12, 65, 189, 92, 187, 162, 133, 145, 218, 177, 133, 115, 1, 196, 23, 21, 197, 179, 85,
+            84, 108, 33, 144, 51, 214, 196, 130, 16, 7, 67, 46, 10,
+        ],
+        [
+            194, 202, 169, 139, 155, 118, 15, 169, 51, 217, 118, 205, 203, 108, 45, 37, 73, 184,
+            203, 217, 143, 127, 54, 171, 255, 88, 9, 116, 206, 71, 209, 47,
+        ],
+        [
+            15, 52, 133, 149, 237, 80, 61, 200, 227, 82, 203, 228, 135, 59, 240, 163, 219, 1, 185,
+            17, 13, 248, 85, 164, 159, 169, 73, 215, 117, 212, 30, 40,
+        ],
+        [
+            30, 200, 206, 82, 181, 95, 234, 33, 234, 33, 165, 40, 175, 71, 221, 104, 194, 48, 80,
+            67, 53, 13, 117, 131, 33, 22, 81, 190, 171, 25, 115, 24,
+        ],
+        [
+            163, 65, 127, 103, 209, 178, 109, 122, 8, 2, 239, 83, 7, 176, 66, 181, 240, 17, 213,
+            28, 162, 225, 177, 182, 94, 255, 64, 60, 88, 209, 168, 15,
+        ],
+    ],
+    [
+        [
+            201, 133, 116, 99, 229, 230, 38, 216, 86, 54, 178, 27, 247, 159, 97, 189, 201, 167, 43,
+            60, 241, 97, 140, 243, 94, 64, 91, 28, 229, 55, 135, 52,
+        ],
+        [
+            113, 170, 86, 193, 75, 222, 86, 137, 7, 231, 101, 244, 158, 115, 245, 209, 214, 66,
+            163, 228, 218, 85, 56, 43, 164, 132, 221, 237, 72, 184, 91, 37,
+        ],
+        [
+            131, 115, 214, 52, 233, 217, 201, 116, 101, 213, 199, 176, 74, 97, 217, 152, 232, 87,
+            103, 124, 132, 104, 134, 160, 61, 107, 131, 81, 105, 121, 76, 41,
+        ],
+        [
+            172, 44, 224, 71, 175, 155, 74, 150, 250, 191, 110, 29, 54, 146, 12, 247, 71, 51, 30,
+            163, 203, 51, 46, 255, 155, 118, 193, 185, 138, 20, 142, 10,
+        ],
+        [
+            228, 98, 86, 115, 115, 98, 150, 181, 175, 218, 75, 241, 35, 254, 191, 123, 237, 163,
+            215, 117, 6, 203, 219, 65, 245, 161, 225, 48, 67, 224, 161, 21,
+        ],
+        [
+            239, 23, 50, 140, 192, 70, 215, 235, 223, 250, 6, 174, 207, 249, 166, 70, 92, 226, 138,
+            237, 234, 146, 19, 108, 181, 80, 254, 80, 222, 78, 170, 13,
+        ],
+        [
+            105, 88, 220, 64, 178, 53, 69, 119, 203, 32, 253, 120, 201, 121, 5, 44, 163, 120, 62,
+            197, 13, 211, 222, 212, 161, 35, 191, 40, 81, 239, 98, 45,
+        ],
+        [
+            225, 167, 50, 48, 66, 64, 142, 173, 238, 171, 131, 2, 178, 131, 193, 75, 44, 33, 113,
+            143, 159, 81, 201, 165, 3, 132, 91, 69, 72, 122, 5, 34,
+        ],
+    ],
+    [
+        [
+            48, 191, 86, 130, 85, 144, 157, 35, 36, 188, 210, 224, 234, 51, 152, 200, 136, 137,
+            168, 97, 97, 189, 232, 39, 51, 165, 73, 68, 233, 37, 14, 0,
+        ],
+        [
+            6, 86, 175, 220, 24, 9, 216, 103, 64, 7, 180, 171, 14, 90, 234, 37, 65, 169, 198, 195,
+            250, 79, 151, 139, 35, 113, 228, 26, 127, 86, 124, 12,
+        ],
+        [
+            118, 194, 93, 189, 16, 152, 182, 130, 136, 79, 99, 200, 174, 187, 181, 234, 104, 247,
+            239, 41, 176, 229, 214, 219, 110, 234, 253, 107, 53, 222, 57, 12,
+        ],
+        [
+            159, 96, 55, 104, 236, 61, 119, 214, 121, 9, 146, 92, 89, 231, 232, 121, 66, 195, 105,
+            66, 174, 191, 212, 118, 92, 30, 223, 222, 54, 171, 24, 58,
+        ],
+        [
+            78, 244, 3, 237, 108, 152, 99, 240, 195, 201, 58, 149, 136, 57, 170, 126, 90, 168, 8,
+            145, 242, 28, 58, 135, 222, 98, 198, 255, 151, 192, 140, 59,
+        ],
+        [
+            4, 123, 44, 17, 130, 193, 135, 237, 165, 215, 129, 100, 179, 215, 150, 150, 49, 171,
+            181, 27, 231, 149, 64, 82, 184, 41, 59, 255, 227, 23, 132, 45,
+        ],
+        [
+            249, 11, 208, 25, 21, 210, 141, 96, 112, 168, 221, 247, 108, 62, 216, 218, 77, 3, 13,
+            218, 133, 242, 76, 40, 72, 115, 242, 250, 118, 60, 40, 53,
+        ],
+        [
+            18, 205, 34, 103, 209, 200, 230, 196, 181, 56, 100, 22, 64, 56, 135, 88, 22, 193, 121,
+            61, 158, 23, 86, 241, 129, 216, 243, 16, 137, 32, 59, 15,
+        ],
+    ],
+    [
+        [
+            67, 188, 36, 61, 110, 49, 190, 197, 209, 218, 102, 48, 19, 161, 118, 249, 7, 228, 251,
+            198, 69, 36, 45, 30, 122, 113, 228, 247, 161, 90, 215, 62,
+        ],
+        [
+            230, 163, 230, 185, 126, 85, 51, 224, 220, 60, 117, 31, 116, 82, 180, 90, 35, 181, 23,
+            207, 130, 176, 146, 246, 149, 100, 35, 41, 211, 116, 76, 21,
+        ],
+        [
+            104, 218, 189, 68, 148, 109, 54, 65, 126, 148, 202, 72, 11, 178, 190, 241, 252, 42, 57,
+            119, 160, 71, 9, 113, 164, 74, 107, 108, 230, 197, 56, 34,
+        ],
+        [
+            168, 67, 227, 161, 138, 101, 117, 205, 122, 79, 124, 156, 61, 254, 239, 74, 52, 246,
+            136, 119, 100, 235, 111, 76, 249, 228, 33, 181, 76, 48, 244, 8,
+        ],
+        [
+            57, 190, 34, 170, 85, 104, 175, 192, 138, 247, 198, 225, 120, 123, 182, 167, 155, 77,
+            185, 94, 189, 249, 189, 192, 116, 210, 42, 8, 39, 107, 228, 40,
+        ],
+        [
+            137, 250, 104, 160, 92, 133, 234, 253, 148, 230, 125, 116, 77, 156, 46, 97, 98, 93, 98,
+            162, 16, 246, 14, 156, 232, 142, 228, 184, 47, 18, 109, 51,
+        ],
+        [
+            181, 234, 243, 86, 130, 53, 164, 12, 44, 2, 138, 234, 32, 159, 29, 199, 83, 104, 6,
+            251, 157, 245, 119, 243, 192, 124, 83, 141, 84, 7, 253, 37,
+        ],
+        [
+            184, 204, 52, 142, 167, 35, 251, 253, 44, 239, 94, 43, 119, 65, 99, 140, 248, 55, 32,
+            41, 123, 37, 159, 252, 228, 94, 125, 9, 94, 123, 196, 11,
+        ],
+    ],
+    [
+        [
+            220, 27, 17, 56, 42, 160, 65, 249, 171, 103, 2, 144, 119, 111, 173, 243, 169, 246, 74,
+            94, 178, 136, 81, 131, 137, 145, 8, 199, 129, 187, 82, 40,
+        ],
+        [
+            15, 14, 95, 84, 183, 63, 5, 26, 28, 13, 152, 174, 134, 53, 110, 63, 236, 51, 115, 96,
+            128, 222, 243, 133, 220, 138, 207, 69, 248, 68, 163, 54,
+        ],
+        [
+            157, 113, 146, 113, 88, 59, 70, 92, 105, 214, 135, 187, 108, 247, 196, 101, 243, 124,
+            113, 202, 145, 193, 137, 12, 189, 232, 61, 152, 47, 0, 60, 46,
+        ],
+        [
+            121, 124, 78, 224, 66, 132, 151, 208, 89, 48, 210, 229, 250, 246, 187, 115, 132, 246,
+            165, 83, 116, 100, 176, 192, 157, 149, 229, 90, 164, 247, 106, 48,
+        ],
+        [
+            179, 178, 102, 86, 109, 190, 43, 234, 151, 18, 121, 247, 58, 220, 212, 196, 22, 102,
+            246, 146, 53, 145, 90, 244, 127, 11, 114, 56, 230, 49, 239, 3,
+        ],
+        [
+            151, 130, 174, 163, 229, 52, 14, 12, 85, 143, 129, 148, 137, 192, 85, 164, 198, 87,
+            204, 79, 250, 32, 221, 149, 48, 124, 96, 176, 121, 125, 189, 42,
+        ],
+        [
+            153, 91, 143, 221, 234, 183, 165, 196, 154, 195, 52, 111, 21, 112, 103, 209, 234, 104,
+            139, 132, 183, 44, 110, 33, 16, 107, 25, 181, 58, 37, 166, 25,
+        ],
+        [
+            47, 67, 89, 104, 59, 192, 183, 21, 49, 222, 239, 60, 234, 11, 121, 71, 117, 4, 106, 20,
+            226, 178, 1, 44, 19, 241, 180, 203, 241, 195, 228, 53,
+        ],
+    ],
+    [
+        [
+            123, 55, 47, 2, 155, 105, 127, 151, 194, 54, 66, 196, 200, 140, 171, 69, 209, 52, 213,
+            234, 88, 138, 177, 18, 190, 175, 136, 118, 192, 121, 3, 60,
+        ],
+        [
+            40, 147, 60, 109, 168, 148, 50, 213, 164, 67, 54, 126, 99, 78, 221, 27, 65, 208, 53,
+            147, 192, 130, 242, 63, 97, 75, 31, 131, 139, 114, 19, 54,
+        ],
+        [
+            18, 174, 193, 9, 97, 164, 97, 44, 90, 32, 54, 8, 223, 18, 97, 244, 115, 94, 114, 178,
+            66, 198, 193, 209, 161, 56, 189, 97, 138, 189, 172, 7,
+        ],
+        [
+            73, 30, 174, 174, 85, 131, 112, 210, 126, 211, 184, 128, 29, 229, 154, 14, 238, 77, 33,
+            219, 178, 24, 163, 22, 187, 213, 72, 13, 97, 249, 53, 35,
+        ],
+        [
+            194, 188, 159, 242, 52, 203, 166, 37, 70, 147, 45, 10, 253, 195, 93, 160, 97, 99, 166,
+            192, 248, 92, 6, 73, 85, 223, 58, 113, 183, 44, 39, 24,
+        ],
+        [
+            194, 181, 84, 60, 45, 220, 54, 229, 21, 95, 31, 114, 26, 125, 202, 172, 39, 215, 50,
+            55, 67, 247, 154, 124, 28, 205, 103, 132, 150, 24, 115, 7,
+        ],
+        [
+            58, 18, 125, 164, 3, 135, 144, 38, 72, 55, 238, 146, 28, 64, 157, 12, 194, 159, 47,
+            147, 152, 202, 216, 171, 147, 169, 147, 158, 15, 210, 190, 40,
+        ],
+        [
+            17, 195, 245, 108, 190, 67, 179, 94, 90, 53, 44, 36, 195, 149, 189, 61, 45, 129, 211,
+            47, 82, 12, 48, 12, 239, 162, 216, 173, 129, 242, 89, 41,
+        ],
+    ],
+    [
+        [
+            87, 63, 207, 4, 57, 122, 127, 205, 17, 114, 67, 49, 57, 125, 176, 23, 124, 186, 31, 23,
+            240, 37, 248, 255, 196, 215, 78, 156, 76, 11, 208, 11,
+        ],
+        [
+            198, 119, 167, 135, 159, 121, 168, 1, 179, 169, 15, 36, 219, 227, 120, 22, 57, 156,
+            149, 193, 81, 160, 60, 172, 173, 107, 136, 2, 207, 75, 109, 0,
+        ],
+        [
+            147, 190, 194, 154, 209, 165, 211, 180, 54, 99, 243, 144, 148, 239, 140, 181, 45, 138,
+            133, 128, 39, 218, 159, 246, 111, 140, 48, 146, 24, 179, 55, 30,
+        ],
+        [
+            163, 218, 69, 41, 175, 237, 150, 201, 166, 234, 156, 55, 5, 169, 73, 51, 248, 20, 47,
+            40, 18, 54, 245, 235, 23, 99, 169, 52, 95, 112, 90, 41,
+        ],
+        [
+            111, 154, 122, 13, 187, 181, 205, 140, 152, 97, 152, 244, 166, 102, 113, 80, 215, 209,
+            114, 78, 159, 55, 132, 147, 138, 70, 3, 99, 86, 96, 240, 43,
+        ],
+        [
+            244, 247, 239, 143, 87, 37, 51, 146, 36, 1, 168, 235, 223, 145, 44, 138, 215, 83, 247,
+            146, 205, 128, 244, 70, 39, 193, 87, 202, 180, 14, 22, 48,
+        ],
+        [
+            214, 99, 131, 88, 28, 66, 84, 178, 111, 245, 18, 26, 116, 39, 160, 226, 138, 120, 140,
+            162, 102, 240, 180, 96, 55, 0, 160, 136, 163, 92, 123, 12,
+        ],
+        [
+            180, 185, 68, 236, 220, 8, 73, 25, 32, 188, 243, 53, 80, 7, 122, 72, 114, 205, 148,
+            232, 148, 125, 144, 253, 16, 191, 120, 5, 110, 160, 179, 4,
+        ],
+    ],
+    [
+        [
+            215, 36, 133, 246, 146, 247, 247, 148, 226, 94, 231, 75, 215, 107, 94, 114, 33, 123,
+            159, 150, 147, 196, 251, 228, 202, 91, 248, 52, 181, 225, 3, 12,
+        ],
+        [
+            151, 217, 103, 127, 100, 72, 73, 217, 249, 232, 233, 179, 164, 101, 133, 105, 70, 186,
+            220, 239, 179, 151, 224, 24, 166, 8, 77, 37, 104, 146, 35, 8,
+        ],
+        [
+            236, 156, 172, 137, 14, 45, 196, 85, 119, 4, 3, 132, 17, 254, 213, 253, 82, 236, 229,
+            61, 129, 51, 56, 44, 145, 202, 139, 85, 193, 218, 144, 49,
+        ],
+        [
+            84, 3, 20, 83, 134, 163, 190, 186, 93, 102, 59, 195, 164, 237, 231, 68, 181, 194, 48,
+            66, 161, 190, 118, 16, 255, 5, 182, 100, 50, 129, 103, 35,
+        ],
+        [
+            174, 23, 251, 144, 221, 20, 104, 213, 183, 219, 143, 177, 241, 88, 90, 160, 82, 237,
+            109, 168, 6, 241, 168, 159, 172, 32, 71, 95, 195, 34, 17, 40,
+        ],
+        [
+            201, 152, 156, 13, 83, 24, 2, 213, 237, 49, 196, 157, 27, 13, 179, 251, 252, 54, 214,
+            118, 248, 220, 194, 210, 106, 126, 60, 148, 62, 216, 181, 42,
+        ],
+        [
+            13, 123, 103, 146, 116, 115, 226, 70, 243, 30, 134, 205, 127, 136, 233, 193, 46, 136,
+            185, 99, 224, 56, 117, 170, 127, 41, 79, 144, 143, 66, 178, 54,
+        ],
+        [
+            106, 68, 95, 199, 8, 128, 1, 227, 77, 41, 100, 89, 12, 106, 31, 249, 50, 31, 179, 199,
+            97, 200, 187, 138, 173, 68, 55, 220, 204, 113, 185, 17,
+        ],
+    ],
+    [
+        [
+            69, 139, 165, 232, 189, 151, 135, 228, 146, 203, 4, 199, 79, 88, 205, 208, 219, 227,
+            134, 54, 21, 219, 234, 102, 79, 40, 154, 105, 27, 90, 75, 54,
+        ],
+        [
+            106, 255, 138, 45, 182, 156, 63, 135, 105, 239, 114, 52, 216, 133, 125, 168, 94, 216,
+            27, 167, 135, 95, 103, 111, 114, 247, 194, 132, 111, 90, 246, 48,
+        ],
+        [
+            194, 9, 225, 228, 74, 52, 98, 220, 90, 99, 240, 151, 235, 87, 61, 11, 72, 37, 144, 202,
+            67, 171, 76, 97, 148, 76, 131, 111, 128, 79, 83, 26,
+        ],
+        [
+            101, 226, 33, 108, 207, 233, 24, 201, 236, 245, 69, 101, 214, 18, 21, 16, 193, 128,
+            124, 109, 38, 27, 197, 241, 67, 19, 82, 53, 4, 248, 223, 13,
+        ],
+        [
+            198, 98, 126, 137, 89, 45, 3, 147, 114, 128, 182, 243, 147, 132, 201, 109, 58, 39, 166,
+            193, 81, 8, 209, 235, 10, 108, 253, 67, 151, 135, 161, 30,
+        ],
+        [
+            119, 53, 78, 105, 73, 215, 248, 66, 16, 213, 74, 178, 30, 136, 181, 111, 193, 70, 85,
+            19, 183, 100, 90, 56, 178, 95, 217, 97, 223, 243, 11, 52,
+        ],
+        [
+            11, 121, 245, 230, 235, 125, 64, 10, 52, 221, 159, 37, 113, 169, 8, 44, 95, 145, 89,
+            93, 160, 190, 68, 235, 48, 159, 108, 13, 41, 197, 147, 51,
+        ],
+        [
+            189, 245, 38, 171, 5, 217, 150, 237, 129, 197, 196, 176, 83, 68, 183, 90, 243, 92, 121,
+            113, 83, 130, 251, 91, 115, 197, 4, 59, 35, 255, 56, 39,
+        ],
+    ],
+    [
+        [
+            250, 115, 123, 108, 134, 106, 234, 116, 143, 122, 119, 128, 48, 173, 72, 120, 37, 103,
+            242, 160, 140, 207, 135, 191, 7, 13, 97, 18, 161, 131, 6, 2,
+        ],
+        [
+            236, 123, 232, 92, 251, 155, 53, 38, 1, 189, 120, 44, 155, 102, 233, 118, 75, 140, 244,
+            133, 61, 215, 248, 63, 84, 66, 43, 167, 68, 91, 80, 20,
+        ],
+        [
+            103, 218, 138, 213, 206, 237, 104, 38, 243, 214, 154, 113, 158, 50, 252, 11, 142, 32,
+            87, 99, 211, 75, 60, 169, 53, 209, 7, 76, 78, 225, 215, 46,
+        ],
+        [
+            194, 226, 180, 141, 202, 156, 21, 38, 187, 135, 186, 116, 99, 202, 19, 181, 81, 234, 7,
+            108, 23, 13, 38, 68, 196, 172, 225, 178, 152, 58, 83, 7,
+        ],
+        [
+            160, 134, 246, 154, 234, 171, 190, 13, 94, 84, 40, 86, 32, 145, 212, 199, 66, 176, 119,
+            189, 174, 251, 168, 28, 205, 119, 7, 250, 253, 231, 138, 39,
+        ],
+        [
+            134, 77, 107, 31, 55, 174, 187, 91, 199, 170, 82, 87, 159, 255, 112, 212, 32, 53, 61,
+            0, 17, 237, 216, 205, 247, 143, 120, 131, 2, 204, 154, 60,
+        ],
+        [
+            201, 181, 59, 200, 44, 104, 196, 246, 253, 204, 123, 20, 169, 127, 230, 157, 145, 197,
+            218, 90, 99, 224, 11, 221, 2, 72, 99, 53, 193, 146, 156, 47,
+        ],
+        [
+            41, 245, 146, 251, 215, 173, 135, 54, 143, 105, 8, 15, 38, 154, 64, 148, 54, 118, 107,
+            148, 197, 91, 216, 16, 224, 57, 25, 131, 187, 219, 186, 27,
+        ],
+    ],
+    [
+        [
+            221, 254, 116, 99, 181, 55, 18, 178, 66, 57, 174, 12, 24, 26, 136, 35, 149, 84, 253,
+            62, 207, 82, 150, 156, 131, 17, 13, 156, 174, 72, 179, 29,
+        ],
+        [
+            210, 46, 48, 176, 52, 56, 63, 149, 44, 238, 40, 236, 155, 80, 243, 29, 111, 36, 240,
+            29, 67, 187, 45, 146, 116, 237, 205, 52, 176, 254, 75, 17,
+        ],
+        [
+            35, 250, 61, 135, 124, 240, 188, 158, 248, 141, 147, 223, 240, 184, 92, 228, 49, 49,
+            72, 46, 108, 235, 136, 230, 93, 215, 199, 242, 178, 43, 47, 7,
+        ],
+        [
+            27, 112, 31, 19, 47, 93, 177, 182, 109, 126, 14, 233, 59, 218, 60, 87, 133, 223, 62,
+            136, 167, 36, 184, 169, 221, 172, 74, 199, 168, 126, 247, 45,
+        ],
+        [
+            80, 135, 205, 38, 126, 77, 134, 91, 95, 2, 64, 226, 227, 181, 167, 114, 56, 63, 119,
+            60, 209, 210, 203, 55, 79, 59, 78, 6, 222, 71, 207, 7,
+        ],
+        [
+            113, 129, 202, 15, 125, 102, 224, 36, 204, 5, 170, 228, 146, 244, 105, 149, 99, 250,
+            57, 123, 198, 56, 145, 25, 6, 30, 112, 221, 201, 228, 136, 37,
+        ],
+        [
+            225, 128, 150, 104, 49, 57, 121, 187, 66, 93, 43, 114, 206, 64, 81, 11, 22, 40, 30,
+            152, 2, 85, 134, 241, 144, 41, 217, 215, 240, 196, 178, 28,
+        ],
+        [
+            46, 50, 121, 120, 185, 246, 24, 62, 72, 218, 18, 73, 186, 112, 101, 125, 62, 187, 9,
+            87, 184, 138, 229, 211, 213, 196, 116, 71, 119, 146, 214, 30,
+        ],
+    ],
+    [
+        [
+            213, 25, 243, 89, 153, 12, 106, 58, 2, 63, 93, 221, 49, 252, 84, 150, 204, 15, 253,
+            151, 32, 140, 131, 150, 37, 245, 125, 223, 136, 115, 26, 17,
+        ],
+        [
+            167, 41, 163, 182, 251, 78, 242, 173, 178, 104, 236, 137, 143, 17, 73, 129, 241, 171,
+            222, 153, 144, 64, 170, 21, 95, 62, 172, 107, 30, 237, 51, 12,
+        ],
+        [
+            206, 103, 30, 156, 70, 3, 208, 135, 21, 109, 32, 63, 76, 96, 112, 150, 219, 199, 141,
+            194, 110, 229, 101, 4, 11, 185, 50, 63, 80, 240, 133, 44,
+        ],
+        [
+            174, 29, 247, 44, 246, 20, 223, 133, 6, 122, 102, 210, 91, 66, 105, 178, 55, 227, 112,
+            89, 29, 77, 237, 38, 219, 12, 127, 136, 117, 27, 195, 49,
+        ],
+        [
+            74, 141, 53, 90, 118, 93, 102, 49, 234, 115, 93, 27, 174, 29, 70, 255, 188, 50, 130,
+            41, 76, 244, 205, 198, 192, 226, 205, 227, 48, 174, 136, 62,
+        ],
+        [
+            129, 45, 8, 72, 246, 235, 199, 178, 112, 64, 206, 81, 216, 82, 19, 228, 89, 200, 21,
+            102, 175, 15, 239, 69, 246, 47, 112, 164, 203, 196, 205, 60,
+        ],
+        [
+            26, 222, 152, 124, 45, 123, 245, 33, 71, 30, 177, 117, 217, 100, 245, 240, 159, 9, 153,
+            130, 155, 25, 51, 236, 251, 29, 196, 228, 149, 241, 148, 47,
+        ],
+        [
+            206, 140, 210, 217, 54, 219, 195, 231, 81, 215, 183, 190, 86, 184, 157, 184, 46, 131,
+            138, 159, 41, 166, 150, 180, 101, 138, 137, 131, 117, 112, 78, 28,
+        ],
+    ],
+    [
+        [
+            32, 245, 224, 194, 45, 105, 155, 242, 83, 25, 197, 160, 98, 50, 249, 46, 199, 214, 54,
+            83, 43, 191, 245, 97, 162, 116, 22, 166, 95, 158, 36, 3,
+        ],
+        [
+            92, 39, 151, 43, 3, 140, 150, 234, 15, 221, 112, 255, 2, 238, 89, 228, 133, 243, 245,
+            71, 224, 137, 8, 137, 190, 6, 26, 149, 173, 204, 57, 1,
+        ],
+        [
+            64, 18, 216, 246, 50, 188, 216, 96, 35, 148, 164, 152, 224, 77, 82, 121, 239, 17, 89,
+            103, 117, 43, 110, 154, 115, 83, 163, 27, 129, 99, 231, 13,
+        ],
+        [
+            102, 185, 48, 229, 26, 28, 30, 88, 191, 9, 87, 48, 209, 98, 186, 2, 241, 1, 154, 148,
+            50, 219, 151, 236, 144, 38, 10, 96, 168, 89, 234, 6,
+        ],
+        [
+            219, 25, 241, 139, 137, 23, 114, 87, 186, 197, 152, 231, 115, 5, 180, 151, 13, 42, 143,
+            196, 195, 63, 191, 225, 55, 185, 80, 252, 168, 220, 249, 43,
+        ],
+        [
+            56, 39, 181, 129, 25, 70, 151, 78, 137, 135, 43, 71, 194, 175, 188, 81, 187, 23, 190,
+            30, 99, 212, 106, 103, 189, 224, 21, 62, 46, 202, 112, 17,
+        ],
+        [
+            66, 143, 116, 167, 150, 120, 18, 169, 89, 188, 184, 176, 213, 238, 77, 55, 5, 116, 177,
+            74, 74, 103, 149, 26, 85, 123, 133, 205, 163, 105, 200, 13,
+        ],
+        [
+            152, 99, 40, 98, 102, 86, 25, 59, 40, 40, 161, 67, 165, 68, 132, 79, 23, 246, 234, 78,
+            171, 191, 53, 141, 162, 249, 128, 33, 235, 138, 202, 45,
+        ],
+    ],
+    [
+        [
+            156, 90, 57, 85, 160, 134, 120, 45, 141, 95, 233, 198, 87, 48, 28, 164, 86, 0, 216,
+            168, 23, 88, 84, 27, 191, 41, 191, 214, 134, 146, 125, 16,
+        ],
+        [
+            202, 213, 237, 17, 167, 12, 116, 168, 19, 16, 201, 1, 174, 151, 151, 109, 96, 38, 70,
+            163, 159, 105, 232, 241, 143, 122, 123, 74, 176, 146, 46, 53,
+        ],
+        [
+            86, 35, 102, 245, 218, 90, 113, 176, 240, 10, 35, 199, 207, 154, 109, 97, 55, 206, 79,
+            25, 161, 155, 108, 28, 71, 143, 98, 25, 41, 208, 15, 38,
+        ],
+        [
+            21, 105, 152, 96, 135, 12, 77, 15, 38, 243, 33, 154, 192, 46, 89, 206, 173, 203, 165,
+            27, 53, 154, 68, 226, 247, 152, 10, 215, 107, 10, 82, 20,
+        ],
+        [
+            169, 199, 174, 125, 91, 102, 240, 104, 65, 246, 97, 246, 21, 94, 61, 40, 70, 166, 200,
+            43, 59, 181, 54, 81, 65, 252, 130, 95, 103, 237, 172, 26,
+        ],
+        [
+            82, 236, 145, 30, 120, 228, 221, 15, 244, 173, 130, 104, 246, 245, 234, 230, 19, 52,
+            247, 195, 227, 206, 247, 161, 160, 242, 57, 139, 131, 232, 217, 19,
+        ],
+        [
+            66, 96, 175, 203, 229, 111, 75, 250, 199, 105, 135, 242, 35, 238, 196, 110, 62, 122,
+            118, 141, 104, 14, 152, 242, 122, 177, 206, 36, 47, 96, 80, 35,
+        ],
+        [
+            44, 44, 255, 47, 209, 96, 218, 60, 192, 105, 16, 204, 135, 134, 96, 245, 21, 175, 105,
+            29, 246, 177, 111, 60, 156, 25, 120, 138, 101, 6, 90, 2,
+        ],
+    ],
+    [
+        [
+            31, 184, 49, 71, 143, 43, 71, 222, 169, 53, 216, 191, 22, 249, 138, 207, 21, 24, 3, 86,
+            46, 69, 90, 63, 151, 252, 63, 56, 97, 158, 177, 47,
+        ],
+        [
+            80, 11, 236, 123, 242, 1, 232, 3, 112, 167, 77, 43, 73, 167, 74, 53, 127, 83, 151, 237,
+            182, 3, 198, 28, 92, 233, 64, 159, 129, 241, 31, 35,
+        ],
+        [
+            164, 68, 201, 171, 117, 151, 76, 22, 43, 3, 101, 209, 79, 199, 10, 242, 68, 41, 82,
+            158, 19, 203, 6, 85, 240, 109, 130, 203, 49, 23, 236, 19,
+        ],
+        [
+            200, 91, 200, 245, 221, 228, 3, 161, 167, 14, 150, 242, 143, 230, 90, 251, 97, 215,
+            108, 155, 196, 17, 25, 66, 60, 39, 65, 19, 221, 235, 105, 21,
+        ],
+        [
+            38, 200, 246, 45, 43, 12, 141, 145, 41, 87, 40, 36, 165, 94, 46, 223, 254, 245, 129,
+            61, 36, 195, 1, 60, 183, 142, 10, 11, 175, 127, 244, 50,
+        ],
+        [
+            202, 242, 204, 124, 201, 204, 110, 3, 156, 77, 23, 67, 177, 83, 55, 126, 93, 132, 159,
+            253, 43, 207, 216, 254, 65, 208, 218, 161, 36, 155, 215, 41,
+        ],
+        [
+            196, 246, 176, 207, 138, 104, 9, 125, 222, 187, 126, 223, 6, 40, 98, 57, 3, 154, 54,
+            192, 46, 76, 238, 121, 186, 37, 110, 93, 80, 189, 123, 46,
+        ],
+        [
+            2, 55, 61, 20, 25, 205, 105, 149, 79, 130, 87, 233, 206, 198, 185, 72, 135, 84, 237,
+            91, 194, 22, 122, 251, 239, 110, 119, 81, 185, 19, 172, 26,
+        ],
+    ],
+    [
+        [
+            137, 32, 193, 249, 241, 195, 226, 227, 9, 156, 214, 152, 183, 175, 233, 7, 144, 225,
+            117, 40, 17, 144, 155, 184, 73, 22, 186, 201, 126, 48, 73, 19,
+        ],
+        [
+            4, 229, 38, 227, 150, 237, 160, 16, 19, 8, 50, 139, 36, 140, 14, 168, 176, 170, 247,
+            251, 117, 175, 3, 26, 75, 51, 177, 30, 213, 155, 100, 1,
+        ],
+        [
+            38, 62, 6, 144, 171, 163, 7, 83, 176, 32, 82, 125, 170, 197, 243, 129, 78, 13, 230, 36,
+            58, 77, 17, 66, 97, 78, 237, 162, 166, 120, 64, 0,
+        ],
+        [
+            173, 217, 143, 101, 223, 2, 93, 90, 207, 15, 89, 140, 23, 62, 71, 51, 73, 66, 1, 243,
+            181, 155, 44, 210, 198, 184, 102, 129, 193, 66, 153, 53,
+        ],
+        [
+            46, 132, 212, 140, 34, 60, 168, 43, 71, 11, 78, 130, 37, 88, 126, 124, 34, 140, 178,
+            169, 206, 180, 230, 6, 220, 121, 69, 2, 158, 251, 104, 52,
+        ],
+        [
+            25, 88, 235, 52, 117, 217, 117, 152, 20, 28, 113, 243, 252, 122, 60, 178, 249, 235,
+            104, 54, 139, 106, 153, 45, 215, 237, 205, 54, 177, 250, 154, 60,
+        ],
+        [
+            144, 20, 151, 189, 75, 212, 154, 40, 119, 94, 131, 185, 43, 52, 37, 243, 134, 85, 176,
+            15, 165, 233, 201, 115, 24, 114, 213, 43, 157, 18, 200, 13,
+        ],
+        [
+            62, 211, 60, 152, 90, 25, 180, 150, 167, 108, 41, 45, 59, 205, 58, 4, 58, 110, 221,
+            131, 148, 83, 110, 196, 178, 38, 115, 216, 192, 159, 9, 1,
+        ],
+    ],
+    [
+        [
+            120, 126, 7, 168, 237, 253, 5, 172, 68, 40, 41, 161, 97, 41, 131, 250, 140, 183, 32,
+            45, 234, 188, 137, 104, 201, 78, 209, 11, 146, 115, 26, 38,
+        ],
+        [
+            125, 25, 235, 249, 4, 225, 85, 246, 226, 249, 209, 153, 173, 235, 39, 138, 126, 187,
+            144, 237, 237, 238, 7, 242, 28, 27, 0, 172, 65, 228, 114, 33,
+        ],
+        [
+            134, 96, 205, 140, 233, 160, 20, 132, 91, 169, 133, 20, 3, 101, 164, 137, 57, 128, 66,
+            255, 186, 31, 215, 57, 244, 144, 111, 29, 208, 113, 70, 8,
+        ],
+        [
+            77, 134, 125, 207, 98, 204, 79, 2, 151, 187, 122, 89, 19, 157, 8, 229, 65, 231, 71,
+            186, 149, 131, 45, 52, 44, 229, 213, 117, 124, 97, 224, 47,
+        ],
+        [
+            22, 31, 170, 116, 29, 149, 167, 52, 101, 81, 99, 102, 23, 54, 43, 88, 219, 239, 124,
+            120, 110, 103, 95, 93, 114, 82, 235, 254, 74, 162, 12, 43,
+        ],
+        [
+            157, 112, 208, 244, 62, 51, 73, 171, 174, 66, 197, 67, 115, 203, 126, 35, 72, 131, 50,
+            156, 249, 148, 69, 112, 107, 76, 103, 122, 52, 224, 209, 34,
+        ],
+        [
+            244, 70, 79, 63, 227, 180, 125, 21, 167, 95, 230, 153, 64, 29, 5, 96, 83, 108, 176,
+            197, 206, 46, 250, 57, 137, 57, 65, 75, 89, 64, 29, 27,
+        ],
+        [
+            215, 163, 172, 33, 213, 111, 149, 27, 88, 233, 32, 105, 3, 129, 48, 145, 235, 26, 134,
+            7, 186, 59, 56, 176, 166, 104, 40, 0, 201, 231, 243, 26,
+        ],
+    ],
+    [
+        [
+            87, 35, 156, 129, 118, 185, 139, 129, 110, 245, 61, 122, 247, 13, 221, 235, 250, 173,
+            136, 136, 56, 228, 183, 140, 161, 37, 46, 237, 158, 248, 157, 13,
+        ],
+        [
+            74, 120, 21, 253, 130, 99, 169, 173, 59, 189, 108, 55, 191, 30, 46, 129, 218, 43, 47,
+            42, 77, 169, 140, 23, 93, 188, 9, 170, 61, 248, 34, 57,
+        ],
+        [
+            80, 93, 107, 130, 213, 98, 234, 84, 99, 7, 36, 75, 206, 150, 12, 208, 63, 247, 223, 3,
+            162, 231, 236, 66, 187, 224, 84, 96, 153, 103, 18, 50,
+        ],
+        [
+            235, 121, 156, 218, 55, 8, 17, 101, 33, 51, 218, 31, 10, 163, 169, 198, 12, 140, 123,
+            213, 24, 143, 38, 73, 123, 129, 151, 98, 62, 250, 17, 26,
+        ],
+        [
+            152, 84, 193, 18, 114, 227, 10, 46, 250, 144, 81, 78, 116, 12, 132, 137, 13, 227, 147,
+            39, 169, 173, 126, 199, 152, 63, 187, 69, 207, 151, 152, 23,
+        ],
+        [
+            142, 128, 46, 231, 126, 20, 245, 111, 146, 158, 213, 71, 174, 100, 72, 13, 94, 126,
+            127, 238, 83, 30, 6, 250, 78, 248, 90, 42, 65, 81, 114, 29,
+        ],
+        [
+            252, 29, 137, 205, 37, 85, 213, 156, 238, 200, 193, 190, 5, 140, 230, 216, 163, 239,
+            18, 210, 130, 93, 88, 105, 99, 242, 155, 92, 108, 125, 154, 11,
+        ],
+        [
+            138, 93, 184, 46, 124, 53, 181, 41, 164, 228, 229, 50, 252, 30, 84, 156, 203, 236, 235,
+            67, 175, 177, 58, 126, 90, 46, 76, 174, 16, 102, 35, 50,
+        ],
+    ],
+    [
+        [
+            66, 109, 120, 10, 148, 162, 208, 189, 108, 229, 165, 252, 148, 105, 186, 23, 216, 168,
+            56, 226, 106, 133, 249, 188, 193, 32, 132, 189, 136, 203, 245, 38,
+        ],
+        [
+            212, 196, 252, 200, 36, 140, 206, 76, 62, 118, 3, 112, 247, 254, 149, 13, 67, 213, 158,
+            104, 163, 214, 32, 99, 168, 108, 141, 18, 67, 85, 161, 35,
+        ],
+        [
+            117, 70, 191, 243, 235, 232, 147, 89, 59, 150, 37, 79, 22, 49, 139, 155, 203, 203, 79,
+            3, 54, 87, 18, 48, 35, 139, 5, 51, 152, 20, 224, 35,
+        ],
+        [
+            146, 35, 71, 13, 6, 47, 60, 35, 176, 230, 253, 114, 246, 137, 83, 82, 255, 112, 139,
+            147, 189, 153, 219, 44, 90, 58, 79, 48, 155, 97, 192, 50,
+        ],
+        [
+            176, 96, 137, 224, 105, 17, 148, 136, 14, 4, 146, 64, 224, 173, 196, 12, 117, 17, 203,
+            113, 202, 147, 125, 248, 46, 138, 240, 187, 211, 244, 126, 51,
+        ],
+        [
+            10, 238, 39, 125, 20, 139, 248, 221, 187, 58, 244, 18, 33, 146, 43, 25, 68, 128, 171,
+            75, 102, 157, 103, 134, 66, 213, 155, 96, 206, 101, 216, 51,
+        ],
+        [
+            235, 115, 86, 91, 137, 109, 145, 181, 76, 249, 206, 228, 197, 247, 27, 239, 54, 57,
+            250, 235, 43, 205, 177, 56, 13, 244, 118, 196, 197, 47, 152, 56,
+        ],
+        [
+            239, 14, 150, 59, 172, 245, 69, 211, 26, 66, 243, 223, 239, 135, 123, 167, 246, 75, 72,
+            217, 29, 85, 66, 136, 66, 252, 212, 164, 82, 83, 8, 17,
+        ],
+    ],
+    [
+        [
+            240, 64, 94, 89, 242, 218, 143, 212, 160, 227, 13, 154, 211, 1, 137, 199, 87, 102, 155,
+            2, 238, 22, 135, 90, 1, 31, 3, 72, 120, 186, 216, 26,
+        ],
+        [
+            17, 177, 67, 243, 214, 113, 198, 12, 36, 183, 67, 197, 88, 118, 47, 156, 54, 81, 244,
+            19, 84, 250, 44, 63, 91, 1, 122, 131, 32, 140, 156, 50,
+        ],
+        [
+            18, 131, 239, 7, 227, 62, 66, 246, 185, 91, 15, 20, 138, 127, 72, 108, 118, 1, 95, 101,
+            106, 122, 213, 159, 177, 149, 158, 26, 156, 255, 164, 23,
+        ],
+        [
+            156, 143, 11, 217, 149, 102, 38, 136, 195, 206, 130, 158, 51, 7, 238, 132, 145, 89, 41,
+            105, 4, 223, 136, 187, 185, 14, 96, 203, 124, 211, 232, 27,
+        ],
+        [
+            243, 48, 57, 73, 175, 83, 255, 118, 109, 101, 251, 204, 97, 18, 136, 142, 244, 232,
+            140, 69, 137, 12, 243, 55, 6, 193, 102, 18, 105, 85, 212, 32,
+        ],
+        [
+            106, 72, 21, 34, 123, 67, 121, 212, 206, 35, 224, 6, 234, 148, 88, 70, 102, 72, 78,
+            176, 241, 69, 245, 42, 124, 102, 122, 228, 78, 213, 225, 15,
+        ],
+        [
+            138, 76, 147, 188, 209, 14, 97, 83, 234, 74, 217, 13, 10, 52, 222, 208, 215, 107, 249,
+            45, 197, 115, 144, 10, 242, 244, 80, 14, 188, 122, 243, 46,
+        ],
+        [
+            135, 1, 59, 246, 113, 195, 253, 191, 137, 145, 155, 220, 69, 4, 208, 168, 251, 143, 83,
+            125, 181, 243, 142, 133, 187, 154, 95, 35, 242, 96, 22, 46,
+        ],
+    ],
+    [
+        [
+            212, 106, 147, 198, 73, 242, 158, 22, 55, 148, 138, 51, 81, 214, 51, 215, 54, 228, 134,
+            212, 164, 23, 101, 39, 93, 111, 222, 219, 34, 238, 210, 63,
+        ],
+        [
+            44, 206, 102, 234, 64, 229, 63, 6, 217, 121, 61, 251, 91, 93, 218, 58, 191, 201, 249,
+            245, 197, 66, 190, 84, 163, 131, 52, 51, 114, 184, 27, 15,
+        ],
+        [
+            205, 245, 64, 10, 119, 181, 177, 248, 219, 83, 73, 222, 242, 114, 221, 64, 189, 254,
+            61, 12, 69, 85, 230, 143, 26, 57, 38, 144, 125, 98, 225, 38,
+        ],
+        [
+            5, 110, 248, 163, 158, 65, 46, 204, 22, 73, 246, 174, 157, 32, 211, 0, 111, 157, 247,
+            206, 108, 48, 18, 203, 229, 181, 78, 228, 19, 89, 228, 59,
+        ],
+        [
+            0, 8, 189, 101, 170, 252, 8, 211, 161, 154, 10, 147, 125, 49, 249, 48, 10, 107, 162,
+            132, 35, 169, 223, 151, 106, 194, 200, 251, 251, 243, 74, 43,
+        ],
+        [
+            57, 109, 106, 128, 160, 236, 72, 207, 149, 229, 48, 9, 124, 193, 39, 216, 210, 42, 9,
+            11, 140, 49, 187, 136, 128, 240, 253, 205, 220, 185, 90, 48,
+        ],
+        [
+            250, 254, 164, 4, 48, 165, 213, 187, 138, 16, 165, 199, 100, 173, 32, 33, 61, 217, 156,
+            149, 30, 82, 185, 0, 28, 228, 249, 137, 247, 85, 65, 58,
+        ],
+        [
+            2, 242, 14, 70, 214, 3, 108, 124, 224, 207, 16, 138, 171, 60, 1, 115, 217, 89, 60, 55,
+            211, 209, 142, 93, 114, 250, 87, 5, 60, 224, 180, 60,
+        ],
+    ],
+    [
+        [
+            144, 93, 21, 236, 191, 116, 211, 41, 163, 54, 250, 228, 3, 160, 70, 250, 130, 42, 231,
+            138, 180, 120, 229, 225, 127, 183, 94, 185, 13, 125, 155, 50,
+        ],
+        [
+            174, 14, 254, 1, 121, 129, 94, 156, 14, 188, 103, 7, 151, 42, 251, 49, 236, 235, 33, 2,
+            232, 148, 92, 233, 238, 1, 73, 88, 79, 141, 33, 28,
+        ],
+        [
+            20, 177, 228, 62, 142, 155, 143, 176, 245, 117, 129, 68, 2, 249, 175, 67, 80, 238, 156,
+            251, 77, 24, 244, 122, 60, 46, 151, 109, 189, 248, 51, 11,
+        ],
+        [
+            215, 91, 221, 163, 212, 172, 203, 236, 2, 3, 122, 182, 171, 138, 216, 28, 45, 39, 185,
+            150, 7, 23, 146, 119, 165, 97, 100, 61, 2, 10, 29, 59,
+        ],
+        [
+            161, 113, 88, 99, 211, 225, 154, 79, 233, 24, 96, 184, 88, 15, 238, 149, 42, 252, 65,
+            124, 40, 195, 78, 249, 189, 126, 145, 137, 156, 145, 116, 14,
+        ],
+        [
+            178, 124, 248, 37, 22, 236, 110, 226, 71, 15, 113, 237, 84, 182, 95, 165, 164, 66, 48,
+            122, 177, 201, 165, 216, 111, 161, 33, 61, 119, 252, 191, 35,
+        ],
+        [
+            197, 120, 10, 208, 220, 138, 250, 233, 8, 158, 226, 151, 22, 31, 183, 174, 135, 125,
+            16, 153, 88, 248, 53, 63, 179, 179, 189, 168, 188, 51, 30, 47,
+        ],
+        [
+            112, 82, 66, 68, 97, 15, 114, 12, 48, 43, 167, 112, 15, 4, 2, 42, 184, 147, 23, 151,
+            76, 93, 254, 182, 206, 61, 4, 232, 155, 28, 126, 9,
+        ],
+    ],
+    [
+        [
+            145, 216, 180, 132, 60, 223, 148, 216, 34, 180, 242, 242, 176, 250, 130, 154, 231, 192,
+            2, 180, 19, 252, 149, 36, 226, 139, 218, 152, 23, 71, 186, 60,
+        ],
+        [
+            145, 23, 19, 74, 196, 74, 253, 57, 75, 126, 188, 188, 85, 221, 184, 189, 145, 217, 9,
+            29, 92, 142, 118, 170, 123, 227, 2, 13, 45, 133, 10, 34,
+        ],
+        [
+            92, 162, 150, 39, 198, 231, 165, 20, 239, 143, 146, 25, 70, 213, 227, 42, 36, 193, 233,
+            136, 227, 72, 41, 211, 119, 192, 56, 46, 178, 115, 249, 24,
+        ],
+        [
+            184, 106, 63, 59, 43, 244, 197, 133, 94, 98, 229, 89, 233, 225, 58, 207, 125, 248, 175,
+            61, 6, 114, 65, 195, 188, 135, 168, 132, 163, 118, 73, 40,
+        ],
+        [
+            66, 44, 95, 80, 162, 127, 4, 166, 224, 150, 7, 215, 213, 240, 116, 133, 187, 123, 218,
+            65, 44, 202, 58, 102, 60, 67, 131, 28, 33, 251, 226, 35,
+        ],
+        [
+            89, 165, 126, 219, 26, 99, 11, 186, 78, 27, 5, 40, 149, 62, 109, 179, 48, 182, 87, 56,
+            220, 63, 161, 160, 189, 95, 152, 215, 116, 208, 97, 29,
+        ],
+        [
+            133, 68, 102, 106, 161, 231, 146, 41, 123, 189, 139, 12, 188, 95, 100, 65, 47, 225,
+            146, 16, 211, 141, 113, 140, 204, 214, 183, 85, 130, 129, 161, 29,
+        ],
+        [
+            95, 28, 16, 201, 220, 92, 90, 223, 184, 54, 43, 27, 180, 222, 76, 220, 109, 213, 67,
+            82, 180, 223, 14, 245, 218, 208, 56, 221, 129, 236, 198, 0,
+        ],
+    ],
+    [
+        [
+            153, 10, 78, 169, 254, 76, 133, 187, 164, 212, 220, 235, 99, 248, 60, 54, 222, 32, 177,
+            2, 73, 110, 14, 138, 64, 89, 32, 200, 132, 63, 10, 50,
+        ],
+        [
+            179, 107, 129, 58, 191, 91, 211, 38, 108, 98, 114, 39, 138, 2, 84, 136, 107, 195, 35,
+            63, 195, 194, 129, 119, 78, 121, 24, 254, 124, 168, 253, 7,
+        ],
+        [
+            201, 134, 252, 140, 79, 1, 46, 243, 125, 150, 69, 149, 201, 31, 145, 207, 118, 58, 214,
+            92, 165, 7, 121, 55, 206, 133, 90, 169, 62, 238, 88, 7,
+        ],
+        [
+            124, 231, 176, 78, 128, 30, 182, 95, 20, 20, 221, 90, 225, 166, 82, 43, 34, 235, 98,
+            104, 118, 65, 207, 222, 48, 245, 244, 162, 126, 27, 250, 40,
+        ],
+        [
+            84, 234, 22, 3, 167, 3, 19, 186, 163, 10, 6, 176, 16, 2, 161, 151, 132, 147, 110, 76,
+            120, 111, 18, 171, 200, 18, 253, 159, 59, 248, 0, 19,
+        ],
+        [
+            254, 251, 230, 244, 114, 117, 80, 226, 27, 33, 7, 106, 164, 188, 7, 234, 73, 93, 111,
+            95, 173, 159, 172, 176, 78, 88, 34, 64, 114, 144, 186, 63,
+        ],
+        [
+            229, 103, 0, 114, 148, 250, 213, 136, 168, 246, 230, 255, 196, 152, 208, 58, 26, 126,
+            104, 80, 173, 54, 87, 171, 231, 128, 129, 86, 200, 28, 6, 50,
+        ],
+        [
+            71, 246, 84, 162, 124, 177, 159, 98, 133, 205, 218, 133, 162, 133, 203, 151, 169, 145,
+            33, 18, 215, 185, 35, 218, 20, 37, 27, 12, 221, 78, 110, 28,
+        ],
+    ],
+    [
+        [
+            7, 43, 88, 155, 62, 53, 76, 25, 49, 176, 58, 33, 114, 15, 198, 248, 238, 191, 77, 235,
+            180, 168, 67, 37, 211, 154, 76, 91, 80, 200, 190, 14,
+        ],
+        [
+            187, 200, 252, 223, 36, 168, 140, 211, 167, 54, 64, 182, 227, 140, 67, 105, 66, 243,
+            132, 46, 25, 121, 138, 58, 231, 59, 241, 145, 174, 45, 158, 35,
+        ],
+        [
+            89, 201, 179, 68, 45, 205, 62, 252, 44, 171, 52, 118, 98, 252, 186, 237, 78, 237, 215,
+            210, 27, 28, 21, 138, 153, 72, 20, 129, 215, 14, 65, 13,
+        ],
+        [
+            207, 114, 96, 244, 251, 228, 50, 157, 218, 5, 140, 218, 244, 124, 241, 35, 105, 25, 78,
+            38, 32, 226, 11, 67, 158, 60, 40, 0, 90, 112, 228, 59,
+        ],
+        [
+            44, 23, 234, 166, 86, 53, 31, 5, 209, 239, 37, 13, 176, 86, 138, 220, 117, 172, 6, 218,
+            199, 181, 172, 183, 114, 122, 70, 147, 235, 69, 171, 58,
+        ],
+        [
+            251, 128, 29, 190, 110, 201, 163, 80, 112, 7, 226, 118, 202, 186, 171, 62, 201, 161,
+            102, 127, 140, 103, 55, 8, 163, 137, 161, 2, 98, 190, 60, 53,
+        ],
+        [
+            3, 77, 209, 74, 105, 88, 148, 168, 132, 184, 149, 244, 245, 31, 174, 162, 175, 102, 37,
+            175, 138, 139, 97, 68, 68, 228, 100, 89, 250, 92, 100, 19,
+        ],
+        [
+            176, 186, 169, 162, 147, 182, 155, 40, 7, 23, 44, 21, 227, 13, 45, 120, 242, 1, 27,
+            167, 111, 224, 74, 125, 25, 20, 161, 138, 25, 183, 192, 2,
+        ],
+    ],
+    [
+        [
+            151, 231, 53, 20, 217, 87, 127, 197, 27, 224, 167, 107, 88, 0, 77, 97, 49, 29, 3, 37,
+            59, 191, 47, 129, 60, 176, 200, 144, 3, 31, 120, 6,
+        ],
+        [
+            50, 17, 211, 29, 50, 226, 181, 186, 111, 15, 189, 130, 136, 8, 77, 8, 126, 228, 213, 4,
+            51, 193, 84, 83, 191, 254, 71, 223, 190, 13, 92, 14,
+        ],
+        [
+            235, 208, 23, 65, 116, 24, 230, 63, 109, 34, 215, 81, 39, 184, 79, 123, 190, 212, 36,
+            43, 97, 68, 108, 184, 171, 6, 18, 67, 172, 104, 210, 45,
+        ],
+        [
+            43, 61, 160, 187, 51, 200, 189, 10, 55, 89, 135, 156, 56, 115, 195, 45, 133, 30, 229,
+            182, 30, 93, 188, 158, 86, 180, 239, 225, 39, 203, 9, 12,
+        ],
+        [
+            112, 93, 244, 17, 221, 137, 126, 198, 97, 242, 109, 37, 18, 53, 243, 111, 32, 52, 168,
+            88, 8, 159, 133, 250, 72, 148, 15, 165, 34, 206, 4, 54,
+        ],
+        [
+            179, 38, 41, 29, 122, 240, 170, 53, 168, 87, 73, 225, 55, 212, 84, 215, 69, 250, 197,
+            81, 2, 46, 21, 71, 104, 92, 233, 125, 159, 174, 73, 28,
+        ],
+        [
+            215, 147, 127, 39, 190, 39, 215, 114, 1, 88, 192, 44, 188, 41, 189, 122, 215, 120, 26,
+            136, 42, 161, 32, 238, 123, 125, 99, 139, 123, 160, 126, 35,
+        ],
+        [
+            139, 58, 166, 224, 210, 76, 220, 214, 58, 146, 172, 75, 147, 130, 101, 34, 87, 114,
+            134, 231, 57, 106, 228, 24, 95, 150, 248, 196, 166, 157, 47, 49,
+        ],
+    ],
+    [
+        [
+            154, 44, 154, 17, 14, 119, 215, 198, 46, 175, 171, 157, 193, 22, 57, 134, 26, 142, 53,
+            232, 209, 83, 26, 15, 60, 5, 155, 141, 102, 218, 186, 5,
+        ],
+        [
+            169, 131, 113, 37, 98, 173, 190, 221, 20, 16, 88, 92, 67, 160, 25, 246, 246, 66, 31,
+            127, 43, 253, 88, 247, 40, 171, 221, 39, 50, 166, 101, 49,
+        ],
+        [
+            6, 232, 55, 227, 94, 249, 213, 167, 115, 81, 188, 73, 113, 54, 198, 181, 173, 30, 217,
+            186, 78, 230, 90, 133, 14, 129, 56, 51, 127, 107, 163, 51,
+        ],
+        [
+            120, 238, 215, 74, 28, 49, 35, 46, 98, 63, 95, 51, 241, 195, 25, 78, 248, 132, 5, 211,
+            1, 112, 122, 98, 21, 113, 125, 61, 64, 232, 110, 55,
+        ],
+        [
+            33, 74, 172, 61, 251, 174, 136, 52, 115, 195, 205, 228, 151, 213, 16, 9, 226, 190, 182,
+            100, 137, 243, 46, 178, 149, 220, 214, 116, 250, 124, 18, 35,
+        ],
+        [
+            23, 44, 183, 43, 181, 227, 174, 141, 120, 243, 138, 225, 133, 125, 53, 145, 97, 115,
+            48, 126, 152, 117, 171, 71, 162, 165, 176, 51, 32, 27, 188, 5,
+        ],
+        [
+            166, 99, 229, 130, 156, 150, 80, 56, 81, 46, 155, 102, 207, 204, 193, 88, 50, 104, 126,
+            37, 181, 161, 160, 7, 9, 133, 241, 123, 104, 67, 180, 56,
+        ],
+        [
+            5, 115, 17, 153, 100, 192, 255, 228, 78, 171, 112, 78, 174, 8, 248, 132, 165, 207, 86,
+            60, 87, 149, 165, 37, 147, 158, 161, 120, 86, 60, 84, 63,
+        ],
+    ],
+    [
+        [
+            140, 37, 93, 56, 153, 182, 130, 1, 95, 53, 224, 183, 222, 82, 182, 84, 241, 179, 104,
+            7, 205, 30, 188, 106, 227, 160, 151, 228, 251, 87, 188, 18,
+        ],
+        [
+            69, 75, 168, 95, 88, 120, 61, 139, 158, 178, 85, 80, 96, 116, 164, 31, 85, 37, 223, 70,
+            123, 211, 247, 151, 37, 26, 163, 44, 169, 26, 236, 52,
+        ],
+        [
+            253, 240, 81, 251, 222, 234, 85, 234, 243, 202, 195, 107, 86, 77, 4, 133, 3, 164, 49,
+            116, 28, 179, 60, 189, 129, 176, 72, 62, 103, 84, 130, 30,
+        ],
+        [
+            130, 7, 87, 230, 130, 156, 229, 136, 96, 182, 48, 237, 135, 249, 123, 77, 66, 215, 128,
+            140, 39, 78, 101, 221, 17, 128, 157, 194, 242, 184, 120, 39,
+        ],
+        [
+            241, 198, 194, 238, 100, 111, 211, 220, 28, 45, 77, 201, 225, 153, 45, 12, 63, 142,
+            104, 206, 74, 0, 59, 81, 227, 124, 44, 156, 149, 228, 177, 22,
+        ],
+        [
+            33, 24, 148, 45, 69, 92, 133, 68, 104, 193, 9, 44, 233, 181, 230, 248, 164, 241, 31, 3,
+            96, 4, 13, 178, 22, 115, 206, 184, 78, 66, 211, 24,
+        ],
+        [
+            147, 117, 96, 107, 211, 62, 174, 184, 36, 61, 56, 45, 148, 144, 27, 195, 147, 103, 188,
+            0, 153, 134, 134, 5, 144, 137, 176, 132, 146, 192, 72, 28,
+        ],
+        [
+            41, 43, 175, 189, 159, 31, 156, 63, 221, 19, 178, 175, 103, 67, 43, 177, 46, 76, 65,
+            225, 94, 126, 57, 99, 211, 22, 241, 242, 69, 188, 253, 53,
+        ],
+    ],
+    [
+        [
+            16, 84, 117, 4, 29, 151, 25, 85, 212, 201, 246, 140, 236, 125, 51, 153, 82, 180, 2,
+            136, 97, 13, 69, 179, 52, 2, 34, 99, 205, 11, 178, 37,
+        ],
+        [
+            50, 5, 86, 25, 191, 2, 103, 33, 91, 250, 57, 64, 191, 115, 148, 97, 73, 135, 186, 105,
+            51, 8, 93, 163, 185, 149, 97, 252, 14, 23, 223, 33,
+        ],
+        [
+            204, 37, 164, 107, 54, 185, 240, 186, 162, 231, 206, 164, 103, 105, 235, 250, 204, 56,
+            83, 83, 244, 139, 64, 169, 89, 86, 141, 122, 209, 83, 180, 2,
+        ],
+        [
+            214, 15, 207, 13, 33, 170, 216, 82, 19, 202, 172, 127, 163, 185, 70, 191, 50, 74, 81,
+            120, 137, 250, 94, 106, 89, 21, 176, 84, 116, 5, 70, 45,
+        ],
+        [
+            228, 181, 219, 48, 206, 214, 218, 233, 172, 15, 42, 210, 93, 26, 106, 40, 46, 38, 31,
+            173, 37, 220, 70, 249, 110, 228, 34, 161, 212, 145, 74, 0,
+        ],
+        [
+            116, 63, 120, 41, 190, 77, 110, 48, 6, 95, 248, 65, 28, 254, 120, 111, 18, 232, 153,
+            161, 194, 81, 56, 69, 191, 12, 8, 76, 239, 88, 105, 60,
+        ],
+        [
+            159, 17, 123, 163, 202, 118, 227, 194, 63, 51, 216, 161, 216, 223, 247, 250, 58, 64,
+            100, 242, 254, 203, 170, 226, 19, 185, 208, 69, 18, 10, 43, 52,
+        ],
+        [
+            248, 196, 92, 216, 67, 195, 218, 121, 90, 231, 175, 194, 85, 169, 109, 214, 35, 240,
+            86, 175, 175, 119, 7, 27, 43, 147, 31, 23, 64, 47, 182, 29,
+        ],
+    ],
+    [
+        [
+            168, 89, 212, 27, 44, 101, 233, 29, 222, 148, 126, 207, 237, 33, 171, 118, 157, 87, 82,
+            122, 63, 158, 78, 26, 156, 224, 204, 238, 11, 236, 75, 39,
+        ],
+        [
+            210, 162, 30, 236, 158, 198, 77, 145, 133, 121, 228, 222, 39, 19, 50, 157, 87, 102,
+            214, 144, 85, 84, 147, 165, 91, 172, 106, 113, 236, 192, 86, 9,
+        ],
+        [
+            98, 136, 193, 144, 162, 192, 99, 58, 224, 77, 23, 246, 58, 162, 203, 65, 143, 113, 124,
+            58, 65, 216, 85, 213, 87, 31, 156, 110, 167, 37, 247, 16,
+        ],
+        [
+            114, 57, 34, 60, 250, 39, 223, 43, 226, 103, 214, 214, 185, 36, 210, 248, 181, 101, 81,
+            91, 172, 174, 198, 64, 69, 215, 182, 122, 121, 48, 177, 53,
+        ],
+        [
+            54, 247, 9, 251, 221, 228, 245, 195, 31, 168, 79, 197, 35, 1, 155, 159, 197, 197, 79,
+            233, 113, 217, 39, 135, 103, 121, 171, 104, 219, 209, 151, 30,
+        ],
+        [
+            67, 76, 134, 87, 87, 24, 179, 36, 45, 144, 205, 160, 105, 47, 150, 23, 0, 205, 234, 75,
+            10, 133, 108, 14, 1, 91, 13, 238, 142, 215, 243, 58,
+        ],
+        [
+            111, 211, 5, 125, 150, 54, 126, 4, 9, 226, 217, 30, 137, 148, 156, 22, 66, 243, 179,
+            181, 153, 228, 127, 248, 2, 80, 29, 233, 179, 230, 245, 9,
+        ],
+        [
+            196, 202, 65, 82, 146, 164, 175, 9, 27, 44, 243, 201, 113, 37, 164, 51, 220, 51, 110,
+            110, 153, 72, 88, 87, 128, 158, 118, 53, 81, 212, 138, 1,
+        ],
+    ],
+    [
+        [
+            240, 27, 128, 83, 62, 106, 95, 39, 98, 33, 131, 9, 133, 210, 62, 78, 76, 240, 235, 156,
+            80, 124, 193, 74, 142, 209, 160, 60, 151, 106, 192, 17,
+        ],
+        [
+            10, 234, 151, 181, 184, 48, 26, 195, 34, 48, 69, 70, 88, 128, 36, 171, 37, 190, 63,
+            230, 131, 119, 96, 168, 221, 7, 3, 182, 61, 119, 146, 45,
+        ],
+        [
+            1, 177, 14, 77, 209, 225, 50, 37, 44, 178, 155, 185, 255, 53, 136, 39, 217, 175, 86,
+            46, 129, 51, 73, 213, 96, 70, 110, 128, 6, 209, 107, 40,
+        ],
+        [
+            1, 41, 114, 5, 32, 182, 148, 153, 210, 242, 118, 122, 146, 225, 50, 237, 138, 117, 64,
+            250, 6, 133, 64, 151, 239, 232, 112, 166, 222, 103, 192, 62,
+        ],
+        [
+            40, 11, 170, 150, 94, 39, 123, 218, 115, 43, 29, 105, 156, 208, 30, 91, 242, 19, 160,
+            156, 212, 127, 176, 42, 33, 71, 160, 76, 130, 160, 20, 36,
+        ],
+        [
+            207, 175, 212, 51, 120, 120, 218, 173, 25, 249, 187, 76, 135, 243, 179, 80, 223, 23,
+            120, 149, 107, 52, 156, 41, 255, 100, 193, 238, 248, 149, 153, 44,
+        ],
+        [
+            122, 35, 185, 54, 102, 87, 34, 91, 232, 2, 170, 41, 84, 191, 167, 96, 141, 242, 39,
+            237, 220, 115, 229, 243, 211, 216, 17, 222, 146, 109, 149, 48,
+        ],
+        [
+            135, 20, 109, 135, 214, 156, 229, 98, 173, 213, 226, 44, 144, 56, 252, 137, 190, 235,
+            120, 163, 206, 253, 181, 103, 130, 174, 201, 205, 4, 53, 152, 46,
+        ],
+    ],
+    [
+        [
+            10, 142, 209, 19, 89, 150, 192, 43, 239, 151, 170, 251, 128, 226, 243, 190, 235, 26,
+            66, 71, 55, 221, 236, 98, 149, 171, 88, 172, 230, 5, 233, 2,
+        ],
+        [
+            156, 168, 79, 29, 44, 17, 130, 180, 80, 222, 115, 221, 227, 217, 195, 91, 218, 216,
+            133, 2, 171, 15, 111, 82, 76, 171, 109, 215, 44, 206, 95, 60,
+        ],
+        [
+            82, 50, 79, 123, 243, 18, 97, 3, 135, 72, 145, 152, 246, 155, 56, 167, 69, 232, 236,
+            222, 17, 80, 228, 123, 110, 71, 187, 132, 180, 157, 94, 43,
+        ],
+        [
+            133, 56, 222, 62, 206, 68, 120, 247, 78, 228, 79, 25, 173, 18, 206, 23, 199, 33, 94,
+            146, 109, 86, 181, 57, 106, 232, 166, 187, 47, 45, 190, 31,
+        ],
+        [
+            255, 251, 31, 52, 33, 199, 123, 217, 174, 217, 232, 117, 186, 143, 26, 30, 39, 117,
+            165, 210, 103, 18, 34, 222, 59, 180, 171, 73, 64, 118, 74, 49,
+        ],
+        [
+            68, 91, 156, 155, 35, 223, 48, 21, 231, 13, 153, 12, 213, 186, 1, 241, 5, 0, 203, 212,
+            90, 49, 200, 64, 219, 252, 147, 46, 215, 151, 236, 7,
+        ],
+        [
+            247, 226, 71, 82, 215, 139, 160, 131, 30, 130, 152, 222, 210, 5, 133, 197, 241, 86, 45,
+            116, 53, 190, 25, 140, 158, 87, 213, 121, 12, 172, 199, 24,
+        ],
+        [
+            229, 141, 95, 11, 163, 54, 149, 119, 4, 118, 188, 195, 249, 198, 228, 223, 95, 167,
+            233, 188, 125, 155, 186, 86, 58, 4, 89, 10, 107, 36, 172, 16,
+        ],
+    ],
+    [
+        [
+            253, 165, 27, 216, 77, 164, 49, 188, 140, 85, 119, 2, 143, 21, 241, 7, 224, 99, 213,
+            140, 91, 71, 51, 39, 118, 152, 202, 160, 251, 21, 198, 32,
+        ],
+        [
+            0, 210, 144, 78, 21, 82, 237, 163, 173, 160, 244, 242, 249, 95, 121, 211, 200, 10, 2,
+            85, 106, 3, 176, 46, 36, 207, 155, 196, 110, 124, 128, 53,
+        ],
+        [
+            85, 250, 155, 123, 178, 197, 121, 15, 218, 152, 126, 42, 137, 33, 202, 101, 178, 22,
+            103, 192, 64, 139, 5, 127, 67, 94, 221, 100, 185, 73, 108, 10,
+        ],
+        [
+            15, 53, 88, 70, 174, 250, 13, 25, 24, 206, 211, 240, 226, 219, 163, 151, 54, 247, 178,
+            117, 151, 211, 152, 203, 237, 144, 163, 41, 173, 69, 195, 59,
+        ],
+        [
+            242, 209, 249, 152, 137, 32, 207, 20, 121, 123, 210, 175, 104, 77, 55, 143, 115, 224,
+            47, 4, 147, 97, 154, 50, 129, 125, 15, 23, 186, 161, 25, 29,
+        ],
+        [
+            210, 47, 108, 11, 41, 196, 180, 206, 209, 19, 36, 27, 105, 0, 242, 184, 75, 46, 130,
+            150, 119, 203, 105, 86, 64, 122, 246, 157, 103, 45, 7, 62,
+        ],
+        [
+            120, 226, 121, 154, 242, 62, 202, 9, 87, 218, 91, 88, 3, 245, 76, 76, 40, 26, 68, 80,
+            180, 66, 58, 139, 88, 100, 199, 100, 36, 216, 191, 58,
+        ],
+        [
+            160, 142, 135, 30, 128, 186, 93, 94, 200, 52, 246, 68, 226, 51, 140, 36, 58, 238, 64,
+            48, 165, 135, 28, 66, 183, 186, 4, 230, 104, 111, 70, 17,
+        ],
+    ],
+    [
+        [
+            169, 163, 197, 216, 116, 65, 109, 237, 51, 192, 24, 202, 186, 54, 64, 16, 135, 35, 119,
+            123, 30, 27, 149, 113, 152, 27, 213, 235, 74, 228, 25, 50,
+        ],
+        [
+            94, 146, 241, 96, 243, 211, 176, 157, 5, 20, 143, 58, 78, 196, 233, 156, 201, 33, 237,
+            201, 216, 30, 138, 99, 241, 75, 94, 195, 201, 115, 90, 57,
+        ],
+        [
+            223, 25, 95, 223, 236, 31, 251, 252, 110, 101, 210, 88, 132, 5, 20, 60, 19, 196, 188,
+            207, 184, 129, 218, 204, 171, 58, 88, 159, 254, 52, 84, 16,
+        ],
+        [
+            167, 254, 178, 116, 5, 197, 144, 192, 29, 226, 111, 206, 183, 152, 229, 102, 244, 61,
+            231, 113, 249, 238, 28, 117, 83, 196, 204, 98, 168, 252, 8, 4,
+        ],
+        [
+            116, 228, 134, 78, 53, 106, 91, 46, 222, 231, 2, 212, 189, 226, 173, 168, 212, 157,
+            120, 28, 166, 17, 232, 145, 36, 121, 221, 35, 72, 66, 196, 34,
+        ],
+        [
+            20, 133, 122, 73, 166, 68, 157, 123, 246, 7, 77, 139, 203, 121, 158, 76, 116, 100, 127,
+            230, 51, 212, 112, 138, 193, 207, 153, 250, 158, 18, 75, 51,
+        ],
+        [
+            165, 172, 206, 156, 241, 81, 188, 251, 147, 161, 222, 196, 133, 69, 112, 59, 135, 119,
+            47, 33, 85, 179, 164, 232, 120, 182, 104, 5, 196, 161, 182, 56,
+        ],
+        [
+            167, 142, 23, 10, 197, 190, 129, 124, 191, 14, 167, 7, 54, 72, 167, 134, 252, 194, 121,
+            224, 7, 189, 197, 147, 198, 62, 216, 75, 238, 55, 124, 8,
+        ],
+    ],
+    [
+        [
+            169, 7, 115, 210, 156, 19, 28, 45, 159, 241, 95, 115, 25, 97, 41, 82, 205, 96, 92, 201,
+            180, 27, 188, 101, 78, 34, 164, 62, 39, 77, 225, 44,
+        ],
+        [
+            96, 87, 81, 178, 227, 39, 109, 76, 110, 243, 25, 223, 80, 132, 214, 188, 215, 193, 106,
+            192, 165, 53, 20, 194, 37, 17, 243, 21, 41, 22, 18, 54,
+        ],
+        [
+            228, 207, 168, 250, 67, 67, 250, 225, 163, 246, 3, 206, 243, 52, 113, 22, 21, 184, 62,
+            177, 122, 200, 204, 165, 238, 201, 224, 62, 72, 33, 81, 36,
+        ],
+        [
+            62, 26, 98, 19, 20, 210, 218, 57, 126, 87, 89, 162, 47, 111, 194, 12, 214, 134, 160,
+            32, 229, 220, 107, 171, 18, 207, 106, 82, 189, 204, 141, 1,
+        ],
+        [
+            17, 26, 209, 134, 88, 233, 110, 84, 43, 104, 90, 54, 64, 165, 108, 53, 251, 129, 213,
+            254, 251, 101, 145, 40, 7, 231, 242, 249, 72, 214, 39, 42,
+        ],
+        [
+            161, 17, 192, 70, 218, 119, 88, 156, 78, 162, 251, 1, 234, 203, 81, 56, 126, 194, 126,
+            42, 165, 66, 66, 219, 157, 74, 203, 143, 18, 47, 51, 52,
+        ],
+        [
+            43, 157, 147, 232, 6, 52, 131, 52, 72, 123, 249, 157, 60, 89, 230, 143, 115, 50, 38,
+            134, 111, 206, 30, 175, 65, 36, 76, 157, 164, 65, 201, 38,
+        ],
+        [
+            206, 22, 236, 47, 122, 166, 215, 229, 161, 250, 56, 20, 180, 86, 60, 90, 251, 130, 72,
+            167, 145, 105, 142, 204, 131, 93, 69, 55, 146, 165, 221, 40,
+        ],
+    ],
+    [
+        [
+            249, 242, 21, 59, 135, 24, 245, 119, 127, 198, 118, 52, 239, 218, 112, 56, 29, 37, 147,
+            112, 46, 128, 19, 82, 194, 81, 245, 247, 54, 65, 29, 14,
+        ],
+        [
+            36, 83, 140, 239, 206, 62, 115, 139, 236, 215, 196, 82, 95, 248, 71, 245, 58, 78, 174,
+            33, 182, 29, 67, 2, 49, 46, 188, 235, 242, 85, 224, 3,
+        ],
+        [
+            62, 123, 204, 165, 50, 119, 248, 120, 89, 102, 76, 10, 251, 221, 182, 243, 92, 147, 22,
+            111, 30, 132, 4, 19, 86, 16, 201, 53, 98, 18, 43, 48,
+        ],
+        [
+            51, 40, 231, 19, 115, 64, 149, 172, 249, 156, 238, 143, 245, 188, 130, 96, 154, 29,
+            135, 109, 46, 254, 185, 130, 61, 28, 67, 8, 172, 115, 79, 58,
+        ],
+        [
+            54, 123, 99, 202, 255, 50, 82, 189, 246, 133, 142, 66, 22, 38, 76, 253, 238, 34, 88,
+            116, 77, 242, 84, 108, 243, 231, 178, 151, 103, 255, 89, 9,
+        ],
+        [
+            80, 138, 121, 15, 93, 11, 24, 112, 146, 63, 198, 155, 12, 127, 20, 15, 94, 69, 39, 221,
+            107, 251, 182, 184, 16, 84, 90, 69, 159, 213, 39, 54,
+        ],
+        [
+            139, 70, 202, 84, 209, 56, 254, 84, 216, 195, 84, 158, 124, 98, 163, 218, 94, 11, 163,
+            9, 42, 83, 159, 244, 179, 75, 190, 59, 46, 184, 30, 41,
+        ],
+        [
+            104, 75, 123, 111, 5, 75, 204, 36, 182, 49, 51, 126, 209, 201, 143, 115, 154, 53, 116,
+            250, 77, 65, 69, 226, 128, 142, 205, 101, 163, 217, 15, 42,
+        ],
+    ],
+    [
+        [
+            12, 0, 40, 89, 200, 146, 231, 32, 7, 210, 86, 77, 206, 245, 234, 19, 172, 170, 58, 108,
+            36, 183, 180, 153, 155, 161, 74, 78, 18, 213, 106, 45,
+        ],
+        [
+            54, 121, 227, 245, 13, 91, 172, 234, 241, 135, 83, 92, 132, 87, 223, 225, 170, 82, 147,
+            106, 56, 152, 196, 15, 110, 16, 220, 210, 167, 132, 147, 46,
+        ],
+        [
+            191, 194, 84, 235, 59, 153, 63, 90, 249, 253, 195, 202, 19, 162, 43, 210, 241, 180, 81,
+            251, 7, 129, 85, 120, 223, 64, 187, 56, 7, 190, 168, 34,
+        ],
+        [
+            134, 60, 171, 29, 83, 57, 134, 240, 159, 75, 121, 97, 53, 145, 10, 97, 60, 41, 64, 4,
+            212, 180, 179, 52, 1, 58, 78, 23, 120, 40, 35, 54,
+        ],
+        [
+            184, 110, 240, 2, 73, 205, 194, 246, 210, 166, 203, 213, 175, 225, 47, 211, 142, 183,
+            222, 180, 253, 7, 251, 237, 181, 54, 129, 165, 27, 43, 117, 39,
+        ],
+        [
+            192, 117, 239, 105, 11, 250, 37, 116, 110, 41, 150, 214, 18, 127, 6, 3, 95, 10, 113,
+            251, 138, 117, 88, 98, 219, 30, 92, 111, 47, 121, 62, 49,
+        ],
+        [
+            106, 41, 188, 0, 79, 170, 110, 58, 210, 56, 221, 140, 97, 225, 151, 132, 115, 192, 82,
+            181, 19, 163, 13, 17, 236, 205, 15, 30, 3, 211, 249, 6,
+        ],
+        [
+            87, 144, 20, 67, 36, 215, 225, 190, 145, 89, 16, 213, 18, 121, 231, 161, 91, 162, 36,
+            252, 20, 120, 174, 234, 203, 86, 225, 106, 52, 13, 38, 45,
+        ],
+    ],
+    [
+        [
+            238, 133, 103, 91, 99, 161, 201, 157, 122, 248, 132, 37, 241, 150, 151, 26, 199, 151,
+            164, 97, 34, 160, 197, 202, 52, 162, 229, 43, 237, 227, 136, 45,
+        ],
+        [
+            162, 65, 50, 209, 33, 252, 250, 222, 24, 113, 30, 11, 36, 85, 185, 206, 100, 108, 219,
+            183, 221, 16, 178, 179, 163, 18, 187, 82, 67, 198, 198, 57,
+        ],
+        [
+            69, 233, 89, 202, 122, 215, 104, 132, 206, 156, 152, 147, 197, 210, 27, 231, 183, 186,
+            92, 17, 120, 187, 143, 163, 225, 81, 21, 72, 93, 7, 196, 27,
+        ],
+        [
+            38, 237, 19, 29, 117, 255, 144, 122, 171, 181, 247, 94, 88, 101, 213, 241, 186, 225,
+            134, 4, 80, 120, 94, 234, 102, 183, 99, 164, 131, 187, 132, 55,
+        ],
+        [
+            155, 156, 64, 199, 160, 171, 202, 191, 152, 58, 169, 151, 175, 213, 147, 132, 46, 164,
+            196, 7, 196, 183, 186, 71, 114, 71, 184, 126, 44, 47, 24, 62,
+        ],
+        [
+            47, 44, 188, 236, 111, 225, 46, 128, 76, 235, 139, 140, 205, 235, 29, 129, 198, 199,
+            202, 172, 93, 81, 72, 26, 142, 31, 99, 48, 152, 248, 28, 40,
+        ],
+        [
+            36, 151, 70, 226, 44, 150, 152, 239, 239, 233, 50, 179, 161, 120, 65, 135, 195, 27,
+            135, 103, 192, 203, 73, 94, 21, 30, 227, 41, 40, 148, 225, 0,
+        ],
+        [
+            155, 17, 42, 85, 170, 76, 233, 176, 16, 190, 197, 57, 30, 42, 33, 223, 101, 22, 18,
+            206, 171, 83, 208, 216, 82, 178, 213, 81, 74, 255, 95, 38,
+        ],
+    ],
+    [
+        [
+            54, 8, 224, 104, 248, 77, 99, 60, 13, 208, 245, 117, 189, 100, 102, 86, 46, 130, 26,
+            21, 173, 106, 18, 60, 169, 20, 254, 83, 119, 0, 95, 5,
+        ],
+        [
+            230, 178, 120, 49, 250, 42, 251, 98, 39, 3, 136, 65, 253, 165, 204, 239, 163, 148, 51,
+            169, 122, 182, 72, 197, 222, 128, 147, 72, 237, 156, 152, 8,
+        ],
+        [
+            19, 86, 176, 28, 57, 166, 19, 232, 42, 211, 58, 20, 150, 66, 80, 17, 109, 238, 228, 68,
+            184, 14, 15, 150, 165, 6, 102, 79, 156, 6, 3, 1,
+        ],
+        [
+            253, 225, 19, 134, 49, 103, 63, 151, 7, 151, 27, 174, 176, 155, 244, 254, 80, 10, 77,
+            13, 125, 6, 0, 159, 174, 133, 128, 162, 163, 54, 32, 7,
+        ],
+        [
+            20, 122, 210, 59, 32, 118, 92, 7, 227, 125, 245, 98, 228, 150, 121, 191, 233, 127, 217,
+            33, 245, 24, 145, 160, 149, 249, 30, 132, 54, 226, 121, 9,
+        ],
+        [
+            33, 175, 62, 170, 114, 81, 193, 177, 6, 202, 21, 242, 244, 183, 86, 196, 52, 220, 193,
+            134, 119, 61, 215, 155, 24, 133, 127, 204, 95, 47, 77, 59,
+        ],
+        [
+            189, 6, 50, 74, 18, 109, 39, 182, 206, 232, 250, 242, 210, 131, 138, 112, 119, 166, 76,
+            26, 90, 52, 105, 200, 244, 199, 32, 40, 98, 228, 167, 37,
+        ],
+        [
+            56, 113, 154, 35, 162, 76, 47, 212, 228, 242, 71, 241, 126, 255, 187, 178, 64, 126, 81,
+            245, 80, 182, 200, 85, 172, 97, 35, 77, 184, 251, 84, 25,
+        ],
+    ],
+    [
+        [
+            12, 230, 104, 29, 206, 194, 74, 78, 85, 208, 57, 110, 166, 4, 210, 246, 253, 77, 87,
+            139, 137, 151, 107, 151, 193, 139, 48, 7, 131, 243, 165, 56,
+        ],
+        [
+            16, 106, 200, 3, 167, 12, 130, 120, 148, 233, 201, 119, 44, 221, 151, 90, 228, 85, 241,
+            0, 215, 129, 245, 242, 36, 55, 115, 198, 144, 158, 69, 18,
+        ],
+        [
+            28, 44, 187, 226, 84, 6, 135, 126, 182, 209, 160, 144, 14, 180, 21, 44, 8, 15, 244, 88,
+            212, 42, 24, 105, 125, 35, 172, 66, 47, 113, 133, 33,
+        ],
+        [
+            9, 189, 144, 175, 191, 136, 166, 240, 19, 237, 73, 19, 206, 196, 9, 199, 5, 25, 202,
+            165, 13, 171, 240, 169, 192, 122, 100, 129, 176, 192, 234, 55,
+        ],
+        [
+            192, 225, 147, 209, 101, 193, 163, 144, 93, 123, 172, 39, 143, 71, 136, 63, 99, 52,
+            106, 194, 237, 87, 89, 235, 146, 135, 72, 96, 74, 2, 53, 37,
+        ],
+        [
+            0, 89, 253, 106, 180, 242, 187, 141, 158, 209, 229, 100, 132, 116, 24, 10, 23, 103,
+            207, 141, 111, 230, 149, 18, 30, 13, 97, 180, 135, 73, 5, 0,
+        ],
+        [
+            81, 161, 223, 168, 32, 133, 55, 175, 229, 60, 247, 13, 214, 85, 147, 136, 166, 182,
+            207, 165, 70, 5, 246, 18, 121, 61, 124, 98, 243, 138, 30, 51,
+        ],
+        [
+            57, 191, 83, 37, 102, 159, 132, 165, 105, 85, 174, 131, 158, 51, 155, 73, 53, 161, 34,
+            45, 154, 71, 201, 15, 41, 223, 46, 21, 189, 231, 40, 19,
+        ],
+    ],
+    [
+        [
+            138, 114, 183, 238, 119, 69, 77, 194, 154, 214, 49, 36, 14, 183, 188, 15, 31, 242, 222,
+            54, 184, 157, 231, 0, 48, 45, 248, 77, 28, 231, 154, 36,
+        ],
+        [
+            179, 41, 18, 93, 149, 95, 227, 27, 14, 200, 100, 184, 90, 178, 30, 127, 59, 195, 253,
+            44, 236, 163, 110, 9, 21, 169, 129, 4, 69, 121, 147, 30,
+        ],
+        [
+            105, 82, 83, 247, 98, 229, 63, 229, 249, 250, 153, 84, 251, 79, 191, 217, 11, 54, 72,
+            161, 77, 13, 8, 84, 146, 179, 195, 130, 120, 104, 253, 33,
+        ],
+        [
+            79, 107, 10, 22, 0, 150, 204, 208, 40, 254, 8, 117, 61, 94, 43, 129, 204, 43, 103, 68,
+            128, 53, 5, 45, 217, 46, 73, 163, 205, 197, 162, 32,
+        ],
+        [
+            32, 137, 210, 135, 2, 141, 240, 12, 66, 216, 159, 1, 91, 255, 208, 69, 249, 108, 78,
+            199, 222, 246, 75, 30, 19, 10, 100, 23, 19, 55, 158, 38,
+        ],
+        [
+            225, 215, 161, 47, 217, 150, 60, 35, 109, 2, 159, 109, 167, 241, 193, 228, 243, 128,
+            84, 155, 136, 95, 205, 141, 23, 244, 34, 211, 191, 43, 165, 56,
+        ],
+        [
+            229, 240, 112, 132, 192, 72, 52, 216, 10, 111, 211, 17, 255, 129, 216, 0, 160, 71, 253,
+            197, 23, 15, 88, 86, 119, 22, 7, 215, 96, 165, 238, 51,
+        ],
+        [
+            41, 241, 99, 40, 68, 20, 115, 88, 65, 43, 219, 96, 252, 18, 192, 3, 209, 196, 244, 173,
+            167, 101, 107, 131, 145, 136, 227, 57, 29, 168, 114, 11,
+        ],
+    ],
+    [
+        [
+            154, 239, 49, 188, 250, 102, 141, 162, 103, 128, 214, 237, 112, 83, 82, 39, 169, 38,
+            186, 224, 83, 17, 44, 13, 89, 204, 82, 168, 153, 47, 177, 32,
+        ],
+        [
+            44, 230, 100, 6, 130, 117, 77, 153, 54, 35, 247, 189, 194, 8, 16, 63, 21, 142, 72, 135,
+            168, 206, 177, 164, 49, 230, 99, 225, 60, 67, 155, 39,
+        ],
+        [
+            169, 141, 219, 61, 4, 46, 12, 93, 167, 222, 157, 101, 225, 66, 40, 200, 99, 167, 104,
+            200, 201, 121, 56, 131, 9, 149, 7, 96, 78, 147, 45, 35,
+        ],
+        [
+            60, 73, 142, 226, 0, 134, 72, 110, 138, 195, 66, 163, 232, 76, 236, 197, 119, 245, 33,
+            176, 176, 193, 191, 82, 93, 99, 200, 122, 214, 4, 106, 62,
+        ],
+        [
+            33, 168, 2, 134, 195, 243, 192, 108, 200, 39, 203, 209, 184, 80, 67, 36, 36, 133, 17,
+            84, 252, 62, 107, 24, 128, 56, 93, 32, 88, 187, 74, 20,
+        ],
+        [
+            219, 20, 232, 167, 231, 189, 251, 75, 141, 188, 40, 255, 113, 169, 75, 126, 51, 153,
+            150, 144, 3, 2, 48, 195, 95, 106, 157, 67, 187, 122, 83, 58,
+        ],
+        [
+            188, 190, 244, 180, 101, 55, 139, 190, 117, 226, 19, 119, 22, 66, 0, 180, 238, 67, 105,
+            113, 146, 196, 115, 38, 40, 228, 250, 123, 178, 244, 232, 50,
+        ],
+        [
+            128, 9, 198, 45, 101, 40, 185, 231, 79, 41, 73, 11, 16, 195, 192, 252, 134, 134, 140,
+            132, 52, 99, 62, 164, 180, 33, 52, 159, 66, 196, 79, 35,
+        ],
+    ],
+    [
+        [
+            10, 239, 94, 184, 118, 1, 158, 108, 158, 169, 76, 121, 236, 36, 25, 221, 105, 129, 115,
+            149, 209, 44, 31, 83, 91, 26, 78, 126, 255, 38, 25, 56,
+        ],
+        [
+            207, 84, 209, 233, 227, 197, 135, 68, 247, 42, 105, 196, 115, 52, 31, 57, 58, 7, 51,
+            12, 151, 197, 15, 178, 131, 83, 160, 90, 179, 238, 0, 1,
+        ],
+        [
+            88, 114, 54, 87, 151, 143, 109, 8, 32, 131, 174, 143, 36, 0, 241, 67, 69, 39, 183, 24,
+            46, 190, 165, 142, 35, 116, 35, 242, 200, 167, 172, 63,
+        ],
+        [
+            33, 70, 50, 238, 103, 165, 48, 92, 4, 221, 0, 157, 84, 240, 144, 240, 18, 63, 226, 1,
+            151, 3, 49, 247, 129, 248, 23, 106, 90, 166, 204, 44,
+        ],
+        [
+            106, 134, 57, 46, 200, 54, 110, 138, 86, 96, 6, 197, 4, 183, 174, 208, 239, 184, 201,
+            108, 12, 179, 36, 69, 218, 9, 165, 76, 112, 142, 76, 14,
+        ],
+        [
+            97, 3, 42, 225, 95, 159, 129, 254, 99, 46, 181, 184, 192, 3, 168, 169, 118, 8, 164, 8,
+            94, 203, 221, 208, 205, 41, 189, 179, 30, 177, 251, 44,
+        ],
+        [
+            53, 132, 132, 52, 92, 180, 183, 130, 219, 108, 144, 28, 118, 56, 255, 151, 102, 154,
+            205, 137, 43, 116, 29, 96, 143, 6, 143, 205, 163, 245, 106, 44,
+        ],
+        [
+            218, 157, 183, 63, 44, 213, 213, 83, 210, 222, 174, 20, 246, 248, 126, 87, 221, 23,
+            142, 136, 120, 246, 43, 32, 148, 58, 248, 160, 123, 58, 221, 12,
+        ],
+    ],
+    [
+        [
+            149, 137, 111, 83, 176, 241, 115, 102, 142, 224, 16, 10, 96, 228, 141, 172, 140, 55,
+            25, 116, 233, 91, 178, 226, 61, 228, 239, 3, 161, 147, 55, 0,
+        ],
+        [
+            224, 0, 124, 93, 127, 173, 200, 210, 76, 186, 63, 249, 145, 142, 191, 53, 164, 52, 12,
+            246, 5, 147, 5, 219, 84, 33, 67, 17, 12, 186, 56, 6,
+        ],
+        [
+            141, 150, 107, 181, 39, 27, 6, 86, 75, 78, 249, 120, 1, 70, 150, 239, 62, 91, 105, 27,
+            207, 74, 134, 102, 24, 119, 82, 203, 42, 91, 232, 27,
+        ],
+        [
+            98, 255, 117, 104, 87, 175, 148, 205, 89, 247, 46, 53, 8, 41, 74, 139, 233, 18, 235,
+            173, 199, 208, 211, 168, 2, 68, 169, 180, 164, 20, 97, 42,
+        ],
+        [
+            142, 31, 62, 232, 242, 54, 172, 213, 218, 45, 139, 176, 152, 33, 55, 113, 31, 236, 64,
+            163, 4, 159, 145, 68, 47, 187, 118, 126, 73, 172, 66, 51,
+        ],
+        [
+            177, 99, 95, 196, 0, 236, 92, 199, 227, 64, 111, 143, 71, 195, 178, 33, 230, 212, 13,
+            0, 88, 120, 166, 23, 56, 146, 248, 71, 64, 129, 231, 28,
+        ],
+        [
+            211, 107, 48, 102, 191, 222, 34, 82, 109, 123, 188, 56, 84, 50, 158, 35, 226, 179, 252,
+            12, 108, 246, 213, 136, 254, 116, 42, 71, 83, 167, 134, 38,
+        ],
+        [
+            60, 43, 191, 53, 154, 254, 231, 249, 60, 152, 183, 226, 99, 111, 57, 196, 8, 126, 203,
+            215, 228, 240, 139, 196, 74, 217, 66, 180, 5, 49, 10, 61,
+        ],
+    ],
+    [
+        [
+            20, 60, 106, 50, 215, 140, 210, 245, 242, 191, 232, 212, 151, 142, 214, 148, 65, 129,
+            147, 86, 16, 226, 222, 240, 178, 198, 208, 215, 155, 63, 153, 3,
+        ],
+        [
+            231, 76, 69, 20, 14, 9, 126, 164, 67, 97, 38, 101, 31, 238, 75, 208, 65, 146, 153, 62,
+            115, 249, 153, 193, 36, 89, 201, 158, 168, 83, 14, 3,
+        ],
+        [
+            172, 28, 102, 166, 48, 244, 128, 113, 84, 168, 154, 152, 71, 47, 14, 238, 173, 216,
+            173, 84, 87, 152, 229, 74, 214, 142, 86, 0, 218, 201, 76, 38,
+        ],
+        [
+            250, 251, 83, 44, 140, 74, 35, 121, 221, 192, 158, 22, 150, 145, 158, 182, 199, 58,
+            139, 95, 104, 115, 78, 251, 35, 114, 123, 157, 107, 127, 141, 2,
+        ],
+        [
+            15, 141, 54, 127, 192, 139, 29, 132, 103, 155, 18, 77, 69, 91, 246, 255, 11, 5, 164,
+            52, 118, 220, 215, 136, 109, 14, 70, 118, 147, 212, 180, 52,
+        ],
+        [
+            162, 34, 139, 38, 22, 144, 76, 40, 62, 100, 16, 96, 187, 133, 251, 207, 24, 229, 28,
+            15, 243, 126, 192, 49, 78, 19, 171, 244, 38, 152, 49, 48,
+        ],
+        [
+            156, 79, 249, 126, 214, 71, 52, 167, 23, 74, 34, 53, 116, 119, 101, 73, 139, 0, 214, 8,
+            165, 21, 237, 91, 41, 154, 105, 148, 158, 109, 86, 4,
+        ],
+        [
+            18, 190, 253, 27, 131, 121, 226, 105, 125, 62, 67, 179, 22, 245, 106, 80, 132, 191, 71,
+            72, 139, 255, 44, 115, 58, 245, 52, 70, 181, 3, 70, 21,
+        ],
+    ],
+    [
+        [
+            80, 124, 240, 232, 204, 160, 223, 47, 212, 70, 254, 52, 246, 144, 208, 188, 234, 135,
+            228, 159, 159, 194, 192, 107, 188, 57, 154, 163, 184, 53, 100, 44,
+        ],
+        [
+            75, 85, 94, 47, 222, 218, 25, 221, 103, 44, 223, 208, 96, 167, 80, 244, 3, 145, 108,
+            246, 106, 250, 68, 7, 167, 208, 175, 48, 117, 132, 62, 56,
+        ],
+        [
+            86, 43, 192, 127, 103, 49, 141, 242, 26, 223, 123, 81, 193, 204, 142, 184, 208, 72, 98,
+            101, 163, 68, 149, 183, 184, 29, 148, 26, 79, 89, 63, 7,
+        ],
+        [
+            13, 17, 229, 153, 40, 187, 221, 180, 216, 40, 169, 214, 113, 40, 104, 151, 96, 61, 225,
+            245, 220, 170, 198, 151, 134, 249, 146, 22, 49, 18, 117, 23,
+        ],
+        [
+            24, 160, 53, 180, 65, 171, 149, 169, 240, 40, 53, 91, 160, 6, 73, 4, 74, 136, 214, 119,
+            226, 139, 89, 65, 171, 116, 135, 48, 173, 31, 151, 21,
+        ],
+        [
+            87, 245, 10, 110, 108, 73, 107, 12, 238, 92, 189, 142, 60, 156, 208, 149, 246, 203,
+            116, 204, 81, 86, 83, 23, 216, 84, 14, 59, 69, 226, 129, 53,
+        ],
+        [
+            136, 212, 47, 189, 103, 45, 150, 40, 232, 21, 226, 251, 185, 20, 204, 133, 61, 33, 35,
+            12, 250, 121, 142, 19, 135, 13, 175, 97, 211, 151, 76, 59,
+        ],
+        [
+            94, 35, 203, 250, 198, 153, 2, 78, 51, 187, 241, 100, 16, 204, 18, 163, 4, 164, 181,
+            48, 70, 13, 140, 179, 246, 138, 46, 169, 239, 63, 83, 54,
+        ],
+    ],
+    [
+        [
+            196, 215, 172, 247, 59, 103, 86, 156, 251, 251, 189, 44, 121, 171, 238, 170, 90, 94,
+            229, 210, 2, 28, 116, 152, 175, 132, 150, 248, 247, 33, 93, 21,
+        ],
+        [
+            11, 90, 134, 193, 86, 130, 247, 159, 151, 103, 235, 179, 36, 64, 31, 5, 216, 136, 218,
+            242, 78, 34, 94, 97, 216, 226, 91, 32, 255, 21, 194, 8,
+        ],
+        [
+            90, 247, 208, 172, 150, 176, 5, 164, 130, 56, 121, 166, 192, 17, 147, 181, 227, 173,
+            129, 60, 164, 158, 107, 41, 196, 190, 42, 251, 119, 141, 10, 39,
+        ],
+        [
+            251, 222, 252, 102, 190, 25, 50, 11, 77, 246, 85, 34, 74, 50, 187, 142, 67, 52, 11,
+            106, 12, 141, 82, 182, 116, 253, 163, 140, 96, 98, 49, 24,
+        ],
+        [
+            8, 73, 143, 244, 252, 146, 102, 150, 89, 157, 174, 71, 145, 173, 140, 93, 252, 86, 188,
+            244, 50, 29, 20, 215, 83, 180, 168, 192, 50, 174, 135, 35,
+        ],
+        [
+            9, 29, 218, 176, 253, 21, 178, 210, 244, 103, 160, 163, 241, 203, 37, 18, 141, 143, 66,
+            247, 138, 118, 238, 64, 213, 141, 137, 207, 192, 146, 60, 16,
+        ],
+        [
+            23, 112, 67, 207, 126, 97, 125, 148, 105, 113, 57, 100, 159, 254, 187, 221, 179, 75,
+            84, 174, 136, 217, 67, 60, 52, 107, 254, 187, 54, 211, 173, 20,
+        ],
+        [
+            197, 164, 148, 248, 41, 239, 242, 160, 160, 121, 202, 77, 129, 207, 71, 251, 23, 90,
+            94, 78, 15, 206, 195, 162, 59, 131, 154, 91, 51, 112, 146, 20,
+        ],
+    ],
+    [
+        [
+            197, 194, 236, 107, 71, 31, 175, 12, 97, 227, 76, 119, 30, 218, 41, 255, 125, 91, 56,
+            190, 6, 1, 9, 248, 146, 9, 190, 14, 239, 199, 13, 35,
+        ],
+        [
+            26, 55, 245, 109, 77, 123, 10, 248, 62, 199, 41, 101, 47, 206, 8, 105, 156, 69, 125, 8,
+            50, 122, 23, 226, 145, 12, 219, 99, 67, 3, 191, 61,
+        ],
+        [
+            109, 119, 98, 22, 28, 134, 177, 75, 25, 239, 54, 177, 169, 132, 116, 64, 4, 126, 221,
+            82, 209, 126, 208, 215, 116, 246, 75, 215, 125, 163, 194, 7,
+        ],
+        [
+            206, 15, 193, 174, 47, 41, 191, 214, 49, 210, 206, 7, 100, 245, 30, 170, 116, 39, 148,
+            121, 53, 80, 201, 222, 6, 85, 55, 205, 72, 174, 6, 30,
+        ],
+        [
+            229, 61, 220, 101, 100, 229, 212, 61, 175, 75, 4, 139, 117, 135, 63, 236, 252, 252,
+            226, 155, 85, 116, 194, 245, 243, 209, 32, 159, 63, 234, 30, 37,
+        ],
+        [
+            101, 33, 62, 209, 69, 119, 42, 92, 72, 89, 169, 145, 81, 100, 138, 196, 41, 253, 17,
+            139, 60, 148, 139, 33, 255, 217, 8, 120, 230, 207, 192, 0,
+        ],
+        [
+            39, 245, 116, 42, 45, 45, 44, 76, 177, 117, 99, 172, 86, 59, 13, 153, 100, 22, 9, 34,
+            175, 154, 45, 229, 115, 193, 15, 182, 165, 125, 221, 1,
+        ],
+        [
+            31, 54, 118, 58, 10, 66, 64, 174, 93, 114, 215, 142, 4, 206, 248, 153, 215, 197, 227,
+            232, 157, 63, 47, 149, 123, 20, 49, 177, 74, 71, 82, 47,
+        ],
+    ],
+    [
+        [
+            101, 117, 124, 209, 188, 36, 221, 34, 18, 6, 100, 248, 247, 169, 215, 102, 222, 48, 63,
+            163, 182, 198, 83, 29, 203, 38, 22, 215, 118, 207, 177, 24,
+        ],
+        [
+            84, 130, 80, 94, 13, 54, 109, 181, 221, 55, 251, 15, 143, 19, 87, 37, 148, 115, 213,
+            160, 66, 83, 85, 162, 181, 179, 123, 17, 167, 247, 169, 37,
+        ],
+        [
+            48, 59, 190, 61, 155, 234, 182, 117, 7, 244, 103, 194, 137, 218, 193, 172, 133, 66,
+            223, 190, 111, 184, 35, 252, 102, 241, 89, 202, 143, 204, 240, 20,
+        ],
+        [
+            119, 50, 120, 161, 215, 33, 56, 98, 241, 90, 240, 196, 248, 176, 102, 160, 235, 212,
+            132, 151, 245, 11, 100, 223, 178, 133, 219, 85, 167, 246, 224, 21,
+        ],
+        [
+            229, 144, 255, 154, 253, 52, 218, 12, 50, 165, 137, 170, 99, 196, 224, 186, 205, 85,
+            190, 222, 118, 171, 254, 22, 7, 161, 255, 63, 75, 232, 3, 40,
+        ],
+        [
+            65, 180, 60, 254, 30, 123, 254, 166, 174, 240, 212, 209, 13, 250, 250, 250, 145, 169,
+            183, 194, 250, 165, 207, 148, 223, 58, 237, 44, 189, 216, 54, 42,
+        ],
+        [
+            226, 251, 98, 219, 120, 82, 25, 105, 66, 253, 36, 140, 6, 244, 78, 64, 192, 2, 213,
+            254, 215, 31, 221, 88, 6, 22, 221, 114, 145, 79, 29, 5,
+        ],
+        [
+            113, 197, 52, 189, 31, 251, 25, 215, 225, 220, 50, 184, 252, 46, 191, 8, 128, 233, 194,
+            71, 209, 60, 75, 190, 18, 160, 165, 185, 140, 84, 132, 54,
+        ],
+    ],
+    [
+        [
+            142, 77, 52, 88, 247, 15, 6, 176, 107, 248, 160, 21, 209, 145, 80, 129, 225, 111, 95,
+            237, 154, 77, 137, 253, 198, 71, 191, 114, 103, 5, 177, 39,
+        ],
+        [
+            100, 4, 219, 69, 66, 64, 242, 131, 146, 201, 195, 14, 122, 183, 133, 62, 93, 159, 223,
+            121, 254, 112, 235, 156, 41, 123, 165, 215, 129, 120, 57, 57,
+        ],
+        [
+            11, 207, 121, 20, 205, 231, 207, 28, 66, 107, 148, 129, 36, 231, 40, 57, 75, 223, 109,
+            181, 67, 177, 222, 11, 49, 217, 251, 164, 148, 153, 149, 7,
+        ],
+        [
+            162, 102, 217, 50, 109, 94, 110, 154, 241, 207, 28, 240, 23, 129, 206, 78, 234, 74,
+            156, 43, 11, 214, 17, 71, 48, 2, 64, 148, 241, 130, 185, 3,
+        ],
+        [
+            142, 69, 138, 197, 77, 73, 50, 67, 52, 165, 96, 106, 125, 213, 111, 77, 92, 113, 130,
+            95, 184, 18, 167, 102, 222, 99, 108, 45, 158, 82, 209, 35,
+        ],
+        [
+            87, 67, 165, 162, 27, 141, 113, 255, 161, 65, 129, 182, 154, 52, 53, 145, 58, 102, 217,
+            92, 230, 24, 189, 13, 111, 139, 65, 225, 173, 227, 67, 28,
+        ],
+        [
+            202, 80, 111, 163, 121, 60, 211, 55, 216, 58, 50, 109, 16, 57, 8, 8, 46, 72, 193, 153,
+            65, 167, 132, 192, 231, 21, 247, 69, 33, 20, 58, 23,
+        ],
+        [
+            249, 173, 126, 139, 157, 178, 129, 165, 40, 169, 0, 114, 71, 157, 88, 113, 122, 40,
+            191, 200, 72, 90, 5, 41, 121, 7, 152, 40, 85, 132, 39, 4,
+        ],
+    ],
+    [
+        [
+            199, 216, 114, 251, 140, 210, 175, 171, 220, 148, 69, 166, 128, 95, 74, 205, 248, 245,
+            19, 125, 233, 17, 142, 185, 113, 146, 57, 42, 0, 120, 198, 4,
+        ],
+        [
+            250, 9, 179, 31, 23, 73, 162, 25, 28, 253, 80, 9, 232, 137, 137, 43, 17, 241, 71, 178,
+            151, 218, 104, 93, 121, 153, 27, 40, 120, 219, 43, 47,
+        ],
+        [
+            23, 231, 27, 9, 75, 177, 179, 234, 202, 55, 195, 150, 120, 172, 62, 156, 183, 43, 84,
+            109, 173, 197, 148, 245, 133, 189, 127, 174, 82, 189, 115, 25,
+        ],
+        [
+            9, 143, 201, 210, 39, 51, 154, 239, 84, 93, 95, 93, 3, 91, 159, 65, 0, 98, 184, 97,
+            108, 24, 36, 170, 223, 25, 245, 14, 144, 196, 66, 47,
+        ],
+        [
+            94, 162, 20, 133, 117, 34, 246, 81, 24, 117, 207, 237, 217, 57, 146, 137, 143, 215,
+            159, 112, 85, 221, 211, 241, 61, 19, 20, 198, 223, 206, 104, 19,
+        ],
+        [
+            89, 188, 251, 72, 124, 111, 97, 181, 107, 226, 217, 177, 180, 22, 182, 252, 46, 174,
+            117, 232, 43, 159, 47, 17, 108, 190, 117, 228, 186, 121, 102, 56,
+        ],
+        [
+            243, 167, 49, 44, 140, 139, 230, 208, 31, 131, 170, 189, 192, 4, 203, 255, 24, 221,
+            194, 244, 109, 141, 22, 224, 138, 88, 234, 70, 99, 44, 158, 16,
+        ],
+        [
+            136, 211, 151, 83, 245, 38, 217, 39, 240, 140, 51, 223, 35, 33, 225, 23, 89, 102, 73,
+            255, 73, 0, 214, 171, 6, 199, 255, 162, 247, 240, 205, 26,
+        ],
+    ],
+    [
+        [
+            254, 77, 97, 198, 201, 60, 159, 34, 206, 67, 175, 168, 187, 6, 194, 218, 205, 50, 36,
+            161, 65, 69, 61, 160, 250, 92, 190, 125, 252, 88, 68, 25,
+        ],
+        [
+            133, 196, 181, 170, 255, 139, 126, 115, 14, 8, 201, 55, 127, 0, 78, 159, 174, 128, 246,
+            25, 157, 67, 55, 224, 177, 43, 162, 37, 70, 56, 4, 27,
+        ],
+        [
+            112, 166, 24, 255, 18, 180, 244, 235, 31, 244, 66, 170, 197, 32, 253, 64, 16, 184, 86,
+            163, 30, 235, 54, 178, 201, 177, 153, 71, 176, 227, 211, 26,
+        ],
+        [
+            151, 222, 230, 164, 11, 133, 141, 108, 118, 190, 234, 99, 15, 33, 229, 82, 88, 14, 9,
+            120, 72, 207, 4, 120, 64, 65, 41, 222, 46, 203, 18, 9,
+        ],
+        [
+            103, 80, 114, 196, 74, 31, 54, 48, 10, 95, 29, 137, 192, 2, 117, 62, 170, 67, 233, 14,
+            92, 90, 108, 161, 78, 71, 153, 237, 75, 227, 166, 5,
+        ],
+        [
+            212, 150, 143, 103, 12, 222, 171, 219, 8, 32, 230, 183, 124, 27, 227, 126, 179, 47,
+            222, 140, 182, 172, 225, 22, 227, 50, 79, 237, 228, 201, 201, 57,
+        ],
+        [
+            70, 84, 206, 124, 223, 76, 35, 210, 59, 152, 102, 132, 156, 238, 248, 117, 141, 11, 8,
+            13, 50, 184, 50, 10, 163, 255, 207, 54, 255, 18, 3, 15,
+        ],
+        [
+            6, 252, 192, 97, 81, 78, 102, 178, 50, 96, 125, 90, 116, 56, 139, 196, 202, 88, 121,
+            186, 27, 23, 112, 100, 105, 28, 30, 44, 39, 83, 71, 14,
+        ],
+    ],
+    [
+        [
+            251, 94, 232, 178, 20, 76, 56, 34, 195, 179, 50, 154, 255, 237, 147, 119, 150, 15, 199,
+            76, 170, 185, 174, 58, 52, 46, 50, 22, 155, 174, 2, 29,
+        ],
+        [
+            213, 156, 33, 83, 188, 31, 83, 136, 209, 126, 89, 13, 129, 191, 217, 248, 192, 156,
+            175, 74, 138, 54, 211, 158, 215, 21, 159, 116, 54, 167, 90, 3,
+        ],
+        [
+            144, 92, 139, 79, 131, 242, 162, 182, 206, 192, 184, 68, 136, 217, 253, 55, 94, 203,
+            200, 248, 114, 55, 235, 153, 179, 204, 123, 113, 118, 90, 213, 59,
+        ],
+        [
+            91, 135, 225, 99, 39, 50, 171, 68, 85, 153, 75, 163, 52, 245, 81, 102, 116, 162, 178,
+            207, 99, 156, 37, 226, 47, 164, 207, 174, 132, 132, 133, 60,
+        ],
+        [
+            54, 214, 3, 118, 0, 225, 55, 117, 205, 163, 115, 249, 200, 246, 140, 108, 76, 169, 50,
+            122, 155, 118, 18, 154, 88, 129, 196, 0, 233, 169, 115, 0,
+        ],
+        [
+            124, 176, 25, 175, 103, 157, 153, 64, 64, 22, 197, 54, 192, 232, 233, 212, 146, 16,
+            183, 52, 141, 90, 80, 128, 237, 67, 145, 229, 89, 9, 192, 46,
+        ],
+        [
+            213, 174, 134, 198, 210, 44, 68, 2, 36, 211, 34, 63, 65, 177, 47, 211, 85, 214, 83, 15,
+            158, 245, 58, 134, 23, 194, 25, 245, 254, 120, 158, 15,
+        ],
+        [
+            81, 6, 176, 10, 91, 61, 188, 113, 152, 41, 236, 6, 95, 20, 71, 148, 23, 21, 40, 26,
+            240, 110, 136, 133, 26, 121, 121, 214, 161, 97, 185, 30,
+        ],
+    ],
+    [
+        [
+            71, 167, 42, 102, 126, 239, 68, 9, 111, 196, 137, 241, 163, 6, 156, 107, 138, 134, 74,
+            132, 121, 33, 184, 172, 186, 130, 126, 62, 237, 118, 242, 26,
+        ],
+        [
+            130, 92, 111, 138, 18, 54, 180, 172, 235, 236, 195, 254, 31, 119, 107, 236, 128, 170,
+            143, 88, 90, 255, 23, 114, 193, 147, 139, 82, 215, 223, 190, 60,
+        ],
+        [
+            85, 115, 103, 249, 139, 252, 172, 223, 249, 30, 175, 150, 183, 241, 226, 250, 69, 42,
+            207, 248, 102, 215, 134, 31, 198, 184, 222, 211, 172, 176, 22, 10,
+        ],
+        [
+            124, 104, 228, 185, 245, 31, 226, 5, 192, 123, 102, 59, 179, 106, 171, 111, 10, 29, 79,
+            223, 174, 80, 224, 180, 71, 96, 52, 20, 213, 116, 245, 4,
+        ],
+        [
+            204, 7, 183, 204, 52, 91, 161, 202, 255, 249, 153, 146, 3, 171, 245, 206, 34, 133, 131,
+            3, 52, 31, 56, 253, 203, 81, 176, 126, 113, 38, 164, 52,
+        ],
+        [
+            170, 200, 186, 32, 27, 90, 197, 215, 251, 122, 225, 34, 45, 175, 154, 199, 161, 24,
+            103, 6, 195, 12, 138, 54, 210, 118, 197, 114, 60, 16, 192, 6,
+        ],
+        [
+            168, 15, 89, 40, 153, 35, 233, 107, 133, 214, 104, 196, 21, 161, 5, 77, 119, 71, 1,
+            140, 212, 160, 104, 252, 2, 166, 70, 57, 231, 28, 116, 4,
+        ],
+        [
+            228, 252, 183, 21, 218, 84, 226, 14, 150, 183, 222, 17, 159, 46, 189, 140, 36, 60, 42,
+            103, 42, 207, 72, 169, 51, 212, 213, 209, 67, 129, 17, 17,
+        ],
+    ],
+    [
+        [
+            229, 94, 4, 4, 255, 10, 228, 111, 228, 106, 39, 196, 52, 15, 132, 47, 69, 132, 17, 208,
+            13, 31, 167, 122, 184, 4, 212, 237, 111, 253, 11, 21,
+        ],
+        [
+            53, 100, 74, 54, 153, 221, 88, 228, 247, 9, 37, 119, 44, 212, 219, 189, 28, 56, 188,
+            198, 217, 1, 176, 232, 60, 123, 225, 127, 139, 193, 6, 31,
+        ],
+        [
+            186, 168, 160, 166, 117, 235, 200, 114, 87, 89, 231, 247, 221, 235, 74, 28, 189, 19,
+            28, 250, 46, 18, 120, 213, 193, 165, 126, 113, 134, 33, 32, 1,
+        ],
+        [
+            50, 59, 63, 152, 85, 72, 221, 20, 198, 176, 87, 118, 81, 128, 237, 174, 255, 75, 155,
+            53, 225, 109, 108, 226, 71, 88, 113, 119, 79, 43, 101, 38,
+        ],
+        [
+            247, 92, 39, 118, 214, 109, 43, 18, 244, 113, 180, 251, 7, 111, 140, 206, 180, 97, 232,
+            118, 86, 133, 251, 155, 26, 165, 139, 163, 215, 90, 77, 32,
+        ],
+        [
+            149, 133, 199, 150, 17, 179, 149, 210, 101, 143, 83, 108, 98, 253, 84, 88, 141, 25,
+            138, 95, 17, 3, 61, 100, 3, 78, 192, 208, 117, 129, 2, 6,
+        ],
+        [
+            91, 178, 133, 154, 63, 174, 196, 94, 152, 232, 192, 125, 37, 28, 44, 110, 38, 62, 21,
+            218, 235, 32, 32, 202, 98, 230, 161, 4, 128, 239, 125, 12,
+        ],
+        [
+            151, 89, 41, 182, 150, 178, 27, 24, 82, 77, 206, 134, 252, 28, 50, 228, 213, 182, 197,
+            209, 49, 213, 175, 72, 189, 253, 249, 88, 108, 236, 168, 58,
+        ],
+    ],
+    [
+        [
+            38, 21, 85, 239, 52, 220, 50, 246, 95, 229, 244, 243, 173, 123, 102, 19, 164, 131, 228,
+            132, 241, 24, 151, 136, 224, 25, 54, 189, 80, 222, 246, 22,
+        ],
+        [
+            244, 175, 133, 128, 140, 88, 63, 118, 85, 87, 53, 206, 87, 43, 61, 129, 118, 243, 9,
+            191, 248, 248, 70, 141, 80, 49, 149, 101, 197, 108, 2, 16,
+        ],
+        [
+            228, 89, 135, 108, 54, 96, 202, 77, 40, 125, 27, 170, 68, 170, 35, 209, 21, 253, 54,
+            24, 198, 125, 164, 90, 226, 96, 191, 107, 23, 182, 237, 44,
+        ],
+        [
+            60, 224, 131, 3, 20, 51, 245, 142, 136, 95, 102, 66, 216, 168, 75, 59, 218, 9, 12, 179,
+            110, 203, 136, 209, 124, 209, 123, 238, 155, 141, 119, 30,
+        ],
+        [
+            56, 124, 170, 94, 110, 39, 171, 145, 126, 39, 53, 218, 222, 52, 177, 152, 181, 192, 92,
+            212, 138, 130, 233, 100, 78, 160, 236, 36, 101, 9, 253, 47,
+        ],
+        [
+            73, 38, 150, 82, 121, 254, 45, 212, 3, 18, 24, 130, 113, 56, 74, 110, 9, 206, 34, 91,
+            223, 241, 108, 114, 238, 211, 171, 30, 137, 150, 59, 0,
+        ],
+        [
+            72, 66, 80, 129, 28, 93, 228, 162, 207, 163, 104, 93, 73, 170, 53, 116, 34, 97, 34, 28,
+            147, 33, 119, 42, 3, 2, 144, 113, 205, 233, 98, 6,
+        ],
+        [
+            152, 136, 201, 11, 112, 141, 110, 36, 28, 222, 78, 38, 88, 212, 172, 192, 168, 212,
+            248, 176, 243, 215, 39, 54, 166, 119, 60, 182, 84, 44, 132, 1,
+        ],
+    ],
+    [
+        [
+            166, 20, 55, 181, 238, 166, 209, 247, 197, 203, 233, 189, 89, 232, 139, 118, 203, 26,
+            245, 159, 234, 187, 122, 104, 95, 200, 221, 233, 216, 232, 137, 44,
+        ],
+        [
+            149, 226, 202, 252, 150, 254, 162, 47, 186, 188, 250, 215, 65, 25, 65, 199, 156, 231,
+            254, 234, 86, 188, 133, 32, 37, 32, 138, 174, 186, 151, 23, 59,
+        ],
+        [
+            123, 18, 173, 246, 115, 145, 29, 164, 82, 83, 79, 117, 140, 85, 179, 255, 80, 78, 124,
+            154, 179, 168, 22, 216, 87, 39, 12, 224, 219, 14, 237, 47,
+        ],
+        [
+            198, 76, 74, 220, 44, 216, 61, 154, 238, 101, 198, 27, 202, 26, 80, 54, 22, 209, 105,
+            210, 163, 61, 69, 57, 165, 232, 132, 92, 116, 105, 213, 62,
+        ],
+        [
+            184, 32, 212, 62, 67, 44, 136, 203, 226, 214, 152, 150, 241, 162, 174, 69, 254, 15, 17,
+            28, 234, 162, 154, 43, 55, 57, 48, 146, 13, 170, 146, 36,
+        ],
+        [
+            40, 10, 127, 190, 248, 155, 217, 21, 147, 185, 101, 235, 133, 96, 152, 7, 89, 74, 127,
+            120, 205, 71, 181, 117, 141, 158, 100, 225, 86, 35, 84, 30,
+        ],
+        [
+            59, 0, 26, 9, 117, 171, 252, 142, 194, 159, 19, 148, 53, 2, 243, 200, 116, 95, 59, 43,
+            156, 118, 8, 146, 31, 235, 125, 67, 226, 193, 192, 14,
+        ],
+        [
+            152, 174, 144, 126, 124, 71, 171, 85, 237, 165, 158, 214, 209, 62, 250, 85, 162, 49,
+            129, 79, 191, 21, 192, 223, 222, 118, 173, 150, 164, 212, 184, 41,
+        ],
+    ],
+    [
+        [
+            217, 100, 143, 202, 28, 1, 60, 244, 252, 12, 56, 235, 162, 250, 194, 0, 158, 25, 148,
+            62, 226, 184, 144, 86, 154, 54, 77, 122, 47, 47, 37, 47,
+        ],
+        [
+            202, 69, 190, 148, 247, 74, 31, 98, 96, 125, 31, 19, 13, 131, 46, 232, 247, 75, 226,
+            211, 35, 173, 66, 190, 8, 160, 57, 35, 181, 203, 33, 57,
+        ],
+        [
+            105, 168, 39, 76, 17, 201, 8, 85, 160, 1, 108, 17, 65, 17, 143, 13, 26, 237, 93, 205,
+            40, 188, 41, 247, 82, 200, 105, 236, 20, 96, 99, 16,
+        ],
+        [
+            8, 225, 80, 33, 92, 253, 80, 149, 76, 124, 194, 200, 247, 158, 230, 212, 154, 151, 45,
+            60, 189, 91, 94, 248, 13, 166, 178, 71, 207, 40, 252, 34,
+        ],
+        [
+            112, 102, 155, 6, 178, 250, 238, 207, 237, 193, 217, 248, 147, 24, 131, 76, 225, 178,
+            237, 111, 231, 44, 13, 218, 28, 166, 69, 107, 158, 18, 239, 14,
+        ],
+        [
+            9, 175, 91, 204, 143, 242, 215, 115, 39, 213, 85, 208, 155, 76, 228, 114, 126, 170,
+            228, 103, 118, 64, 196, 226, 35, 184, 202, 195, 205, 36, 213, 24,
+        ],
+        [
+            121, 166, 135, 131, 76, 123, 114, 93, 221, 160, 197, 146, 126, 212, 52, 241, 95, 56,
+            127, 65, 155, 66, 25, 216, 43, 42, 163, 49, 131, 212, 76, 7,
+        ],
+        [
+            99, 210, 39, 55, 89, 68, 174, 153, 25, 69, 37, 70, 180, 15, 215, 92, 30, 95, 85, 74,
+            115, 111, 15, 166, 74, 203, 79, 168, 21, 176, 80, 27,
+        ],
+    ],
+    [
+        [
+            57, 146, 226, 221, 107, 225, 126, 141, 182, 27, 144, 50, 73, 165, 21, 228, 91, 125, 53,
+            198, 13, 183, 251, 163, 208, 52, 135, 192, 136, 144, 143, 33,
+        ],
+        [
+            123, 7, 46, 76, 70, 183, 31, 50, 102, 73, 52, 69, 42, 212, 19, 239, 207, 121, 226, 48,
+            7, 124, 101, 156, 27, 108, 250, 115, 203, 80, 158, 54,
+        ],
+        [
+            105, 12, 215, 144, 236, 236, 57, 169, 134, 16, 123, 228, 143, 246, 201, 34, 194, 94,
+            87, 66, 109, 43, 155, 104, 47, 0, 200, 97, 218, 162, 17, 13,
+        ],
+        [
+            124, 237, 179, 116, 163, 119, 114, 172, 236, 205, 105, 103, 1, 74, 29, 243, 205, 244,
+            232, 249, 52, 251, 59, 108, 46, 186, 212, 23, 85, 250, 38, 2,
+        ],
+        [
+            169, 136, 44, 150, 8, 97, 227, 243, 193, 218, 181, 203, 176, 162, 70, 93, 239, 130,
+            230, 67, 9, 57, 26, 124, 59, 229, 159, 92, 24, 98, 77, 53,
+        ],
+        [
+            81, 1, 244, 212, 4, 189, 139, 212, 63, 219, 239, 218, 254, 209, 167, 118, 214, 108, 63,
+            241, 3, 215, 184, 41, 148, 192, 183, 121, 48, 82, 1, 25,
+        ],
+        [
+            77, 157, 101, 207, 121, 249, 208, 27, 219, 162, 235, 48, 152, 43, 15, 71, 93, 19, 134,
+            30, 228, 115, 246, 243, 146, 135, 193, 55, 199, 21, 26, 58,
+        ],
+        [
+            158, 13, 107, 51, 93, 172, 190, 196, 224, 143, 126, 198, 215, 92, 139, 136, 230, 209,
+            26, 247, 99, 138, 255, 219, 115, 248, 137, 42, 148, 138, 164, 35,
+        ],
+    ],
+    [
+        [
+            144, 129, 1, 246, 175, 28, 39, 247, 112, 135, 137, 167, 136, 48, 66, 164, 151, 73, 8,
+            241, 210, 54, 55, 165, 84, 252, 199, 16, 160, 37, 145, 23,
+        ],
+        [
+            192, 125, 70, 179, 34, 242, 184, 201, 4, 245, 132, 241, 154, 195, 44, 156, 117, 250,
+            176, 65, 83, 229, 1, 161, 53, 116, 194, 235, 72, 95, 130, 10,
+        ],
+        [
+            228, 8, 155, 222, 133, 218, 125, 194, 220, 72, 46, 118, 157, 179, 153, 160, 190, 219,
+            166, 145, 183, 114, 184, 90, 206, 47, 43, 46, 190, 180, 243, 14,
+        ],
+        [
+            144, 1, 212, 200, 34, 67, 61, 193, 101, 41, 199, 112, 121, 197, 30, 248, 172, 240, 1,
+            23, 210, 116, 54, 82, 203, 153, 141, 24, 223, 253, 48, 25,
+        ],
+        [
+            97, 162, 113, 178, 80, 172, 128, 13, 18, 247, 1, 132, 162, 145, 152, 16, 26, 44, 104,
+            137, 200, 140, 57, 188, 181, 173, 186, 77, 241, 70, 103, 62,
+        ],
+        [
+            98, 180, 95, 72, 251, 169, 134, 210, 225, 93, 191, 188, 89, 165, 113, 10, 20, 55, 249,
+            100, 231, 105, 100, 74, 66, 30, 50, 169, 116, 236, 28, 25,
+        ],
+        [
+            106, 166, 231, 140, 101, 154, 108, 162, 240, 137, 97, 132, 90, 169, 10, 153, 166, 136,
+            135, 146, 102, 93, 177, 86, 64, 92, 168, 72, 31, 104, 20, 33,
+        ],
+        [
+            188, 211, 184, 142, 84, 192, 128, 168, 155, 47, 14, 126, 83, 126, 152, 130, 211, 224,
+            8, 217, 108, 82, 178, 193, 83, 42, 129, 40, 74, 255, 26, 21,
+        ],
+    ],
+    [
+        [
+            27, 111, 120, 34, 70, 220, 74, 211, 225, 132, 62, 224, 106, 147, 107, 170, 65, 245,
+            126, 162, 179, 236, 82, 239, 235, 57, 126, 146, 208, 181, 25, 25,
+        ],
+        [
+            67, 51, 145, 136, 236, 14, 221, 242, 49, 186, 236, 69, 247, 188, 190, 22, 49, 49, 193,
+            147, 62, 22, 207, 31, 233, 100, 182, 124, 70, 69, 83, 19,
+        ],
+        [
+            25, 40, 159, 124, 230, 217, 113, 135, 193, 155, 204, 66, 147, 111, 238, 31, 231, 110,
+            72, 68, 189, 205, 241, 130, 156, 50, 58, 137, 248, 179, 113, 34,
+        ],
+        [
+            199, 7, 17, 175, 48, 117, 199, 19, 50, 252, 37, 72, 70, 122, 69, 90, 19, 57, 128, 68,
+            235, 160, 101, 40, 62, 245, 236, 132, 63, 145, 10, 11,
+        ],
+        [
+            238, 244, 156, 113, 5, 156, 173, 22, 95, 73, 65, 155, 53, 223, 225, 255, 58, 104, 112,
+            89, 167, 166, 114, 249, 45, 217, 195, 168, 12, 31, 14, 5,
+        ],
+        [
+            168, 30, 153, 147, 149, 139, 195, 4, 163, 70, 46, 36, 180, 109, 86, 197, 142, 11, 142,
+            250, 72, 198, 51, 173, 202, 162, 153, 85, 2, 145, 110, 10,
+        ],
+        [
+            36, 27, 187, 193, 56, 99, 159, 134, 253, 3, 229, 231, 249, 147, 129, 252, 156, 85, 84,
+            57, 241, 140, 251, 174, 135, 138, 176, 221, 73, 222, 159, 14,
+        ],
+        [
+            206, 186, 15, 163, 104, 0, 19, 188, 128, 226, 81, 186, 190, 214, 39, 110, 123, 9, 147,
+            66, 66, 64, 78, 14, 58, 49, 165, 149, 192, 4, 67, 13,
+        ],
+    ],
+    [
+        [
+            32, 250, 229, 202, 183, 206, 20, 75, 220, 120, 12, 190, 111, 12, 98, 111, 61, 146, 165,
+            166, 133, 60, 94, 136, 61, 223, 154, 129, 90, 109, 230, 10,
+        ],
+        [
+            147, 107, 125, 22, 133, 54, 201, 8, 20, 118, 236, 210, 106, 113, 137, 34, 237, 206,
+            128, 160, 184, 214, 23, 43, 145, 48, 157, 54, 59, 100, 162, 8,
+        ],
+        [
+            13, 212, 17, 152, 59, 216, 167, 254, 78, 26, 36, 129, 32, 206, 173, 158, 23, 4, 56,
+            205, 192, 12, 1, 27, 227, 234, 12, 233, 104, 82, 182, 61,
+        ],
+        [
+            7, 17, 169, 161, 14, 21, 162, 94, 106, 66, 217, 14, 218, 63, 127, 131, 90, 30, 175,
+            208, 7, 209, 226, 5, 137, 240, 116, 204, 192, 76, 138, 51,
+        ],
+        [
+            190, 206, 82, 115, 96, 94, 88, 62, 148, 244, 93, 133, 55, 16, 9, 115, 17, 170, 88, 254,
+            150, 87, 214, 42, 60, 43, 247, 235, 111, 159, 60, 42,
+        ],
+        [
+            253, 2, 221, 158, 160, 73, 222, 22, 213, 157, 119, 31, 16, 236, 85, 113, 78, 159, 158,
+            85, 126, 31, 31, 136, 220, 205, 114, 13, 54, 102, 96, 10,
+        ],
+        [
+            11, 138, 36, 180, 3, 0, 209, 232, 70, 200, 182, 250, 148, 237, 249, 181, 32, 214, 7,
+            223, 165, 74, 141, 2, 237, 247, 107, 67, 252, 175, 58, 44,
+        ],
+        [
+            228, 122, 212, 211, 34, 224, 37, 28, 89, 232, 71, 201, 243, 32, 242, 117, 54, 221, 62,
+            243, 217, 189, 0, 215, 68, 28, 192, 112, 142, 49, 211, 12,
+        ],
+    ],
+    [
+        [
+            146, 43, 218, 86, 28, 225, 144, 208, 46, 241, 190, 206, 28, 110, 180, 198, 132, 130,
+            253, 202, 21, 111, 227, 246, 195, 55, 14, 125, 40, 137, 176, 30,
+        ],
+        [
+            95, 71, 151, 226, 250, 85, 113, 233, 79, 7, 178, 203, 58, 47, 152, 144, 214, 1, 202,
+            245, 234, 85, 58, 45, 235, 255, 6, 174, 119, 7, 46, 30,
+        ],
+        [
+            164, 42, 64, 130, 86, 86, 18, 10, 84, 13, 223, 98, 150, 57, 219, 189, 41, 25, 54, 97,
+            151, 202, 192, 203, 75, 104, 152, 221, 238, 70, 27, 45,
+        ],
+        [
+            127, 13, 100, 237, 255, 54, 232, 43, 143, 73, 168, 109, 176, 49, 8, 120, 57, 130, 244,
+            217, 26, 122, 135, 110, 64, 85, 16, 224, 79, 231, 138, 62,
+        ],
+        [
+            194, 131, 166, 241, 159, 28, 76, 114, 253, 239, 213, 220, 254, 100, 77, 64, 91, 238,
+            87, 44, 36, 163, 148, 132, 32, 1, 178, 89, 210, 240, 134, 48,
+        ],
+        [
+            123, 225, 66, 102, 92, 204, 94, 145, 164, 245, 23, 107, 190, 226, 54, 77, 213, 179,
+            125, 75, 186, 59, 70, 150, 179, 74, 227, 71, 147, 60, 139, 16,
+        ],
+        [
+            39, 243, 105, 150, 174, 74, 30, 84, 233, 29, 218, 218, 73, 42, 20, 214, 172, 15, 236,
+            147, 47, 157, 17, 153, 87, 209, 198, 9, 91, 84, 88, 35,
+        ],
+        [
+            45, 154, 254, 153, 15, 16, 141, 166, 168, 13, 22, 76, 212, 147, 189, 192, 47, 5, 41,
+            249, 28, 251, 60, 130, 52, 148, 200, 198, 95, 188, 221, 30,
+        ],
+    ],
+    [
+        [
+            107, 243, 152, 171, 58, 95, 246, 5, 41, 34, 30, 145, 136, 116, 75, 1, 3, 253, 5, 12,
+            117, 143, 210, 29, 168, 141, 105, 141, 77, 72, 157, 45,
+        ],
+        [
+            35, 114, 206, 37, 84, 242, 230, 119, 141, 159, 167, 71, 206, 102, 55, 140, 204, 137,
+            151, 85, 36, 29, 196, 49, 40, 43, 108, 83, 211, 90, 13, 33,
+        ],
+        [
+            15, 177, 11, 152, 142, 9, 201, 105, 21, 183, 41, 239, 124, 235, 47, 81, 143, 50, 62,
+            229, 121, 136, 146, 46, 59, 244, 139, 24, 170, 178, 240, 19,
+        ],
+        [
+            165, 123, 207, 244, 153, 87, 143, 86, 122, 246, 136, 169, 101, 176, 217, 9, 5, 212,
+            168, 27, 145, 3, 197, 154, 62, 69, 109, 182, 149, 23, 91, 21,
+        ],
+        [
+            189, 137, 178, 165, 178, 87, 211, 192, 102, 167, 225, 100, 139, 160, 16, 87, 22, 204,
+            105, 99, 131, 153, 108, 49, 34, 187, 49, 6, 185, 187, 30, 43,
+        ],
+        [
+            27, 145, 78, 59, 46, 36, 132, 75, 120, 159, 51, 37, 37, 192, 108, 126, 73, 189, 174,
+            82, 29, 111, 65, 80, 154, 218, 41, 64, 68, 29, 165, 30,
+        ],
+        [
+            98, 187, 214, 47, 4, 74, 164, 184, 225, 129, 120, 133, 86, 231, 75, 237, 176, 49, 53,
+            169, 90, 4, 18, 9, 167, 71, 22, 156, 13, 39, 15, 3,
+        ],
+        [
+            112, 124, 173, 252, 97, 191, 76, 94, 83, 160, 143, 31, 249, 204, 154, 11, 144, 153, 84,
+            26, 22, 65, 50, 243, 26, 43, 2, 117, 66, 61, 109, 33,
+        ],
+    ],
+    [
+        [
+            48, 179, 105, 154, 137, 101, 207, 31, 159, 178, 200, 35, 0, 58, 168, 178, 174, 225, 29,
+            180, 161, 43, 109, 228, 221, 204, 109, 67, 166, 195, 179, 63,
+        ],
+        [
+            192, 220, 245, 60, 113, 224, 39, 140, 250, 15, 194, 10, 179, 68, 226, 120, 139, 19, 98,
+            15, 83, 170, 245, 23, 120, 70, 92, 174, 64, 64, 106, 61,
+        ],
+        [
+            224, 5, 162, 145, 63, 125, 41, 116, 214, 111, 234, 50, 80, 95, 211, 97, 214, 145, 238,
+            22, 96, 42, 196, 79, 43, 20, 88, 179, 203, 22, 113, 46,
+        ],
+        [
+            213, 81, 107, 202, 117, 25, 111, 182, 105, 138, 27, 113, 154, 75, 57, 246, 246, 83, 99,
+            217, 179, 112, 69, 133, 173, 21, 93, 29, 205, 161, 76, 60,
+        ],
+        [
+            53, 44, 98, 79, 115, 175, 162, 136, 175, 194, 206, 120, 151, 114, 188, 68, 142, 30, 96,
+            184, 78, 24, 83, 6, 158, 185, 44, 71, 0, 93, 104, 0,
+        ],
+        [
+            250, 21, 67, 252, 44, 115, 18, 82, 222, 64, 36, 75, 249, 107, 180, 166, 243, 36, 0,
+            117, 175, 185, 120, 145, 155, 116, 188, 143, 17, 46, 165, 56,
+        ],
+        [
+            241, 212, 155, 63, 65, 50, 226, 122, 207, 162, 225, 154, 169, 53, 14, 221, 96, 76, 136,
+            178, 90, 164, 121, 103, 108, 127, 54, 163, 96, 85, 77, 6,
+        ],
+        [
+            19, 175, 186, 97, 92, 236, 91, 61, 140, 4, 133, 53, 194, 213, 65, 250, 230, 238, 235,
+            203, 46, 65, 35, 16, 182, 249, 176, 229, 175, 138, 30, 25,
+        ],
+    ],
+    [
+        [
+            193, 173, 135, 142, 136, 208, 142, 206, 234, 104, 90, 172, 21, 141, 16, 215, 245, 110,
+            59, 172, 92, 70, 107, 247, 27, 166, 143, 181, 155, 250, 106, 53,
+        ],
+        [
+            40, 195, 37, 64, 237, 12, 144, 62, 106, 178, 195, 117, 222, 163, 229, 91, 210, 2, 145,
+            237, 136, 209, 62, 140, 230, 8, 101, 56, 25, 178, 213, 58,
+        ],
+        [
+            101, 129, 170, 93, 188, 56, 112, 107, 211, 10, 183, 62, 68, 200, 64, 130, 73, 142, 202,
+            103, 69, 40, 144, 172, 242, 250, 22, 131, 198, 103, 108, 58,
+        ],
+        [
+            194, 190, 28, 152, 159, 2, 136, 216, 228, 235, 50, 39, 214, 18, 140, 207, 80, 219, 220,
+            101, 153, 79, 16, 105, 188, 49, 203, 108, 66, 225, 90, 59,
+        ],
+        [
+            153, 64, 128, 222, 2, 153, 45, 105, 116, 220, 68, 127, 162, 151, 86, 187, 167, 170, 11,
+            233, 28, 199, 145, 241, 243, 234, 10, 120, 92, 219, 209, 43,
+        ],
+        [
+            50, 89, 222, 249, 125, 86, 27, 111, 222, 37, 116, 131, 25, 18, 181, 68, 48, 103, 126,
+            135, 57, 250, 15, 250, 177, 17, 31, 129, 239, 252, 162, 28,
+        ],
+        [
+            114, 163, 205, 167, 236, 34, 31, 190, 190, 105, 34, 205, 130, 240, 231, 205, 50, 231,
+            88, 79, 27, 132, 231, 176, 11, 46, 129, 157, 254, 249, 246, 15,
+        ],
+        [
+            93, 238, 47, 126, 190, 204, 194, 137, 218, 143, 52, 16, 199, 227, 130, 21, 153, 75,
+            233, 47, 222, 61, 182, 45, 223, 200, 222, 178, 182, 170, 228, 31,
+        ],
+    ],
+    [
+        [
+            12, 17, 186, 64, 81, 161, 220, 198, 174, 199, 6, 92, 215, 23, 232, 34, 246, 12, 107,
+            125, 15, 107, 2, 242, 20, 8, 246, 125, 121, 99, 80, 3,
+        ],
+        [
+            89, 57, 179, 171, 146, 205, 229, 64, 221, 171, 206, 90, 241, 174, 37, 148, 197, 159,
+            18, 100, 219, 205, 52, 254, 192, 164, 85, 30, 65, 213, 210, 54,
+        ],
+        [
+            62, 137, 99, 6, 120, 112, 106, 227, 209, 75, 212, 194, 210, 14, 2, 30, 195, 242, 218,
+            76, 57, 40, 167, 185, 142, 96, 69, 77, 167, 67, 209, 9,
+        ],
+        [
+            180, 9, 228, 211, 34, 32, 178, 132, 120, 119, 122, 62, 191, 119, 141, 172, 218, 172,
+            109, 180, 94, 64, 162, 121, 52, 14, 121, 66, 59, 109, 245, 59,
+        ],
+        [
+            249, 3, 248, 71, 44, 145, 178, 67, 137, 38, 251, 235, 157, 68, 254, 171, 27, 162, 133,
+            219, 234, 216, 112, 152, 25, 58, 135, 251, 66, 71, 156, 26,
+        ],
+        [
+            95, 35, 211, 78, 202, 25, 45, 202, 135, 35, 113, 93, 165, 64, 194, 144, 175, 17, 228,
+            210, 224, 254, 58, 112, 227, 81, 126, 97, 86, 65, 29, 62,
+        ],
+        [
+            221, 226, 149, 102, 167, 18, 52, 77, 5, 186, 64, 11, 100, 216, 208, 10, 248, 189, 34,
+            212, 242, 213, 9, 142, 115, 97, 101, 65, 220, 76, 136, 18,
+        ],
+        [
+            46, 234, 59, 13, 34, 48, 213, 65, 235, 58, 247, 80, 169, 39, 199, 103, 208, 23, 231,
+            159, 190, 5, 184, 75, 56, 226, 248, 207, 69, 148, 211, 39,
+        ],
+    ],
+    [
+        [
+            32, 230, 133, 110, 165, 142, 6, 236, 172, 169, 47, 58, 149, 196, 9, 122, 18, 15, 198,
+            9, 254, 57, 37, 7, 223, 227, 136, 12, 203, 242, 43, 24,
+        ],
+        [
+            42, 147, 110, 109, 50, 65, 17, 222, 30, 153, 56, 60, 204, 134, 182, 170, 16, 57, 253,
+            161, 24, 121, 0, 24, 141, 195, 159, 253, 145, 154, 147, 9,
+        ],
+        [
+            14, 162, 52, 18, 158, 156, 230, 183, 175, 194, 121, 255, 238, 127, 155, 250, 246, 125,
+            169, 227, 72, 68, 0, 27, 232, 41, 17, 161, 76, 66, 20, 53,
+        ],
+        [
+            50, 22, 182, 33, 162, 102, 95, 212, 128, 44, 7, 71, 26, 32, 114, 117, 49, 127, 40, 178,
+            231, 245, 1, 106, 238, 134, 100, 231, 254, 238, 176, 5,
+        ],
+        [
+            50, 237, 91, 136, 123, 1, 96, 84, 250, 240, 150, 12, 248, 226, 90, 37, 68, 177, 48,
+            242, 94, 102, 174, 114, 222, 126, 153, 41, 195, 54, 126, 56,
+        ],
+        [
+            133, 193, 10, 246, 10, 82, 239, 122, 163, 93, 110, 94, 60, 44, 177, 207, 189, 174, 87,
+            89, 69, 129, 226, 121, 140, 169, 190, 105, 76, 58, 86, 8,
+        ],
+        [
+            23, 43, 215, 223, 60, 59, 224, 124, 151, 95, 219, 161, 57, 159, 207, 111, 242, 135, 40,
+            239, 253, 77, 19, 184, 64, 186, 150, 176, 66, 238, 67, 40,
+        ],
+        [
+            126, 167, 187, 171, 240, 55, 84, 223, 134, 218, 13, 244, 77, 58, 112, 57, 26, 208, 108,
+            78, 36, 188, 140, 87, 207, 217, 22, 144, 157, 20, 32, 54,
+        ],
+    ],
+    [
+        [
+            93, 37, 10, 228, 50, 61, 16, 189, 13, 195, 139, 25, 160, 47, 200, 124, 186, 134, 98,
+            124, 16, 208, 15, 234, 76, 94, 7, 231, 28, 219, 8, 55,
+        ],
+        [
+            240, 37, 251, 82, 107, 129, 109, 226, 56, 158, 226, 245, 117, 81, 14, 88, 89, 159, 94,
+            112, 221, 109, 148, 109, 96, 111, 107, 193, 65, 177, 88, 61,
+        ],
+        [
+            66, 195, 4, 90, 120, 185, 19, 112, 65, 178, 63, 160, 49, 116, 10, 220, 176, 189, 95,
+            102, 60, 97, 194, 253, 126, 162, 104, 217, 4, 50, 147, 37,
+        ],
+        [
+            238, 163, 121, 161, 177, 233, 63, 78, 235, 119, 237, 197, 121, 164, 83, 212, 6, 208,
+            230, 24, 249, 141, 95, 163, 28, 102, 175, 11, 75, 81, 160, 0,
+        ],
+        [
+            229, 143, 0, 254, 88, 138, 193, 137, 148, 92, 219, 194, 181, 122, 207, 15, 16, 193,
+            188, 217, 68, 31, 11, 158, 167, 27, 64, 136, 203, 117, 161, 12,
+        ],
+        [
+            11, 49, 214, 250, 109, 158, 144, 42, 1, 206, 122, 94, 165, 157, 202, 213, 96, 180, 33,
+            20, 22, 177, 7, 163, 28, 139, 104, 251, 198, 9, 214, 33,
+        ],
+        [
+            116, 243, 168, 236, 137, 191, 154, 52, 41, 230, 77, 98, 8, 184, 250, 38, 141, 230, 158,
+            5, 39, 9, 89, 103, 230, 79, 166, 50, 205, 4, 255, 57,
+        ],
+        [
+            48, 98, 65, 66, 216, 38, 51, 172, 142, 86, 116, 5, 120, 215, 156, 152, 106, 238, 101,
+            242, 53, 120, 56, 97, 38, 217, 38, 74, 226, 28, 214, 1,
+        ],
+    ],
+    [
+        [
+            105, 231, 75, 196, 42, 78, 208, 145, 101, 74, 247, 42, 206, 96, 9, 165, 101, 89, 102,
+            246, 47, 7, 215, 185, 122, 16, 186, 27, 10, 246, 28, 23,
+        ],
+        [
+            217, 126, 103, 98, 167, 172, 142, 251, 248, 148, 70, 136, 6, 254, 190, 127, 239, 148,
+            0, 199, 6, 165, 124, 27, 43, 237, 41, 234, 88, 83, 203, 32,
+        ],
+        [
+            107, 239, 45, 27, 57, 6, 26, 100, 184, 166, 49, 44, 51, 34, 71, 119, 233, 175, 17, 249,
+            180, 107, 41, 96, 188, 234, 154, 63, 206, 106, 120, 38,
+        ],
+        [
+            18, 121, 183, 245, 156, 149, 212, 126, 222, 16, 47, 234, 70, 173, 22, 213, 183, 77, 82,
+            53, 36, 126, 75, 154, 210, 154, 27, 140, 64, 60, 177, 57,
+        ],
+        [
+            129, 228, 124, 136, 140, 181, 45, 123, 137, 7, 141, 185, 55, 235, 55, 18, 222, 8, 68,
+            17, 115, 177, 15, 70, 229, 2, 114, 211, 234, 30, 197, 41,
+        ],
+        [
+            228, 45, 55, 6, 192, 96, 178, 131, 218, 145, 217, 97, 91, 39, 160, 64, 227, 19, 66,
+            189, 251, 188, 240, 67, 146, 48, 200, 76, 18, 250, 8, 30,
+        ],
+        [
+            220, 15, 205, 81, 21, 46, 62, 121, 239, 193, 97, 108, 94, 74, 148, 33, 244, 134, 30,
+            132, 132, 215, 205, 182, 150, 14, 115, 31, 182, 72, 94, 20,
+        ],
+        [
+            69, 231, 138, 117, 173, 221, 41, 131, 254, 155, 191, 117, 134, 185, 244, 239, 223, 169,
+            119, 108, 64, 191, 142, 111, 73, 108, 160, 106, 155, 102, 205, 46,
+        ],
+    ],
+    [
+        [
+            216, 228, 186, 25, 141, 114, 50, 180, 248, 77, 180, 135, 54, 130, 143, 37, 195, 92, 84,
+            224, 181, 77, 69, 208, 172, 57, 221, 164, 6, 233, 98, 49,
+        ],
+        [
+            169, 136, 52, 59, 237, 211, 56, 94, 189, 86, 149, 191, 67, 97, 7, 175, 106, 166, 35,
+            82, 86, 61, 133, 188, 53, 17, 216, 207, 65, 229, 194, 2,
+        ],
+        [
+            255, 84, 1, 221, 103, 57, 196, 217, 196, 185, 158, 106, 101, 162, 235, 202, 135, 134,
+            88, 167, 150, 148, 218, 54, 255, 108, 49, 166, 102, 176, 84, 30,
+        ],
+        [
+            92, 224, 203, 243, 67, 151, 137, 209, 206, 249, 185, 243, 233, 175, 220, 244, 175, 1,
+            122, 2, 95, 243, 93, 187, 239, 23, 255, 69, 41, 120, 38, 38,
+        ],
+        [
+            128, 21, 223, 166, 79, 166, 187, 242, 137, 152, 56, 128, 243, 30, 183, 245, 180, 123,
+            32, 118, 207, 24, 147, 57, 157, 179, 123, 151, 104, 69, 46, 52,
+        ],
+        [
+            68, 43, 112, 45, 194, 157, 39, 211, 168, 167, 179, 209, 157, 101, 27, 43, 230, 76, 176,
+            78, 232, 203, 95, 253, 116, 237, 107, 32, 48, 158, 58, 50,
+        ],
+        [
+            100, 239, 210, 82, 79, 131, 253, 105, 235, 193, 69, 45, 187, 62, 95, 152, 54, 234, 64,
+            114, 234, 169, 168, 87, 150, 35, 127, 246, 74, 17, 148, 2,
+        ],
+        [
+            75, 112, 183, 215, 233, 223, 247, 91, 99, 90, 35, 216, 185, 170, 80, 82, 85, 71, 162,
+            41, 97, 124, 189, 217, 53, 205, 136, 253, 224, 194, 79, 1,
+        ],
+    ],
+    [
+        [
+            53, 21, 40, 125, 210, 154, 222, 229, 87, 242, 184, 188, 80, 173, 32, 106, 137, 190,
+            140, 153, 255, 209, 126, 13, 117, 250, 37, 153, 245, 4, 245, 2,
+        ],
+        [
+            228, 81, 243, 233, 86, 117, 4, 73, 124, 54, 11, 93, 190, 50, 53, 159, 145, 61, 152,
+            111, 240, 113, 23, 252, 69, 88, 36, 226, 4, 109, 229, 3,
+        ],
+        [
+            145, 141, 131, 86, 137, 206, 97, 36, 227, 136, 52, 93, 108, 105, 103, 81, 237, 131,
+            235, 148, 131, 81, 85, 254, 247, 197, 252, 157, 10, 55, 29, 3,
+        ],
+        [
+            103, 142, 61, 123, 169, 170, 61, 44, 87, 32, 62, 112, 84, 138, 187, 144, 188, 38, 202,
+            94, 221, 200, 202, 244, 109, 138, 121, 56, 154, 45, 76, 0,
+        ],
+        [
+            69, 127, 85, 137, 95, 27, 254, 15, 93, 42, 143, 67, 31, 140, 206, 8, 214, 151, 217, 69,
+            145, 105, 169, 116, 238, 37, 55, 137, 215, 80, 158, 8,
+        ],
+        [
+            22, 207, 101, 165, 241, 155, 248, 78, 60, 23, 127, 195, 251, 193, 217, 78, 162, 158,
+            177, 146, 112, 183, 237, 32, 1, 138, 101, 44, 157, 172, 149, 36,
+        ],
+        [
+            76, 137, 207, 192, 160, 232, 61, 242, 123, 239, 139, 70, 152, 11, 242, 137, 58, 104,
+            228, 63, 142, 23, 137, 23, 37, 253, 40, 100, 183, 97, 87, 40,
+        ],
+        [
+            34, 111, 225, 153, 243, 185, 42, 1, 25, 11, 157, 125, 204, 60, 23, 123, 187, 200, 70,
+            228, 192, 25, 145, 43, 170, 247, 123, 157, 50, 180, 67, 12,
+        ],
+    ],
+    [
+        [
+            139, 112, 152, 150, 233, 77, 13, 21, 174, 183, 70, 63, 135, 81, 128, 72, 144, 58, 49,
+            65, 191, 20, 146, 19, 26, 255, 133, 93, 112, 124, 207, 62,
+        ],
+        [
+            2, 63, 203, 234, 101, 157, 7, 25, 149, 165, 34, 204, 219, 25, 49, 15, 142, 143, 122,
+            136, 92, 218, 149, 250, 192, 211, 144, 125, 34, 237, 151, 21,
+        ],
+        [
+            188, 61, 75, 218, 124, 179, 96, 22, 138, 217, 109, 25, 125, 27, 24, 96, 239, 246, 167,
+            201, 19, 9, 166, 15, 88, 21, 233, 112, 123, 235, 164, 21,
+        ],
+        [
+            219, 142, 147, 199, 38, 55, 203, 214, 230, 204, 36, 59, 30, 239, 102, 148, 0, 108, 173,
+            188, 32, 144, 135, 194, 254, 50, 3, 35, 201, 218, 230, 21,
+        ],
+        [
+            68, 146, 51, 190, 170, 51, 35, 111, 126, 119, 58, 209, 251, 55, 62, 91, 158, 203, 122,
+            233, 55, 43, 185, 64, 118, 142, 220, 200, 199, 254, 47, 41,
+        ],
+        [
+            24, 58, 100, 185, 6, 101, 241, 244, 103, 176, 10, 237, 176, 190, 212, 66, 82, 150, 241,
+            230, 149, 43, 245, 7, 25, 251, 229, 179, 221, 123, 159, 63,
+        ],
+        [
+            28, 224, 32, 241, 13, 252, 30, 52, 182, 163, 237, 107, 166, 132, 135, 68, 78, 190, 35,
+            235, 117, 126, 20, 138, 61, 223, 23, 145, 57, 74, 120, 4,
+        ],
+        [
+            31, 99, 79, 38, 16, 74, 27, 159, 179, 143, 60, 173, 93, 70, 72, 38, 183, 41, 238, 168,
+            71, 38, 4, 101, 78, 155, 224, 181, 93, 127, 35, 11,
+        ],
+    ],
+    [
+        [
+            60, 137, 224, 53, 215, 197, 25, 63, 90, 33, 63, 146, 157, 176, 68, 250, 232, 147, 24,
+            191, 26, 117, 147, 165, 101, 139, 54, 222, 124, 240, 79, 13,
+        ],
+        [
+            134, 236, 133, 85, 112, 78, 54, 159, 209, 197, 57, 233, 145, 194, 146, 20, 103, 18,
+            176, 88, 222, 218, 76, 231, 199, 242, 225, 215, 238, 66, 98, 55,
+        ],
+        [
+            182, 198, 172, 117, 4, 72, 70, 255, 122, 154, 82, 83, 111, 6, 200, 7, 183, 198, 100,
+            13, 210, 31, 60, 128, 75, 234, 201, 180, 70, 102, 30, 36,
+        ],
+        [
+            153, 192, 32, 150, 124, 34, 86, 143, 118, 191, 78, 155, 197, 139, 103, 250, 187, 136,
+            219, 207, 254, 39, 230, 186, 100, 89, 110, 143, 183, 188, 81, 49,
+        ],
+        [
+            231, 119, 201, 218, 80, 86, 142, 21, 12, 24, 57, 147, 136, 40, 228, 215, 158, 224, 139,
+            236, 214, 47, 59, 208, 17, 48, 224, 21, 169, 129, 224, 17,
+        ],
+        [
+            100, 226, 103, 188, 57, 117, 183, 147, 141, 126, 101, 99, 181, 52, 203, 220, 157, 213,
+            75, 185, 16, 251, 107, 65, 118, 234, 204, 254, 112, 123, 90, 5,
+        ],
+        [
+            109, 233, 111, 207, 104, 219, 124, 6, 23, 121, 255, 210, 34, 191, 93, 83, 152, 185, 83,
+            105, 217, 198, 181, 246, 226, 112, 155, 92, 188, 101, 111, 39,
+        ],
+        [
+            179, 174, 143, 91, 160, 49, 243, 140, 151, 237, 93, 224, 177, 144, 185, 60, 240, 162,
+            55, 226, 253, 59, 107, 70, 83, 152, 148, 243, 130, 180, 241, 17,
+        ],
+    ],
+    [
+        [
+            1, 195, 47, 208, 103, 47, 214, 177, 87, 185, 90, 187, 162, 188, 124, 200, 242, 52, 134,
+            234, 83, 113, 107, 123, 170, 90, 81, 163, 132, 119, 35, 14,
+        ],
+        [
+            155, 171, 18, 109, 236, 115, 191, 12, 58, 167, 16, 164, 181, 122, 238, 96, 155, 233,
+            253, 23, 109, 140, 48, 21, 65, 109, 224, 117, 176, 241, 254, 18,
+        ],
+        [
+            70, 96, 64, 75, 143, 232, 226, 103, 52, 104, 0, 69, 83, 125, 202, 106, 161, 191, 177,
+            102, 45, 23, 238, 204, 53, 40, 78, 59, 242, 35, 159, 19,
+        ],
+        [
+            111, 81, 99, 34, 235, 124, 190, 219, 217, 172, 34, 122, 197, 157, 192, 78, 195, 143,
+            238, 204, 77, 161, 107, 102, 74, 229, 67, 12, 117, 122, 246, 0,
+        ],
+        [
+            144, 191, 125, 138, 68, 229, 183, 225, 230, 10, 142, 95, 44, 186, 213, 104, 243, 32,
+            18, 104, 187, 179, 37, 101, 2, 120, 216, 48, 170, 4, 158, 38,
+        ],
+        [
+            217, 133, 55, 67, 171, 207, 107, 237, 48, 161, 178, 178, 184, 86, 122, 8, 47, 50, 129,
+            108, 208, 22, 31, 13, 123, 72, 240, 226, 193, 85, 76, 7,
+        ],
+        [
+            143, 182, 97, 62, 51, 201, 49, 9, 30, 111, 130, 124, 184, 183, 215, 198, 43, 236, 200,
+            126, 218, 175, 240, 182, 161, 238, 80, 220, 13, 1, 11, 36,
+        ],
+        [
+            167, 187, 116, 148, 117, 166, 104, 241, 228, 188, 41, 158, 140, 164, 46, 222, 157, 136,
+            217, 42, 198, 235, 34, 14, 130, 24, 192, 142, 220, 217, 48, 38,
+        ],
+    ],
+    [
+        [
+            4, 57, 211, 98, 189, 189, 205, 184, 46, 220, 130, 21, 68, 2, 10, 29, 48, 61, 199, 226,
+            206, 227, 52, 249, 60, 176, 140, 23, 177, 67, 92, 15,
+        ],
+        [
+            181, 234, 40, 253, 161, 44, 200, 120, 241, 178, 215, 196, 222, 102, 210, 0, 182, 155,
+            34, 174, 18, 66, 1, 124, 173, 154, 113, 56, 25, 13, 138, 18,
+        ],
+        [
+            55, 134, 66, 34, 135, 181, 181, 9, 132, 109, 116, 206, 120, 178, 211, 47, 53, 148, 149,
+            115, 173, 120, 236, 5, 58, 69, 176, 237, 73, 147, 106, 47,
+        ],
+        [
+            158, 35, 158, 179, 82, 219, 196, 82, 60, 250, 48, 96, 3, 113, 101, 66, 35, 143, 232,
+            102, 166, 223, 93, 32, 125, 45, 235, 133, 189, 37, 139, 18,
+        ],
+        [
+            10, 247, 120, 27, 215, 183, 216, 124, 175, 48, 103, 247, 34, 165, 86, 118, 173, 252,
+            154, 253, 25, 249, 106, 175, 73, 29, 109, 255, 8, 131, 131, 10,
+        ],
+        [
+            157, 228, 177, 8, 79, 14, 148, 44, 112, 58, 0, 43, 124, 26, 238, 145, 31, 240, 212,
+            214, 50, 56, 8, 37, 162, 19, 47, 237, 128, 152, 97, 12,
+        ],
+        [
+            89, 136, 71, 53, 83, 53, 243, 10, 123, 130, 170, 24, 167, 121, 41, 40, 148, 89, 117,
+            122, 123, 30, 110, 13, 240, 219, 58, 200, 65, 26, 61, 44,
+        ],
+        [
+            156, 55, 245, 59, 198, 161, 112, 207, 14, 229, 66, 65, 138, 39, 231, 216, 200, 235, 25,
+            219, 204, 38, 32, 167, 134, 247, 41, 188, 166, 147, 85, 55,
+        ],
+    ],
+    [
+        [
+            233, 92, 75, 182, 82, 75, 137, 98, 145, 215, 248, 100, 63, 227, 162, 169, 113, 40, 221,
+            59, 2, 250, 220, 112, 132, 129, 250, 177, 8, 101, 164, 8,
+        ],
+        [
+            31, 38, 71, 251, 116, 153, 63, 32, 236, 124, 90, 46, 197, 165, 160, 131, 250, 189, 241,
+            82, 157, 233, 201, 163, 118, 11, 216, 15, 33, 90, 101, 5,
+        ],
+        [
+            82, 156, 93, 235, 57, 86, 36, 76, 10, 134, 151, 132, 254, 98, 48, 157, 111, 45, 76,
+            195, 253, 218, 46, 2, 173, 142, 75, 218, 42, 54, 73, 15,
+        ],
+        [
+            59, 182, 126, 198, 69, 64, 199, 105, 134, 90, 186, 27, 217, 143, 228, 145, 122, 150,
+            91, 236, 213, 134, 172, 191, 182, 40, 246, 159, 31, 217, 88, 27,
+        ],
+        [
+            196, 28, 79, 113, 123, 215, 117, 42, 34, 17, 152, 218, 135, 254, 95, 214, 11, 224, 139,
+            61, 142, 110, 220, 197, 153, 144, 149, 233, 74, 146, 63, 7,
+        ],
+        [
+            27, 38, 138, 60, 32, 242, 80, 37, 33, 219, 27, 181, 40, 238, 146, 248, 109, 102, 248,
+            210, 191, 96, 45, 228, 120, 76, 244, 62, 177, 201, 55, 17,
+        ],
+        [
+            81, 219, 130, 197, 159, 89, 150, 166, 78, 19, 4, 125, 2, 112, 255, 111, 2, 158, 160,
+            81, 195, 82, 139, 20, 156, 54, 0, 128, 78, 241, 177, 46,
+        ],
+        [
+            6, 236, 47, 125, 243, 52, 250, 71, 17, 75, 21, 146, 229, 56, 210, 203, 231, 210, 39,
+            170, 202, 114, 14, 199, 67, 74, 203, 97, 155, 186, 171, 20,
+        ],
+    ],
+    [
+        [
+            158, 124, 26, 65, 178, 248, 144, 218, 104, 25, 157, 123, 70, 74, 14, 224, 180, 141, 73,
+            53, 170, 128, 16, 99, 206, 127, 195, 128, 130, 243, 78, 48,
+        ],
+        [
+            36, 86, 7, 238, 107, 51, 95, 192, 105, 21, 3, 175, 244, 132, 71, 95, 176, 177, 37, 191,
+            229, 238, 174, 51, 24, 167, 55, 176, 224, 205, 82, 43,
+        ],
+        [
+            136, 128, 95, 139, 143, 114, 236, 145, 6, 225, 197, 17, 55, 175, 53, 58, 25, 247, 29,
+            140, 117, 43, 202, 117, 245, 202, 62, 46, 137, 57, 77, 9,
+        ],
+        [
+            127, 245, 39, 235, 242, 22, 144, 158, 100, 135, 219, 155, 91, 192, 73, 60, 225, 231,
+            25, 84, 215, 52, 125, 43, 20, 45, 223, 178, 108, 59, 203, 16,
+        ],
+        [
+            148, 178, 74, 27, 251, 145, 203, 17, 208, 119, 184, 84, 117, 0, 241, 206, 166, 222,
+            187, 106, 157, 202, 125, 129, 14, 89, 175, 187, 23, 159, 126, 55,
+        ],
+        [
+            114, 4, 75, 157, 83, 233, 5, 108, 158, 88, 53, 99, 8, 186, 204, 172, 120, 171, 248, 43,
+            48, 207, 38, 111, 138, 225, 143, 83, 209, 105, 105, 37,
+        ],
+        [
+            92, 59, 72, 113, 151, 252, 46, 138, 65, 212, 75, 197, 200, 119, 255, 6, 66, 114, 189,
+            247, 23, 249, 124, 92, 47, 173, 213, 55, 128, 69, 145, 0,
+        ],
+        [
+            22, 114, 108, 240, 146, 117, 172, 126, 46, 221, 36, 250, 171, 77, 187, 18, 38, 212,
+            212, 52, 42, 251, 64, 90, 240, 227, 253, 15, 18, 125, 168, 1,
+        ],
+    ],
+    [
+        [
+            186, 129, 70, 211, 209, 123, 234, 4, 142, 210, 52, 75, 0, 165, 181, 253, 213, 180, 1,
+            26, 175, 236, 137, 95, 51, 205, 8, 153, 161, 113, 70, 48,
+        ],
+        [
+            211, 79, 54, 21, 140, 133, 28, 234, 69, 33, 148, 67, 237, 83, 252, 208, 124, 149, 83,
+            176, 134, 112, 148, 157, 239, 4, 185, 88, 111, 40, 62, 7,
+        ],
+        [
+            180, 162, 213, 99, 227, 21, 244, 143, 151, 86, 246, 138, 9, 110, 92, 15, 219, 95, 149,
+            64, 82, 58, 85, 201, 2, 168, 105, 198, 252, 15, 21, 33,
+        ],
+        [
+            238, 242, 147, 203, 56, 47, 195, 175, 121, 150, 66, 19, 29, 125, 247, 37, 225, 233,
+            248, 120, 250, 40, 194, 36, 124, 245, 20, 70, 213, 211, 179, 27,
+        ],
+        [
+            242, 105, 72, 107, 136, 229, 105, 29, 230, 84, 124, 18, 45, 141, 155, 6, 97, 175, 95,
+            95, 0, 4, 19, 166, 109, 241, 230, 239, 164, 149, 186, 52,
+        ],
+        [
+            1, 82, 33, 143, 210, 61, 135, 113, 67, 115, 94, 12, 152, 184, 122, 63, 9, 113, 248, 26,
+            121, 49, 198, 28, 239, 249, 37, 44, 227, 142, 11, 63,
+        ],
+        [
+            141, 102, 219, 141, 89, 219, 109, 104, 45, 114, 10, 166, 184, 102, 70, 195, 113, 68,
+            13, 96, 100, 28, 99, 64, 139, 172, 150, 189, 54, 35, 5, 16,
+        ],
+        [
+            226, 23, 65, 200, 163, 177, 166, 155, 32, 24, 126, 141, 136, 199, 29, 214, 185, 111,
+            48, 116, 38, 107, 66, 40, 42, 151, 106, 247, 65, 198, 12, 18,
+        ],
+    ],
+    [
+        [
+            11, 57, 245, 10, 120, 212, 154, 224, 122, 18, 200, 9, 192, 66, 247, 130, 124, 226, 39,
+            100, 91, 114, 249, 21, 221, 158, 71, 64, 87, 180, 147, 61,
+        ],
+        [
+            37, 54, 176, 141, 253, 46, 101, 178, 149, 5, 94, 50, 150, 19, 8, 243, 238, 54, 66, 215,
+            149, 62, 233, 236, 150, 146, 115, 42, 56, 15, 139, 52,
+        ],
+        [
+            54, 70, 131, 252, 109, 145, 35, 237, 41, 156, 62, 251, 130, 172, 131, 215, 50, 13, 168,
+            3, 149, 189, 158, 245, 40, 211, 35, 247, 190, 218, 68, 31,
+        ],
+        [
+            97, 18, 186, 126, 155, 90, 103, 122, 159, 64, 119, 250, 254, 3, 125, 97, 78, 132, 97,
+            20, 24, 36, 13, 6, 160, 106, 10, 38, 137, 196, 82, 59,
+        ],
+        [
+            83, 183, 38, 131, 224, 55, 36, 131, 250, 50, 98, 62, 53, 31, 186, 3, 59, 193, 44, 178,
+            167, 60, 7, 31, 17, 197, 225, 87, 77, 201, 175, 50,
+        ],
+        [
+            166, 65, 53, 61, 2, 156, 230, 20, 187, 218, 252, 134, 254, 199, 189, 164, 61, 159, 23,
+            37, 253, 230, 212, 38, 189, 174, 98, 199, 120, 113, 184, 46,
+        ],
+        [
+            38, 212, 175, 135, 83, 126, 242, 192, 211, 177, 211, 133, 235, 210, 36, 196, 46, 174,
+            42, 9, 38, 72, 180, 212, 25, 76, 60, 244, 160, 252, 226, 52,
+        ],
+        [
+            9, 186, 189, 28, 93, 244, 73, 59, 139, 98, 224, 159, 137, 187, 244, 145, 248, 78, 122,
+            176, 76, 77, 126, 35, 71, 70, 152, 33, 154, 40, 47, 8,
+        ],
+    ],
+    [
+        [
+            94, 74, 53, 248, 123, 40, 164, 191, 101, 131, 134, 77, 92, 11, 113, 23, 119, 101, 67,
+            184, 14, 138, 91, 152, 10, 50, 206, 226, 114, 50, 153, 38,
+        ],
+        [
+            70, 24, 160, 108, 135, 70, 121, 130, 110, 115, 249, 98, 163, 92, 182, 121, 140, 170,
+            43, 109, 119, 200, 93, 198, 144, 155, 40, 165, 116, 110, 83, 59,
+        ],
+        [
+            13, 111, 207, 211, 162, 206, 0, 87, 64, 221, 186, 206, 200, 25, 249, 40, 163, 157, 217,
+            108, 151, 40, 35, 149, 112, 144, 3, 223, 7, 239, 84, 27,
+        ],
+        [
+            123, 7, 143, 59, 246, 209, 168, 75, 236, 100, 37, 50, 57, 242, 6, 74, 175, 206, 53,
+            213, 100, 11, 124, 103, 34, 250, 34, 134, 171, 72, 96, 26,
+        ],
+        [
+            60, 211, 255, 163, 224, 254, 242, 177, 84, 221, 102, 62, 71, 95, 142, 146, 101, 6, 167,
+            153, 65, 139, 49, 248, 206, 27, 116, 138, 191, 104, 173, 61,
+        ],
+        [
+            117, 248, 184, 111, 92, 89, 176, 208, 186, 103, 174, 104, 91, 39, 254, 211, 76, 235,
+            186, 171, 140, 209, 163, 40, 128, 223, 238, 208, 174, 221, 7, 32,
+        ],
+        [
+            15, 175, 163, 23, 221, 182, 136, 48, 98, 253, 118, 47, 232, 19, 69, 81, 113, 107, 230,
+            69, 64, 87, 123, 226, 59, 240, 192, 34, 182, 24, 75, 54,
+        ],
+        [
+            200, 246, 135, 47, 106, 173, 187, 66, 101, 71, 151, 84, 100, 193, 113, 156, 71, 60,
+            224, 247, 238, 27, 214, 105, 25, 8, 215, 175, 211, 72, 152, 50,
+        ],
+    ],
+    [
+        [
+            11, 177, 54, 174, 134, 45, 96, 29, 9, 32, 202, 41, 30, 87, 38, 235, 103, 175, 59, 65,
+            34, 62, 230, 27, 51, 229, 143, 20, 250, 88, 49, 13,
+        ],
+        [
+            87, 251, 224, 97, 90, 123, 60, 173, 91, 250, 215, 196, 210, 111, 58, 198, 29, 127, 17,
+            192, 116, 130, 106, 223, 111, 179, 160, 19, 165, 77, 156, 35,
+        ],
+        [
+            228, 124, 114, 35, 183, 22, 90, 239, 18, 23, 66, 210, 98, 54, 229, 152, 173, 58, 197,
+            212, 179, 59, 46, 118, 71, 8, 205, 134, 221, 142, 49, 36,
+        ],
+        [
+            97, 172, 167, 10, 48, 141, 55, 10, 206, 107, 10, 234, 141, 228, 243, 71, 219, 231, 255,
+            127, 65, 87, 122, 172, 51, 255, 202, 73, 57, 233, 54, 56,
+        ],
+        [
+            218, 201, 81, 10, 208, 235, 255, 195, 207, 199, 247, 55, 152, 186, 219, 173, 46, 254,
+            116, 54, 25, 159, 121, 178, 6, 197, 64, 24, 165, 163, 254, 27,
+        ],
+        [
+            199, 51, 104, 153, 21, 83, 213, 132, 151, 210, 221, 160, 191, 61, 32, 39, 116, 202,
+            190, 68, 168, 8, 206, 34, 76, 101, 91, 56, 234, 195, 177, 36,
+        ],
+        [
+            200, 156, 175, 110, 211, 162, 86, 81, 86, 181, 99, 37, 39, 70, 77, 2, 181, 145, 157,
+            169, 145, 213, 47, 162, 60, 26, 123, 27, 69, 95, 111, 43,
+        ],
+        [
+            30, 40, 191, 205, 195, 141, 30, 180, 227, 90, 168, 109, 254, 194, 197, 47, 47, 158,
+            151, 92, 119, 93, 22, 48, 71, 132, 50, 156, 11, 56, 60, 24,
+        ],
+    ],
+    [
+        [
+            97, 236, 10, 82, 54, 165, 11, 222, 119, 226, 142, 250, 85, 73, 71, 5, 130, 185, 152,
+            10, 38, 191, 159, 228, 39, 47, 7, 123, 206, 29, 63, 38,
+        ],
+        [
+            63, 93, 78, 222, 254, 85, 222, 188, 119, 75, 202, 250, 75, 37, 247, 183, 250, 248, 44,
+            137, 207, 242, 186, 236, 175, 255, 203, 108, 22, 25, 86, 3,
+        ],
+        [
+            66, 175, 216, 225, 118, 129, 106, 102, 143, 170, 241, 201, 21, 1, 14, 89, 249, 49, 143,
+            24, 17, 12, 166, 116, 29, 109, 134, 183, 99, 174, 81, 37,
+        ],
+        [
+            197, 95, 177, 171, 196, 1, 233, 30, 98, 64, 186, 21, 34, 102, 54, 128, 110, 217, 3, 49,
+            99, 164, 192, 114, 104, 45, 7, 144, 94, 62, 16, 61,
+        ],
+        [
+            98, 86, 153, 20, 228, 157, 201, 70, 53, 155, 58, 84, 87, 140, 55, 16, 52, 29, 87, 106,
+            98, 147, 35, 71, 160, 18, 82, 216, 95, 244, 124, 45,
+        ],
+        [
+            242, 37, 85, 138, 93, 10, 117, 237, 63, 244, 73, 17, 187, 70, 150, 137, 148, 180, 139,
+            39, 229, 169, 1, 46, 243, 136, 170, 65, 51, 64, 34, 8,
+        ],
+        [
+            106, 96, 176, 162, 206, 47, 28, 119, 20, 102, 105, 144, 240, 117, 54, 120, 21, 220, 87,
+            50, 191, 53, 87, 35, 135, 229, 145, 33, 96, 101, 129, 38,
+        ],
+        [
+            166, 50, 224, 123, 255, 237, 250, 219, 171, 90, 189, 230, 77, 15, 184, 248, 42, 245,
+            240, 71, 209, 160, 244, 146, 72, 164, 139, 171, 242, 118, 62, 26,
+        ],
+    ],
+    [
+        [
+            176, 240, 195, 230, 203, 40, 73, 83, 30, 77, 37, 58, 215, 19, 113, 147, 218, 57, 68,
+            214, 129, 183, 139, 254, 131, 136, 216, 77, 185, 153, 140, 12,
+        ],
+        [
+            174, 253, 75, 3, 63, 87, 254, 53, 165, 243, 14, 41, 65, 7, 178, 91, 20, 111, 153, 155,
+            23, 89, 87, 37, 105, 23, 204, 147, 189, 113, 94, 2,
+        ],
+        [
+            218, 122, 7, 174, 69, 151, 16, 100, 230, 16, 187, 104, 238, 221, 124, 137, 157, 148,
+            222, 48, 86, 3, 71, 115, 64, 244, 81, 206, 205, 128, 41, 38,
+        ],
+        [
+            105, 132, 64, 84, 221, 69, 102, 124, 171, 223, 164, 67, 156, 97, 234, 192, 157, 110,
+            215, 207, 127, 75, 159, 90, 243, 153, 13, 168, 51, 78, 121, 21,
+        ],
+        [
+            124, 100, 211, 110, 134, 174, 177, 107, 84, 71, 156, 178, 27, 156, 130, 141, 190, 112,
+            114, 107, 8, 10, 227, 230, 169, 165, 46, 162, 126, 47, 219, 21,
+        ],
+        [
+            174, 109, 63, 1, 208, 183, 47, 213, 241, 116, 48, 79, 112, 250, 39, 77, 205, 232, 183,
+            125, 65, 147, 180, 37, 118, 143, 209, 157, 0, 165, 131, 35,
+        ],
+        [
+            171, 239, 114, 71, 235, 47, 49, 6, 184, 165, 133, 4, 30, 222, 236, 244, 145, 233, 148,
+            50, 228, 226, 223, 139, 224, 213, 38, 123, 117, 85, 230, 42,
+        ],
+        [
+            153, 172, 236, 117, 32, 68, 60, 120, 241, 40, 227, 98, 64, 137, 114, 1, 21, 216, 57,
+            244, 116, 137, 172, 13, 181, 160, 230, 67, 60, 188, 218, 58,
+        ],
+    ],
+];
+
+pub fn generator() -> pallas::Affine {
+    pallas::Affine::from_xy(
+        pallas::Base::from_bytes(&GENERATOR.0).unwrap(),
+        pallas::Base::from_bytes(&GENERATOR.1).unwrap(),
+    )
+    .unwrap()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::super::{
+        test_lagrange_coeffs, test_zs_and_us, COMMIT_IVK_PERSONALIZATION, NUM_WINDOWS,
+    };
+    use super::*;
+    use group::Curve;
+    use halo2_gadgets::primitives::sinsemilla::CommitDomain;
+    use pasta_curves::{
+        arithmetic::{CurveAffine, FieldExt},
+        pallas,
+    };
+
+    #[test]
+    fn generator() {
+        let domain = CommitDomain::new(COMMIT_IVK_PERSONALIZATION);
+        let point = domain.R();
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(*coords.x(), pallas::Base::from_bytes(&GENERATOR.0).unwrap());
+        assert_eq!(*coords.y(), pallas::Base::from_bytes(&GENERATOR.1).unwrap());
+    }
+
+    #[test]
+    fn lagrange_coeffs() {
+        let base = super::generator();
+        test_lagrange_coeffs(base, NUM_WINDOWS);
+    }
+
+    #[test]
+    fn z() {
+        let base = super::generator();
+        test_zs_and_us(base, &Z, &U, NUM_WINDOWS);
+    }
+}

+ 2965 - 0
src/crypto/constants/fixed_bases/note_commit_r.rs

@@ -0,0 +1,2965 @@
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    pallas,
+};
+
+/// Generator used in SinsemillaCommit randomness for note commitment
+pub const GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        19, 110, 252, 15, 72, 44, 2, 44, 124, 164, 20, 252, 92, 197, 158, 35, 242, 61, 111, 147,
+        171, 159, 35, 205, 51, 69, 169, 40, 195, 6, 178, 38,
+    ],
+    [
+        227, 55, 207, 34, 198, 83, 65, 195, 246, 220, 224, 35, 120, 192, 199, 121, 198, 225, 102,
+        35, 47, 26, 84, 169, 76, 192, 109, 104, 75, 86, 222, 60,
+    ],
+);
+
+/// Full-width z-values for GENERATOR
+pub const Z: [u64; super::NUM_WINDOWS] = [
+    253356, 149209, 114903, 10575, 6973, 30969, 55415, 206450, 18453, 24528, 13099, 213949, 29959,
+    49929, 80867, 17465, 43715, 80241, 55983, 132629, 66101, 24136, 31372, 107975, 161748, 24107,
+    72184, 9338, 232543, 13519, 33536, 32530, 130885, 41578, 18166, 91947, 59796, 35560, 5631,
+    158600, 24695, 42654, 138331, 11268, 54733, 92869, 33770, 169166, 94853, 7006, 117687, 8073,
+    11865, 15349, 186445, 7696, 25167, 30146, 277659, 53921, 19594, 41306, 30172, 8124, 46133,
+    38659, 61965, 92134, 43958, 86662, 2047, 3542, 20976, 7411, 53574, 38271, 48233, 65338, 30516,
+    41201, 40964, 8563, 36035, 6334, 176,
+];
+
+/// Full-width u-values for GENERATOR
+pub const U: [[[u8; 32]; super::H]; super::NUM_WINDOWS] = [
+    [
+        [
+            114, 245, 9, 0, 5, 43, 7, 118, 244, 43, 15, 200, 116, 210, 0, 24, 161, 28, 185, 152,
+            216, 107, 69, 189, 146, 74, 72, 71, 79, 117, 226, 21,
+        ],
+        [
+            198, 234, 165, 117, 60, 32, 158, 128, 245, 251, 167, 51, 94, 222, 84, 164, 93, 252, 6,
+            172, 219, 79, 238, 23, 10, 251, 127, 190, 92, 247, 84, 7,
+        ],
+        [
+            247, 1, 1, 220, 151, 35, 250, 127, 20, 73, 141, 158, 41, 239, 31, 53, 87, 128, 115, 67,
+            105, 106, 106, 227, 24, 13, 193, 27, 11, 59, 156, 12,
+        ],
+        [
+            182, 18, 28, 164, 222, 215, 93, 217, 191, 112, 205, 228, 10, 41, 225, 115, 16, 106,
+            253, 86, 190, 158, 170, 163, 242, 182, 199, 91, 54, 66, 87, 45,
+        ],
+        [
+            85, 233, 2, 251, 58, 85, 151, 41, 171, 17, 163, 129, 14, 53, 149, 170, 49, 242, 59, 95,
+            195, 86, 152, 140, 191, 194, 135, 96, 61, 247, 224, 19,
+        ],
+        [
+            9, 26, 141, 163, 30, 34, 167, 73, 162, 45, 13, 19, 213, 4, 222, 207, 61, 172, 202, 243,
+            122, 40, 68, 21, 175, 213, 86, 213, 254, 227, 101, 15,
+        ],
+        [
+            86, 112, 227, 11, 213, 132, 173, 162, 105, 136, 218, 34, 136, 252, 237, 146, 166, 198,
+            142, 26, 59, 222, 162, 186, 51, 155, 102, 60, 62, 47, 222, 4,
+        ],
+        [
+            86, 92, 45, 23, 81, 81, 61, 194, 172, 21, 21, 83, 38, 217, 43, 44, 235, 231, 88, 89,
+            249, 41, 181, 159, 83, 22, 75, 138, 70, 126, 207, 16,
+        ],
+    ],
+    [
+        [
+            54, 21, 251, 114, 55, 147, 20, 211, 33, 240, 173, 252, 164, 174, 133, 65, 206, 140, 93,
+            20, 42, 49, 181, 104, 21, 120, 234, 196, 70, 100, 73, 42,
+        ],
+        [
+            238, 4, 102, 31, 21, 150, 35, 139, 86, 204, 115, 87, 148, 16, 158, 189, 161, 53, 20,
+            94, 238, 188, 243, 68, 91, 3, 117, 235, 245, 98, 110, 2,
+        ],
+        [
+            71, 0, 3, 234, 114, 242, 86, 47, 159, 35, 98, 250, 218, 203, 192, 75, 15, 24, 202, 7,
+            142, 99, 58, 79, 13, 158, 200, 188, 138, 62, 146, 46,
+        ],
+        [
+            110, 160, 81, 239, 206, 110, 48, 235, 48, 53, 5, 146, 193, 225, 227, 102, 163, 114,
+            159, 188, 166, 215, 24, 17, 124, 185, 233, 142, 97, 16, 247, 53,
+        ],
+        [
+            5, 74, 101, 186, 155, 171, 161, 12, 114, 102, 185, 130, 202, 125, 97, 157, 214, 109,
+            90, 55, 78, 151, 78, 233, 114, 32, 38, 167, 230, 47, 114, 43,
+        ],
+        [
+            43, 145, 156, 91, 52, 42, 252, 255, 165, 106, 190, 113, 140, 48, 74, 56, 231, 74, 233,
+            182, 111, 200, 49, 231, 139, 33, 38, 157, 185, 84, 190, 60,
+        ],
+        [
+            35, 64, 214, 183, 170, 176, 163, 222, 136, 23, 64, 62, 90, 18, 25, 78, 171, 169, 203,
+            242, 161, 64, 191, 204, 85, 79, 54, 130, 184, 99, 198, 38,
+        ],
+        [
+            6, 238, 153, 49, 156, 138, 236, 90, 155, 111, 98, 17, 43, 249, 193, 244, 33, 204, 245,
+            189, 174, 217, 152, 5, 133, 155, 139, 239, 164, 120, 180, 8,
+        ],
+    ],
+    [
+        [
+            233, 129, 153, 212, 169, 73, 235, 118, 37, 78, 183, 222, 115, 222, 111, 212, 174, 24,
+            102, 40, 189, 47, 223, 108, 201, 62, 19, 230, 93, 6, 207, 6,
+        ],
+        [
+            10, 125, 165, 221, 218, 11, 142, 131, 27, 0, 193, 244, 189, 149, 150, 127, 192, 16,
+            251, 0, 79, 224, 118, 106, 158, 229, 58, 190, 27, 199, 70, 44,
+        ],
+        [
+            47, 93, 253, 7, 216, 219, 104, 144, 107, 172, 234, 91, 107, 52, 121, 5, 45, 214, 148,
+            39, 118, 243, 128, 223, 42, 130, 88, 198, 89, 37, 10, 40,
+        ],
+        [
+            24, 208, 204, 230, 65, 96, 241, 136, 121, 22, 15, 171, 27, 48, 41, 212, 157, 228, 185,
+            202, 141, 243, 68, 217, 60, 108, 115, 188, 211, 131, 67, 41,
+        ],
+        [
+            190, 202, 105, 68, 170, 47, 201, 132, 190, 190, 166, 225, 7, 107, 65, 69, 109, 193, 47,
+            14, 223, 26, 63, 185, 78, 230, 218, 0, 146, 143, 144, 0,
+        ],
+        [
+            166, 38, 45, 231, 156, 245, 176, 191, 52, 176, 212, 147, 13, 162, 132, 4, 8, 238, 204,
+            24, 112, 250, 234, 42, 224, 153, 250, 69, 56, 41, 114, 34,
+        ],
+        [
+            171, 36, 217, 169, 17, 204, 156, 28, 33, 25, 229, 73, 250, 40, 65, 166, 92, 68, 77,
+            151, 246, 87, 239, 237, 47, 250, 65, 58, 41, 64, 29, 13,
+        ],
+        [
+            17, 52, 107, 231, 186, 222, 120, 227, 138, 150, 6, 62, 222, 26, 253, 222, 252, 69, 140,
+            137, 103, 210, 248, 27, 241, 171, 195, 56, 114, 101, 22, 6,
+        ],
+    ],
+    [
+        [
+            167, 249, 74, 41, 45, 5, 43, 197, 190, 158, 48, 58, 214, 194, 196, 48, 163, 111, 197,
+            83, 203, 83, 193, 101, 43, 228, 53, 170, 170, 190, 223, 22,
+        ],
+        [
+            162, 191, 69, 35, 204, 166, 151, 23, 131, 224, 254, 194, 233, 234, 193, 6, 70, 175, 56,
+            93, 247, 40, 95, 84, 133, 73, 73, 210, 110, 187, 131, 18,
+        ],
+        [
+            86, 251, 193, 249, 206, 104, 190, 79, 14, 228, 247, 226, 227, 1, 142, 53, 81, 147, 128,
+            242, 205, 74, 216, 186, 139, 15, 7, 103, 248, 58, 67, 38,
+        ],
+        [
+            141, 211, 222, 46, 115, 150, 90, 79, 200, 197, 108, 95, 129, 77, 116, 216, 231, 125,
+            21, 48, 248, 132, 112, 71, 112, 37, 146, 179, 113, 163, 176, 52,
+        ],
+        [
+            118, 76, 20, 77, 119, 186, 56, 50, 222, 250, 197, 240, 220, 202, 194, 207, 254, 50, 5,
+            161, 165, 0, 49, 111, 45, 160, 220, 7, 202, 110, 89, 50,
+        ],
+        [
+            102, 37, 174, 173, 77, 58, 49, 245, 204, 1, 199, 86, 184, 110, 17, 46, 126, 117, 147,
+            199, 52, 11, 59, 7, 23, 192, 10, 183, 9, 203, 47, 63,
+        ],
+        [
+            80, 3, 3, 232, 195, 68, 22, 157, 76, 193, 50, 194, 229, 96, 221, 86, 166, 92, 177, 234,
+            210, 181, 234, 159, 182, 146, 34, 172, 4, 135, 41, 44,
+        ],
+        [
+            251, 99, 183, 95, 90, 221, 38, 54, 26, 124, 224, 152, 204, 56, 15, 10, 123, 235, 151,
+            73, 105, 106, 24, 173, 164, 213, 225, 110, 98, 59, 133, 2,
+        ],
+    ],
+    [
+        [
+            164, 185, 168, 158, 213, 198, 142, 64, 83, 152, 213, 11, 100, 189, 236, 113, 45, 181,
+            112, 106, 135, 24, 198, 226, 203, 63, 78, 3, 226, 180, 74, 10,
+        ],
+        [
+            189, 212, 60, 126, 110, 69, 152, 122, 85, 34, 9, 19, 22, 248, 13, 32, 135, 61, 19, 215,
+            200, 213, 219, 231, 220, 119, 92, 75, 219, 5, 120, 40,
+        ],
+        [
+            146, 245, 8, 160, 80, 125, 123, 131, 78, 50, 225, 183, 20, 25, 103, 1, 230, 84, 156,
+            252, 244, 204, 172, 164, 252, 118, 213, 130, 204, 37, 91, 11,
+        ],
+        [
+            142, 4, 206, 226, 62, 227, 19, 91, 196, 199, 182, 237, 73, 168, 222, 152, 4, 82, 70,
+            114, 57, 114, 229, 181, 134, 59, 0, 208, 176, 183, 218, 30,
+        ],
+        [
+            64, 30, 209, 160, 131, 75, 126, 41, 130, 105, 95, 99, 233, 182, 221, 1, 39, 231, 206,
+            9, 47, 25, 170, 24, 14, 249, 62, 68, 42, 68, 198, 6,
+        ],
+        [
+            171, 100, 218, 125, 75, 158, 24, 198, 25, 157, 232, 195, 15, 68, 34, 201, 219, 130,
+            198, 107, 2, 101, 70, 250, 161, 168, 99, 10, 18, 233, 13, 24,
+        ],
+        [
+            93, 226, 47, 214, 188, 46, 157, 237, 214, 49, 235, 173, 68, 33, 184, 57, 185, 165, 77,
+            217, 205, 103, 160, 63, 235, 254, 153, 164, 215, 239, 24, 53,
+        ],
+        [
+            168, 254, 143, 159, 235, 96, 14, 119, 152, 26, 156, 14, 149, 106, 16, 223, 73, 161,
+            133, 220, 175, 139, 213, 210, 56, 30, 214, 161, 51, 20, 128, 17,
+        ],
+    ],
+    [
+        [
+            90, 157, 237, 146, 6, 11, 72, 108, 27, 34, 77, 120, 242, 127, 35, 117, 189, 64, 45, 84,
+            233, 127, 132, 119, 128, 130, 141, 201, 107, 122, 33, 62,
+        ],
+        [
+            205, 110, 229, 214, 93, 107, 183, 211, 172, 82, 194, 10, 68, 115, 182, 64, 59, 197,
+            153, 86, 34, 235, 12, 128, 63, 71, 215, 108, 109, 223, 137, 51,
+        ],
+        [
+            215, 181, 7, 95, 143, 147, 43, 211, 208, 240, 5, 116, 105, 62, 141, 149, 67, 190, 237,
+            211, 147, 81, 206, 163, 206, 127, 90, 89, 234, 173, 18, 43,
+        ],
+        [
+            171, 227, 107, 54, 113, 175, 138, 78, 159, 26, 107, 241, 64, 57, 153, 114, 237, 92,
+            166, 85, 165, 104, 112, 131, 66, 27, 243, 179, 236, 14, 13, 39,
+        ],
+        [
+            74, 37, 91, 124, 254, 2, 191, 78, 0, 103, 90, 169, 99, 225, 232, 176, 213, 32, 172,
+            134, 17, 146, 120, 74, 78, 79, 132, 142, 122, 222, 157, 45,
+        ],
+        [
+            95, 6, 241, 174, 101, 194, 254, 44, 170, 149, 90, 122, 227, 137, 151, 143, 227, 35,
+            116, 144, 162, 87, 53, 70, 57, 37, 5, 66, 238, 197, 203, 6,
+        ],
+        [
+            114, 141, 200, 255, 187, 228, 255, 185, 248, 223, 241, 204, 71, 85, 159, 221, 108, 199,
+            184, 101, 44, 141, 20, 17, 147, 245, 108, 154, 109, 126, 173, 52,
+        ],
+        [
+            176, 218, 48, 106, 6, 126, 6, 176, 103, 206, 215, 132, 17, 182, 174, 147, 102, 173,
+            109, 141, 172, 86, 46, 28, 60, 224, 186, 110, 209, 106, 131, 9,
+        ],
+    ],
+    [
+        [
+            5, 64, 1, 52, 210, 89, 32, 189, 231, 103, 255, 195, 129, 226, 88, 38, 122, 54, 105, 83,
+            102, 200, 148, 152, 55, 224, 238, 104, 64, 140, 40, 44,
+        ],
+        [
+            18, 82, 230, 31, 144, 31, 240, 18, 127, 237, 48, 165, 173, 125, 216, 42, 162, 13, 28,
+            124, 153, 18, 17, 45, 44, 176, 214, 60, 102, 153, 177, 18,
+        ],
+        [
+            10, 199, 20, 92, 238, 49, 31, 43, 38, 104, 38, 113, 88, 32, 207, 71, 229, 34, 106, 126,
+            43, 249, 24, 17, 160, 207, 133, 37, 148, 115, 158, 50,
+        ],
+        [
+            221, 204, 123, 82, 227, 236, 230, 64, 31, 215, 60, 62, 158, 143, 0, 64, 155, 245, 217,
+            56, 122, 32, 0, 101, 97, 50, 195, 253, 180, 102, 116, 54,
+        ],
+        [
+            197, 157, 252, 45, 151, 7, 74, 165, 127, 57, 241, 132, 58, 148, 23, 25, 109, 28, 57,
+            57, 13, 248, 90, 58, 251, 218, 152, 10, 130, 155, 145, 47,
+        ],
+        [
+            206, 10, 180, 190, 173, 179, 139, 102, 34, 2, 20, 48, 56, 111, 227, 181, 51, 19, 215,
+            182, 56, 33, 176, 226, 168, 79, 157, 199, 157, 171, 52, 36,
+        ],
+        [
+            137, 140, 87, 36, 181, 252, 224, 59, 74, 44, 185, 157, 233, 12, 11, 156, 101, 254, 117,
+            18, 170, 253, 63, 99, 86, 216, 76, 79, 41, 143, 158, 48,
+        ],
+        [
+            125, 189, 147, 43, 201, 233, 79, 46, 181, 15, 208, 71, 166, 151, 8, 176, 113, 207, 120,
+            143, 4, 233, 139, 219, 201, 39, 208, 28, 175, 67, 198, 9,
+        ],
+    ],
+    [
+        [
+            22, 37, 53, 160, 237, 140, 57, 123, 148, 134, 144, 163, 194, 30, 81, 169, 197, 228, 71,
+            38, 137, 208, 166, 114, 242, 79, 76, 62, 162, 120, 252, 14,
+        ],
+        [
+            190, 105, 199, 169, 19, 226, 70, 173, 140, 172, 222, 75, 102, 132, 53, 177, 25, 6, 31,
+            202, 0, 6, 243, 47, 53, 103, 175, 18, 201, 165, 9, 12,
+        ],
+        [
+            106, 129, 69, 5, 170, 151, 240, 186, 237, 175, 20, 253, 40, 36, 236, 149, 101, 108,
+            117, 163, 42, 3, 159, 177, 223, 198, 149, 23, 235, 129, 28, 59,
+        ],
+        [
+            133, 72, 190, 211, 56, 227, 246, 179, 101, 144, 136, 137, 144, 142, 226, 105, 34, 78,
+            109, 103, 159, 87, 255, 103, 169, 40, 239, 110, 131, 156, 159, 12,
+        ],
+        [
+            245, 215, 211, 148, 84, 236, 188, 64, 63, 204, 85, 19, 186, 176, 159, 77, 234, 187, 87,
+            224, 232, 22, 67, 84, 104, 130, 82, 181, 103, 186, 96, 36,
+        ],
+        [
+            81, 145, 145, 5, 218, 219, 75, 245, 176, 51, 163, 96, 41, 53, 68, 66, 178, 46, 132,
+            255, 156, 136, 171, 119, 128, 182, 9, 125, 159, 93, 6, 24,
+        ],
+        [
+            174, 192, 45, 222, 156, 253, 141, 108, 134, 16, 64, 169, 140, 214, 116, 85, 206, 19,
+            143, 90, 191, 122, 191, 50, 120, 242, 12, 250, 50, 89, 166, 1,
+        ],
+        [
+            145, 122, 108, 141, 163, 122, 96, 198, 250, 29, 56, 173, 56, 129, 5, 192, 14, 164, 151,
+            18, 232, 155, 23, 242, 150, 129, 184, 71, 42, 211, 34, 37,
+        ],
+    ],
+    [
+        [
+            189, 187, 66, 97, 29, 216, 85, 51, 152, 120, 220, 104, 253, 201, 53, 132, 65, 240, 252,
+            220, 227, 35, 99, 171, 171, 146, 144, 19, 202, 90, 91, 41,
+        ],
+        [
+            72, 152, 255, 229, 122, 94, 187, 103, 248, 26, 154, 126, 54, 68, 234, 8, 202, 208, 155,
+            99, 159, 223, 101, 8, 54, 217, 49, 98, 108, 149, 98, 24,
+        ],
+        [
+            50, 232, 175, 207, 73, 18, 225, 218, 85, 236, 151, 102, 191, 232, 207, 250, 161, 234,
+            137, 249, 42, 243, 65, 15, 150, 29, 21, 86, 102, 192, 26, 32,
+        ],
+        [
+            40, 193, 12, 48, 4, 212, 39, 67, 231, 182, 218, 43, 11, 231, 75, 82, 24, 190, 132, 82,
+            27, 169, 140, 214, 162, 122, 191, 110, 225, 207, 185, 43,
+        ],
+        [
+            177, 1, 100, 87, 228, 136, 102, 8, 248, 170, 10, 58, 139, 21, 103, 168, 205, 234, 0,
+            28, 226, 183, 78, 51, 60, 54, 35, 247, 130, 199, 233, 59,
+        ],
+        [
+            181, 222, 23, 124, 138, 101, 61, 15, 49, 131, 173, 47, 224, 128, 118, 125, 66, 45, 68,
+            180, 215, 53, 226, 11, 226, 177, 103, 246, 43, 29, 102, 5,
+        ],
+        [
+            64, 123, 98, 247, 117, 240, 66, 217, 174, 246, 81, 150, 232, 133, 87, 229, 154, 43,
+            124, 143, 114, 78, 96, 39, 149, 89, 66, 131, 238, 217, 127, 8,
+        ],
+        [
+            115, 22, 38, 108, 115, 205, 105, 132, 105, 23, 113, 198, 46, 49, 30, 219, 57, 177, 189,
+            77, 143, 24, 58, 146, 219, 20, 25, 218, 0, 190, 172, 23,
+        ],
+    ],
+    [
+        [
+            166, 199, 164, 173, 14, 58, 189, 169, 19, 8, 20, 217, 59, 6, 227, 254, 3, 142, 27, 136,
+            252, 193, 94, 100, 59, 223, 58, 195, 186, 240, 4, 53,
+        ],
+        [
+            157, 20, 32, 77, 161, 28, 25, 124, 24, 76, 50, 122, 214, 108, 34, 240, 252, 230, 170,
+            213, 153, 250, 131, 108, 176, 84, 218, 246, 108, 45, 198, 10,
+        ],
+        [
+            124, 234, 207, 196, 216, 43, 64, 63, 61, 246, 48, 162, 149, 214, 6, 195, 194, 116, 146,
+            100, 169, 48, 64, 96, 106, 124, 215, 221, 87, 77, 185, 63,
+        ],
+        [
+            180, 35, 0, 153, 18, 168, 15, 109, 149, 209, 175, 145, 171, 236, 80, 140, 70, 253, 113,
+            127, 49, 137, 73, 116, 18, 135, 81, 199, 186, 178, 36, 18,
+        ],
+        [
+            124, 24, 76, 143, 58, 111, 89, 209, 97, 164, 199, 85, 178, 211, 185, 32, 102, 11, 228,
+            36, 191, 135, 71, 111, 163, 74, 109, 215, 152, 144, 47, 41,
+        ],
+        [
+            150, 183, 97, 110, 78, 33, 125, 152, 170, 254, 153, 118, 243, 79, 96, 147, 244, 171,
+            107, 192, 173, 19, 8, 252, 153, 34, 220, 25, 32, 238, 234, 20,
+        ],
+        [
+            142, 28, 82, 170, 186, 139, 148, 129, 61, 162, 120, 138, 168, 8, 244, 53, 249, 80, 4,
+            142, 211, 117, 188, 204, 11, 255, 178, 96, 230, 193, 245, 0,
+        ],
+        [
+            198, 214, 148, 238, 200, 11, 130, 194, 168, 46, 236, 82, 165, 75, 3, 19, 160, 232, 216,
+            70, 191, 29, 164, 144, 57, 60, 58, 212, 128, 226, 152, 24,
+        ],
+    ],
+    [
+        [
+            6, 94, 153, 100, 45, 112, 206, 104, 159, 95, 4, 92, 175, 185, 180, 113, 250, 110, 67,
+            166, 94, 228, 126, 186, 236, 64, 252, 84, 134, 208, 99, 17,
+        ],
+        [
+            134, 224, 207, 111, 61, 213, 5, 165, 226, 79, 208, 198, 130, 192, 89, 149, 242, 47, 53,
+            50, 206, 109, 157, 243, 99, 129, 215, 75, 181, 144, 117, 58,
+        ],
+        [
+            155, 174, 69, 67, 171, 111, 186, 235, 235, 192, 162, 14, 114, 66, 8, 99, 226, 82, 31,
+            134, 213, 214, 115, 222, 214, 211, 229, 184, 153, 7, 31, 13,
+        ],
+        [
+            181, 100, 30, 150, 176, 114, 167, 164, 173, 245, 138, 179, 201, 206, 116, 110, 33, 245,
+            104, 230, 172, 144, 182, 39, 160, 1, 55, 170, 171, 14, 97, 36,
+        ],
+        [
+            27, 182, 3, 193, 6, 114, 63, 211, 213, 111, 123, 204, 119, 182, 64, 168, 191, 189, 236,
+            169, 62, 102, 46, 10, 66, 233, 108, 95, 156, 5, 2, 17,
+        ],
+        [
+            252, 184, 10, 162, 39, 90, 220, 172, 255, 246, 129, 43, 70, 137, 87, 55, 3, 197, 79,
+            110, 208, 179, 213, 197, 8, 97, 207, 114, 63, 16, 35, 19,
+        ],
+        [
+            114, 84, 84, 248, 14, 96, 220, 105, 180, 236, 142, 134, 58, 183, 46, 126, 117, 238, 59,
+            233, 31, 32, 166, 80, 31, 170, 87, 81, 239, 167, 243, 20,
+        ],
+        [
+            70, 228, 140, 132, 194, 68, 145, 7, 226, 237, 165, 98, 214, 101, 204, 127, 42, 36, 184,
+            82, 253, 192, 72, 225, 215, 205, 242, 162, 212, 113, 64, 21,
+        ],
+    ],
+    [
+        [
+            88, 195, 125, 176, 127, 155, 224, 36, 205, 80, 207, 184, 175, 242, 195, 101, 204, 77,
+            215, 121, 230, 220, 29, 57, 131, 164, 115, 230, 76, 211, 215, 23,
+        ],
+        [
+            213, 195, 189, 198, 199, 49, 198, 15, 92, 101, 87, 99, 207, 99, 186, 213, 229, 179, 69,
+            71, 41, 140, 203, 153, 22, 155, 214, 226, 130, 175, 156, 62,
+        ],
+        [
+            166, 117, 91, 218, 251, 30, 251, 111, 174, 234, 219, 158, 177, 73, 166, 88, 204, 53,
+            27, 49, 235, 95, 205, 250, 155, 196, 152, 217, 130, 56, 145, 51,
+        ],
+        [
+            12, 180, 50, 125, 157, 91, 123, 81, 184, 183, 48, 213, 87, 185, 233, 171, 55, 204, 113,
+            238, 197, 226, 30, 163, 183, 131, 36, 135, 210, 12, 197, 42,
+        ],
+        [
+            175, 205, 39, 140, 182, 198, 178, 47, 247, 108, 237, 249, 97, 233, 180, 95, 123, 109,
+            1, 227, 242, 234, 128, 66, 217, 225, 8, 216, 228, 135, 20, 46,
+        ],
+        [
+            204, 48, 117, 11, 21, 101, 12, 185, 206, 97, 152, 180, 12, 104, 28, 71, 58, 176, 116,
+            10, 174, 103, 201, 82, 118, 74, 125, 197, 149, 216, 176, 4,
+        ],
+        [
+            150, 144, 226, 186, 64, 17, 254, 26, 21, 248, 118, 91, 180, 255, 125, 61, 67, 113, 25,
+            170, 155, 206, 110, 113, 66, 64, 88, 174, 131, 38, 196, 55,
+        ],
+        [
+            157, 181, 209, 189, 59, 76, 227, 183, 0, 161, 70, 233, 68, 56, 230, 107, 139, 252, 93,
+            167, 174, 72, 190, 77, 142, 215, 228, 199, 1, 60, 136, 56,
+        ],
+    ],
+    [
+        [
+            190, 92, 13, 8, 22, 229, 140, 76, 14, 27, 58, 56, 121, 150, 136, 228, 72, 103, 71, 115,
+            243, 253, 53, 81, 123, 38, 199, 219, 123, 19, 174, 14,
+        ],
+        [
+            7, 188, 24, 186, 0, 251, 54, 130, 213, 106, 143, 83, 155, 119, 206, 253, 249, 191, 54,
+            233, 191, 176, 42, 51, 93, 9, 163, 121, 219, 200, 214, 12,
+        ],
+        [
+            198, 163, 145, 80, 22, 184, 116, 216, 156, 139, 34, 249, 166, 116, 103, 145, 120, 158,
+            85, 102, 25, 27, 113, 121, 102, 190, 55, 151, 48, 240, 71, 32,
+        ],
+        [
+            204, 58, 122, 178, 78, 187, 138, 17, 175, 30, 44, 72, 40, 61, 247, 156, 165, 100, 129,
+            171, 82, 152, 58, 208, 228, 249, 238, 15, 169, 34, 87, 9,
+        ],
+        [
+            134, 168, 115, 14, 77, 100, 63, 169, 243, 160, 196, 220, 14, 1, 189, 106, 39, 109, 74,
+            95, 69, 13, 80, 153, 149, 228, 76, 44, 189, 217, 174, 14,
+        ],
+        [
+            159, 106, 117, 192, 70, 92, 68, 153, 97, 21, 78, 158, 38, 251, 73, 250, 232, 212, 81,
+            218, 132, 210, 141, 52, 154, 109, 180, 102, 26, 46, 237, 42,
+        ],
+        [
+            12, 163, 20, 229, 61, 228, 45, 24, 204, 20, 16, 67, 244, 76, 55, 249, 80, 75, 21, 138,
+            253, 198, 255, 253, 92, 251, 90, 177, 226, 0, 189, 42,
+        ],
+        [
+            122, 234, 40, 6, 65, 195, 69, 149, 59, 88, 230, 156, 205, 111, 77, 80, 8, 79, 75, 165,
+            237, 130, 130, 223, 115, 216, 16, 83, 191, 48, 199, 35,
+        ],
+    ],
+    [
+        [
+            120, 206, 29, 206, 231, 94, 118, 231, 142, 12, 21, 55, 86, 131, 101, 140, 149, 39, 143,
+            47, 153, 183, 84, 124, 235, 181, 72, 47, 36, 106, 118, 26,
+        ],
+        [
+            228, 137, 53, 107, 172, 135, 152, 135, 60, 72, 14, 251, 236, 200, 210, 82, 179, 124,
+            204, 92, 40, 155, 7, 230, 141, 192, 49, 132, 97, 89, 119, 22,
+        ],
+        [
+            207, 29, 225, 197, 86, 135, 65, 28, 17, 153, 15, 136, 28, 124, 240, 84, 14, 201, 29,
+            194, 140, 205, 231, 108, 243, 100, 134, 59, 67, 249, 95, 34,
+        ],
+        [
+            234, 84, 54, 160, 181, 164, 65, 6, 15, 193, 237, 165, 148, 82, 153, 142, 39, 239, 134,
+            40, 164, 122, 235, 29, 102, 186, 216, 29, 103, 239, 85, 50,
+        ],
+        [
+            58, 194, 136, 114, 154, 163, 206, 220, 211, 122, 144, 102, 109, 22, 30, 145, 234, 170,
+            24, 252, 71, 139, 166, 193, 151, 227, 118, 9, 63, 209, 24, 52,
+        ],
+        [
+            69, 95, 192, 151, 92, 184, 83, 24, 138, 189, 254, 51, 192, 141, 121, 211, 54, 121, 107,
+            109, 187, 240, 161, 244, 54, 11, 205, 41, 49, 186, 58, 21,
+        ],
+        [
+            174, 72, 170, 165, 97, 229, 216, 108, 52, 175, 217, 144, 65, 170, 178, 72, 57, 244,
+            217, 93, 90, 59, 133, 150, 65, 222, 78, 168, 142, 10, 65, 57,
+        ],
+        [
+            64, 55, 77, 9, 97, 224, 252, 144, 123, 19, 154, 107, 90, 176, 121, 15, 30, 43, 94, 233,
+            86, 28, 92, 121, 22, 29, 194, 229, 26, 46, 23, 24,
+        ],
+    ],
+    [
+        [
+            76, 60, 120, 126, 240, 28, 211, 52, 21, 189, 35, 153, 162, 242, 177, 158, 251, 118,
+            212, 37, 42, 83, 34, 73, 67, 232, 149, 198, 196, 87, 158, 15,
+        ],
+        [
+            157, 158, 65, 83, 61, 63, 54, 50, 65, 74, 210, 115, 194, 223, 77, 138, 137, 78, 188,
+            14, 117, 203, 104, 45, 48, 199, 130, 1, 54, 149, 206, 35,
+        ],
+        [
+            231, 191, 185, 71, 252, 217, 195, 188, 72, 190, 22, 41, 42, 147, 166, 69, 42, 126, 125,
+            168, 48, 63, 127, 44, 181, 189, 110, 141, 72, 178, 125, 29,
+        ],
+        [
+            94, 64, 125, 170, 1, 131, 212, 24, 147, 151, 15, 73, 177, 8, 135, 160, 201, 115, 241,
+            136, 247, 184, 211, 13, 64, 206, 126, 239, 224, 73, 215, 55,
+        ],
+        [
+            12, 37, 188, 206, 231, 212, 14, 180, 159, 225, 82, 255, 232, 11, 128, 28, 50, 95, 1,
+            131, 203, 4, 17, 66, 239, 193, 151, 123, 253, 68, 20, 40,
+        ],
+        [
+            48, 80, 138, 22, 87, 172, 103, 208, 138, 14, 164, 65, 191, 235, 51, 248, 21, 117, 129,
+            248, 199, 128, 126, 210, 189, 57, 67, 150, 178, 8, 188, 62,
+        ],
+        [
+            98, 115, 183, 93, 165, 143, 231, 214, 229, 168, 250, 179, 9, 43, 102, 129, 189, 8, 138,
+            149, 215, 140, 100, 168, 27, 152, 140, 252, 36, 109, 62, 49,
+        ],
+        [
+            82, 184, 171, 186, 244, 111, 194, 186, 63, 45, 8, 90, 97, 130, 102, 112, 185, 70, 182,
+            92, 197, 253, 122, 124, 196, 164, 170, 25, 180, 117, 94, 2,
+        ],
+    ],
+    [
+        [
+            209, 225, 106, 206, 153, 240, 154, 163, 143, 89, 129, 19, 20, 45, 44, 223, 64, 38, 34,
+            208, 9, 151, 85, 171, 182, 89, 137, 36, 163, 41, 84, 42,
+        ],
+        [
+            146, 188, 65, 87, 122, 69, 148, 30, 80, 176, 184, 33, 3, 77, 156, 203, 73, 230, 231,
+            12, 22, 232, 26, 143, 91, 35, 206, 246, 43, 55, 3, 9,
+        ],
+        [
+            25, 114, 90, 10, 192, 14, 159, 234, 190, 73, 105, 222, 143, 2, 98, 30, 107, 18, 49, 35,
+            100, 255, 185, 20, 52, 155, 150, 175, 35, 209, 41, 39,
+        ],
+        [
+            191, 153, 7, 52, 5, 119, 8, 21, 199, 194, 163, 24, 199, 76, 185, 128, 49, 18, 54, 206,
+            252, 101, 181, 105, 101, 3, 93, 250, 139, 110, 105, 17,
+        ],
+        [
+            187, 224, 140, 3, 152, 10, 215, 106, 92, 32, 53, 193, 164, 49, 85, 248, 152, 217, 148,
+            69, 206, 67, 202, 77, 40, 134, 1, 233, 36, 57, 255, 60,
+        ],
+        [
+            174, 28, 43, 241, 197, 16, 52, 191, 5, 12, 100, 203, 128, 228, 95, 21, 139, 30, 27,
+            151, 49, 131, 188, 119, 245, 70, 113, 118, 64, 72, 182, 6,
+        ],
+        [
+            48, 252, 34, 196, 173, 44, 133, 85, 67, 13, 237, 191, 29, 5, 184, 67, 133, 144, 192,
+            38, 19, 37, 175, 108, 156, 242, 21, 223, 11, 119, 165, 14,
+        ],
+        [
+            100, 197, 0, 213, 89, 62, 88, 131, 238, 25, 108, 172, 133, 12, 34, 14, 9, 130, 39, 54,
+            188, 4, 61, 243, 131, 108, 22, 70, 116, 37, 210, 34,
+        ],
+    ],
+    [
+        [
+            170, 138, 180, 84, 35, 21, 13, 177, 134, 125, 153, 82, 70, 64, 27, 75, 162, 161, 10,
+            198, 105, 36, 120, 166, 182, 214, 103, 117, 229, 138, 80, 59,
+        ],
+        [
+            84, 95, 68, 119, 210, 84, 69, 165, 136, 57, 55, 153, 132, 67, 66, 82, 213, 80, 68, 108,
+            192, 184, 190, 202, 40, 243, 116, 24, 142, 112, 174, 57,
+        ],
+        [
+            88, 41, 176, 199, 215, 98, 157, 224, 41, 6, 229, 129, 207, 52, 114, 203, 182, 27, 82,
+            185, 68, 102, 126, 6, 49, 224, 172, 179, 169, 23, 67, 50,
+        ],
+        [
+            13, 39, 165, 156, 39, 15, 143, 254, 19, 44, 221, 98, 41, 248, 51, 162, 124, 244, 145,
+            66, 77, 238, 2, 159, 167, 130, 5, 165, 148, 217, 126, 39,
+        ],
+        [
+            243, 178, 255, 129, 211, 199, 156, 239, 252, 157, 180, 156, 233, 49, 20, 122, 235, 112,
+            107, 104, 128, 111, 10, 39, 225, 187, 190, 216, 237, 133, 116, 27,
+        ],
+        [
+            62, 140, 130, 27, 124, 177, 228, 42, 137, 63, 23, 176, 132, 100, 20, 235, 149, 6, 30,
+            226, 243, 86, 218, 62, 39, 167, 124, 40, 114, 50, 151, 44,
+        ],
+        [
+            153, 186, 80, 123, 183, 144, 118, 245, 93, 213, 158, 238, 76, 61, 218, 113, 80, 97,
+            193, 199, 84, 3, 88, 133, 168, 218, 248, 41, 216, 231, 132, 54,
+        ],
+        [
+            24, 13, 231, 102, 64, 93, 142, 32, 95, 124, 165, 112, 146, 124, 94, 71, 147, 194, 180,
+            81, 138, 95, 198, 173, 135, 219, 180, 238, 55, 175, 0, 49,
+        ],
+    ],
+    [
+        [
+            191, 67, 109, 233, 253, 99, 144, 145, 112, 41, 12, 226, 34, 38, 59, 104, 32, 46, 165,
+            134, 63, 12, 240, 107, 124, 170, 157, 95, 123, 77, 51, 11,
+        ],
+        [
+            253, 176, 178, 255, 113, 102, 61, 37, 130, 48, 154, 203, 106, 34, 89, 133, 223, 16, 46,
+            161, 228, 11, 168, 58, 124, 111, 180, 95, 205, 178, 201, 8,
+        ],
+        [
+            45, 51, 116, 58, 87, 136, 35, 53, 226, 3, 240, 236, 196, 23, 79, 255, 236, 129, 129,
+            153, 110, 21, 32, 121, 214, 66, 53, 39, 32, 121, 155, 26,
+        ],
+        [
+            253, 55, 59, 249, 128, 61, 95, 130, 99, 194, 200, 12, 129, 70, 56, 130, 60, 163, 84,
+            203, 119, 27, 142, 56, 171, 128, 144, 207, 208, 220, 33, 18,
+        ],
+        [
+            255, 59, 215, 178, 200, 172, 206, 53, 251, 202, 242, 148, 156, 247, 117, 226, 60, 145,
+            122, 154, 15, 205, 138, 253, 158, 133, 46, 103, 33, 12, 85, 26,
+        ],
+        [
+            51, 26, 129, 30, 187, 55, 234, 9, 36, 14, 6, 19, 54, 209, 189, 240, 226, 122, 219, 186,
+            62, 106, 52, 89, 242, 4, 177, 214, 20, 228, 188, 18,
+        ],
+        [
+            43, 93, 69, 179, 7, 206, 234, 199, 244, 76, 82, 200, 246, 125, 21, 1, 124, 142, 3, 76,
+            21, 1, 237, 236, 151, 249, 71, 38, 159, 159, 239, 48,
+        ],
+        [
+            230, 77, 223, 241, 62, 17, 127, 49, 233, 34, 99, 218, 95, 132, 99, 158, 50, 81, 121,
+            208, 225, 109, 68, 170, 238, 26, 147, 195, 178, 33, 157, 16,
+        ],
+    ],
+    [
+        [
+            52, 186, 178, 89, 121, 159, 161, 108, 165, 177, 92, 184, 149, 101, 171, 153, 70, 215,
+            46, 200, 193, 14, 188, 34, 192, 141, 24, 210, 156, 81, 217, 41,
+        ],
+        [
+            205, 99, 134, 116, 97, 224, 2, 77, 29, 77, 88, 53, 0, 111, 15, 56, 74, 172, 166, 150,
+            133, 93, 146, 253, 3, 100, 190, 133, 11, 46, 40, 62,
+        ],
+        [
+            202, 120, 227, 229, 35, 128, 155, 243, 255, 108, 76, 195, 219, 96, 86, 121, 217, 111,
+            11, 121, 77, 228, 175, 2, 23, 102, 78, 193, 249, 10, 139, 10,
+        ],
+        [
+            128, 219, 91, 150, 191, 196, 135, 27, 205, 245, 32, 8, 15, 40, 90, 201, 73, 241, 31,
+            207, 216, 225, 129, 90, 173, 32, 108, 126, 59, 32, 11, 19,
+        ],
+        [
+            31, 172, 118, 187, 18, 112, 69, 208, 250, 115, 34, 50, 221, 213, 209, 55, 44, 127, 130,
+            196, 190, 155, 247, 254, 2, 195, 231, 155, 169, 158, 198, 60,
+        ],
+        [
+            205, 109, 204, 106, 223, 114, 189, 146, 15, 175, 189, 220, 55, 7, 242, 114, 99, 96, 81,
+            181, 204, 132, 253, 3, 52, 216, 47, 37, 58, 52, 227, 21,
+        ],
+        [
+            232, 76, 28, 95, 190, 76, 135, 35, 133, 206, 252, 224, 237, 123, 84, 47, 188, 253, 5,
+            178, 145, 176, 232, 227, 7, 230, 89, 213, 199, 47, 66, 32,
+        ],
+        [
+            71, 151, 218, 212, 133, 48, 92, 62, 72, 154, 75, 10, 186, 210, 198, 146, 53, 18, 173,
+            172, 60, 110, 21, 166, 252, 53, 239, 211, 36, 189, 156, 1,
+        ],
+    ],
+    [
+        [
+            33, 207, 156, 240, 223, 153, 52, 29, 223, 44, 214, 249, 177, 30, 23, 32, 99, 199, 159,
+            161, 175, 245, 85, 144, 14, 118, 163, 72, 111, 135, 0, 41,
+        ],
+        [
+            110, 244, 91, 45, 63, 22, 57, 91, 73, 106, 99, 88, 146, 118, 14, 176, 186, 228, 14, 83,
+            140, 189, 143, 197, 194, 135, 97, 41, 116, 113, 163, 30,
+        ],
+        [
+            137, 86, 251, 125, 228, 181, 116, 52, 60, 174, 181, 79, 70, 211, 93, 128, 143, 17, 107,
+            48, 241, 58, 140, 58, 240, 34, 167, 4, 67, 26, 212, 29,
+        ],
+        [
+            108, 217, 222, 116, 191, 191, 47, 61, 96, 84, 106, 166, 253, 5, 212, 60, 163, 168, 156,
+            145, 186, 129, 244, 187, 152, 235, 40, 36, 173, 231, 185, 56,
+        ],
+        [
+            144, 139, 139, 57, 138, 79, 237, 42, 243, 255, 137, 46, 60, 236, 0, 124, 151, 172, 130,
+            131, 4, 37, 255, 157, 112, 141, 248, 116, 32, 21, 169, 1,
+        ],
+        [
+            109, 149, 1, 115, 108, 63, 68, 192, 91, 49, 234, 90, 143, 98, 248, 92, 202, 207, 144,
+            86, 0, 26, 65, 235, 156, 131, 11, 74, 112, 175, 247, 14,
+        ],
+        [
+            18, 194, 249, 56, 144, 151, 10, 107, 87, 48, 179, 117, 7, 100, 38, 220, 26, 2, 18, 160,
+            171, 125, 140, 213, 171, 82, 189, 98, 96, 3, 235, 5,
+        ],
+        [
+            44, 108, 31, 136, 128, 150, 86, 40, 251, 99, 8, 150, 157, 135, 28, 214, 158, 60, 242,
+            29, 123, 252, 85, 65, 172, 61, 241, 230, 140, 29, 224, 27,
+        ],
+    ],
+    [
+        [
+            72, 96, 81, 44, 138, 199, 176, 84, 134, 126, 188, 123, 88, 83, 37, 233, 31, 237, 230,
+            160, 15, 57, 252, 28, 79, 176, 8, 136, 160, 168, 180, 54,
+        ],
+        [
+            236, 204, 160, 217, 80, 141, 110, 37, 12, 106, 216, 168, 97, 147, 225, 178, 243, 91,
+            144, 177, 162, 143, 29, 238, 45, 191, 217, 169, 17, 6, 82, 15,
+        ],
+        [
+            151, 37, 164, 32, 139, 47, 139, 135, 64, 90, 53, 139, 250, 31, 129, 155, 38, 132, 99,
+            202, 75, 25, 233, 151, 238, 122, 231, 45, 178, 23, 36, 7,
+        ],
+        [
+            145, 211, 54, 13, 50, 237, 143, 95, 233, 219, 250, 67, 255, 72, 244, 202, 26, 178, 61,
+            233, 52, 109, 106, 30, 246, 249, 34, 126, 72, 113, 240, 4,
+        ],
+        [
+            113, 166, 236, 160, 205, 43, 161, 37, 126, 197, 172, 121, 235, 101, 42, 43, 143, 199,
+            111, 177, 23, 42, 51, 220, 232, 188, 92, 235, 139, 183, 170, 3,
+        ],
+        [
+            236, 93, 71, 61, 20, 98, 70, 157, 157, 108, 146, 80, 225, 245, 166, 244, 14, 223, 41,
+            191, 206, 212, 140, 195, 99, 13, 112, 217, 191, 189, 57, 22,
+        ],
+        [
+            110, 80, 126, 40, 242, 214, 43, 231, 72, 57, 159, 88, 36, 146, 13, 25, 198, 55, 233,
+            134, 49, 87, 14, 198, 40, 68, 245, 50, 182, 195, 172, 32,
+        ],
+        [
+            138, 47, 67, 28, 155, 85, 91, 243, 199, 109, 115, 119, 160, 15, 14, 10, 252, 133, 3,
+            75, 35, 17, 189, 159, 27, 1, 163, 166, 144, 211, 110, 11,
+        ],
+    ],
+    [
+        [
+            31, 79, 187, 42, 20, 82, 51, 24, 96, 195, 51, 150, 237, 25, 238, 211, 26, 151, 165,
+            162, 158, 98, 38, 255, 134, 178, 213, 60, 249, 77, 5, 2,
+        ],
+        [
+            97, 204, 217, 104, 57, 122, 48, 148, 131, 78, 36, 83, 200, 202, 85, 8, 163, 120, 189,
+            42, 109, 236, 11, 100, 221, 32, 84, 136, 26, 126, 107, 53,
+        ],
+        [
+            80, 195, 31, 107, 117, 133, 195, 140, 109, 176, 18, 91, 213, 153, 80, 1, 68, 254, 42,
+            238, 24, 189, 171, 105, 94, 59, 219, 230, 22, 176, 107, 9,
+        ],
+        [
+            141, 33, 117, 234, 88, 61, 132, 175, 21, 196, 141, 130, 123, 155, 29, 70, 66, 189, 3,
+            171, 12, 150, 97, 145, 117, 192, 81, 68, 6, 28, 96, 28,
+        ],
+        [
+            200, 160, 161, 9, 64, 94, 205, 144, 62, 116, 255, 185, 94, 175, 20, 167, 217, 78, 234,
+            1, 1, 122, 238, 184, 69, 233, 201, 85, 254, 138, 212, 39,
+        ],
+        [
+            109, 185, 122, 128, 51, 220, 226, 181, 98, 114, 82, 142, 251, 224, 39, 161, 4, 27, 155,
+            185, 175, 78, 71, 250, 103, 160, 191, 44, 50, 253, 150, 48,
+        ],
+        [
+            63, 60, 25, 196, 216, 52, 106, 139, 111, 73, 150, 237, 22, 80, 63, 12, 198, 131, 217,
+            24, 217, 222, 1, 154, 107, 121, 42, 206, 71, 231, 85, 24,
+        ],
+        [
+            110, 208, 119, 152, 113, 49, 42, 110, 242, 125, 32, 238, 131, 123, 132, 102, 46, 60,
+            111, 90, 37, 46, 79, 200, 142, 181, 136, 54, 102, 115, 166, 45,
+        ],
+    ],
+    [
+        [
+            65, 117, 127, 35, 217, 86, 9, 239, 179, 241, 114, 13, 75, 195, 58, 239, 152, 49, 225,
+            92, 93, 1, 35, 31, 117, 45, 132, 152, 184, 111, 227, 62,
+        ],
+        [
+            28, 50, 160, 235, 129, 142, 99, 208, 77, 124, 228, 209, 205, 199, 158, 149, 244, 14,
+            22, 129, 93, 116, 205, 167, 237, 75, 238, 150, 8, 21, 160, 10,
+        ],
+        [
+            240, 31, 142, 228, 114, 27, 182, 196, 65, 166, 251, 35, 97, 252, 58, 32, 207, 217, 94,
+            11, 22, 44, 35, 143, 234, 143, 112, 21, 225, 43, 124, 35,
+        ],
+        [
+            84, 215, 38, 31, 55, 68, 5, 227, 30, 70, 197, 135, 157, 55, 132, 110, 17, 239, 55, 150,
+            66, 94, 111, 156, 61, 134, 129, 252, 80, 136, 109, 3,
+        ],
+        [
+            244, 5, 160, 73, 65, 202, 125, 239, 79, 248, 118, 146, 198, 46, 179, 29, 27, 183, 162,
+            224, 163, 29, 88, 196, 95, 77, 15, 162, 245, 208, 121, 58,
+        ],
+        [
+            33, 142, 135, 112, 143, 47, 193, 39, 170, 223, 34, 145, 60, 197, 160, 23, 233, 22, 82,
+            189, 91, 251, 186, 21, 238, 69, 58, 194, 34, 58, 40, 9,
+        ],
+        [
+            46, 205, 15, 203, 124, 46, 93, 43, 68, 29, 165, 195, 225, 198, 170, 60, 23, 136, 96,
+            65, 54, 231, 238, 94, 94, 2, 16, 171, 167, 138, 105, 16,
+        ],
+        [
+            10, 116, 71, 4, 152, 209, 8, 163, 77, 5, 23, 146, 141, 186, 60, 94, 39, 117, 33, 20, 5,
+            3, 156, 67, 221, 79, 57, 111, 72, 37, 126, 51,
+        ],
+    ],
+    [
+        [
+            191, 166, 185, 94, 206, 142, 77, 46, 132, 158, 245, 234, 48, 226, 49, 249, 39, 60, 88,
+            14, 224, 91, 91, 163, 161, 166, 103, 20, 190, 13, 116, 19,
+        ],
+        [
+            51, 216, 164, 99, 24, 233, 245, 224, 152, 116, 137, 45, 246, 190, 47, 222, 130, 135,
+            57, 245, 95, 18, 139, 248, 200, 158, 124, 75, 9, 72, 222, 22,
+        ],
+        [
+            11, 200, 108, 211, 187, 171, 183, 33, 91, 144, 221, 192, 112, 246, 92, 195, 14, 243,
+            116, 64, 122, 238, 227, 49, 72, 133, 228, 133, 36, 105, 65, 44,
+        ],
+        [
+            97, 255, 190, 195, 103, 126, 180, 211, 73, 73, 8, 155, 205, 46, 78, 148, 212, 87, 193,
+            107, 121, 190, 164, 242, 251, 238, 87, 198, 180, 148, 171, 30,
+        ],
+        [
+            146, 130, 197, 213, 1, 97, 12, 6, 210, 55, 145, 213, 55, 243, 71, 83, 117, 160, 62,
+            201, 72, 75, 160, 185, 107, 235, 22, 189, 164, 222, 197, 10,
+        ],
+        [
+            187, 238, 229, 171, 0, 101, 27, 153, 124, 37, 3, 122, 43, 192, 182, 104, 220, 157, 180,
+            252, 88, 120, 29, 197, 199, 109, 94, 10, 196, 187, 183, 9,
+        ],
+        [
+            240, 83, 124, 167, 254, 134, 93, 87, 81, 207, 252, 115, 47, 49, 33, 65, 200, 33, 186,
+            176, 72, 31, 149, 189, 19, 122, 236, 228, 129, 163, 231, 41,
+        ],
+        [
+            8, 130, 118, 127, 122, 91, 123, 43, 98, 65, 35, 242, 64, 136, 15, 55, 191, 136, 4, 26,
+            157, 157, 138, 218, 75, 204, 240, 144, 61, 53, 99, 62,
+        ],
+    ],
+    [
+        [
+            160, 12, 147, 196, 134, 124, 67, 246, 5, 2, 69, 220, 231, 138, 227, 129, 126, 185, 74,
+            155, 236, 207, 218, 212, 238, 22, 0, 157, 94, 85, 24, 6,
+        ],
+        [
+            138, 4, 163, 194, 25, 156, 50, 92, 111, 33, 7, 26, 69, 110, 26, 194, 70, 115, 87, 232,
+            187, 92, 183, 40, 206, 229, 191, 48, 9, 75, 8, 42,
+        ],
+        [
+            144, 61, 87, 235, 101, 165, 69, 137, 69, 225, 109, 196, 47, 204, 127, 42, 158, 121, 50,
+            27, 129, 66, 148, 82, 79, 154, 189, 5, 115, 100, 17, 35,
+        ],
+        [
+            87, 218, 178, 199, 26, 202, 96, 153, 160, 84, 208, 0, 84, 46, 32, 221, 97, 63, 161,
+            235, 61, 34, 111, 119, 91, 179, 51, 175, 158, 71, 156, 34,
+        ],
+        [
+            189, 150, 38, 95, 146, 100, 0, 105, 233, 4, 173, 80, 206, 50, 53, 160, 40, 167, 33,
+            234, 80, 54, 99, 4, 41, 55, 46, 209, 140, 210, 143, 57,
+        ],
+        [
+            25, 185, 233, 107, 108, 66, 45, 50, 152, 110, 164, 20, 199, 231, 35, 48, 66, 116, 149,
+            211, 214, 134, 127, 152, 63, 102, 27, 33, 90, 16, 216, 50,
+        ],
+        [
+            77, 105, 46, 102, 27, 172, 194, 72, 49, 15, 105, 118, 41, 16, 161, 168, 226, 172, 47,
+            111, 115, 141, 123, 82, 160, 242, 69, 32, 125, 21, 44, 14,
+        ],
+        [
+            198, 193, 51, 219, 107, 174, 135, 49, 208, 46, 134, 81, 121, 111, 246, 128, 198, 48,
+            158, 216, 160, 175, 107, 116, 51, 156, 87, 45, 238, 142, 66, 0,
+        ],
+    ],
+    [
+        [
+            228, 186, 23, 81, 165, 67, 155, 142, 246, 246, 111, 141, 210, 130, 233, 51, 211, 146,
+            202, 26, 110, 46, 212, 39, 154, 170, 63, 110, 31, 238, 80, 0,
+        ],
+        [
+            140, 202, 146, 110, 94, 220, 222, 80, 20, 41, 163, 129, 65, 188, 13, 58, 224, 0, 215,
+            183, 33, 118, 158, 219, 197, 78, 110, 143, 63, 70, 21, 15,
+        ],
+        [
+            71, 155, 232, 76, 80, 9, 234, 144, 163, 24, 181, 206, 34, 218, 60, 75, 159, 106, 75,
+            94, 218, 241, 17, 5, 169, 237, 87, 239, 51, 126, 174, 12,
+        ],
+        [
+            68, 14, 217, 104, 199, 117, 220, 170, 82, 113, 240, 86, 146, 132, 62, 68, 71, 63, 72,
+            67, 170, 58, 28, 113, 136, 167, 66, 29, 90, 185, 131, 10,
+        ],
+        [
+            124, 223, 201, 195, 99, 243, 62, 202, 157, 49, 112, 118, 126, 180, 56, 109, 13, 58, 38,
+            146, 240, 112, 157, 47, 149, 136, 68, 241, 122, 150, 37, 23,
+        ],
+        [
+            19, 217, 47, 84, 231, 168, 141, 240, 13, 102, 26, 80, 70, 109, 70, 142, 83, 149, 253,
+            102, 136, 214, 198, 184, 89, 232, 43, 180, 94, 57, 237, 59,
+        ],
+        [
+            2, 164, 113, 50, 147, 55, 23, 208, 109, 197, 30, 13, 248, 111, 194, 13, 229, 73, 91,
+            166, 195, 175, 210, 198, 179, 60, 221, 87, 104, 70, 218, 26,
+        ],
+        [
+            17, 160, 102, 238, 191, 46, 46, 161, 64, 238, 175, 98, 139, 219, 113, 56, 87, 78, 228,
+            246, 100, 155, 192, 172, 221, 72, 238, 31, 204, 49, 35, 54,
+        ],
+    ],
+    [
+        [
+            42, 238, 87, 78, 76, 206, 132, 112, 92, 251, 61, 98, 151, 105, 49, 204, 234, 104, 116,
+            42, 176, 84, 72, 114, 111, 247, 18, 125, 165, 27, 250, 60,
+        ],
+        [
+            192, 195, 201, 56, 49, 145, 231, 71, 125, 128, 185, 1, 116, 183, 81, 142, 207, 148,
+            159, 32, 184, 160, 8, 39, 8, 100, 43, 218, 96, 50, 107, 57,
+        ],
+        [
+            161, 28, 139, 96, 155, 238, 224, 98, 1, 109, 199, 72, 193, 233, 77, 40, 223, 139, 126,
+            165, 233, 112, 9, 39, 61, 37, 172, 130, 252, 255, 231, 55,
+        ],
+        [
+            148, 189, 23, 30, 46, 255, 1, 123, 106, 99, 45, 7, 65, 202, 55, 188, 236, 162, 182, 70,
+            38, 204, 120, 93, 114, 107, 159, 91, 250, 140, 57, 57,
+        ],
+        [
+            51, 190, 71, 10, 22, 62, 37, 160, 168, 87, 199, 129, 183, 99, 225, 142, 247, 162, 123,
+            57, 44, 239, 49, 212, 91, 166, 5, 116, 83, 223, 225, 22,
+        ],
+        [
+            105, 203, 12, 226, 205, 192, 204, 244, 44, 237, 186, 143, 3, 235, 29, 157, 45, 95, 190,
+            177, 140, 218, 246, 125, 107, 136, 39, 11, 171, 15, 165, 15,
+        ],
+        [
+            40, 63, 140, 161, 128, 218, 185, 176, 105, 10, 235, 239, 69, 132, 86, 207, 77, 47, 176,
+            71, 250, 98, 164, 8, 158, 67, 139, 106, 185, 21, 241, 45,
+        ],
+        [
+            113, 187, 121, 32, 76, 47, 222, 172, 149, 197, 166, 55, 51, 145, 35, 53, 127, 181, 124,
+            87, 228, 146, 246, 19, 131, 251, 25, 177, 8, 37, 166, 53,
+        ],
+    ],
+    [
+        [
+            18, 1, 130, 209, 3, 70, 234, 9, 136, 82, 114, 124, 75, 221, 153, 20, 31, 238, 248, 78,
+            148, 136, 42, 184, 143, 43, 26, 126, 200, 61, 80, 57,
+        ],
+        [
+            225, 98, 72, 37, 222, 154, 100, 214, 73, 206, 129, 29, 27, 131, 81, 32, 182, 243, 185,
+            93, 84, 0, 151, 201, 243, 111, 89, 42, 117, 167, 99, 34,
+        ],
+        [
+            118, 227, 216, 225, 147, 147, 53, 116, 60, 220, 139, 31, 1, 124, 185, 10, 157, 49, 42,
+            132, 235, 10, 161, 152, 137, 48, 32, 206, 86, 213, 221, 32,
+        ],
+        [
+            254, 51, 99, 58, 209, 148, 243, 37, 169, 11, 22, 249, 168, 97, 56, 119, 21, 77, 50,
+            144, 156, 65, 220, 104, 229, 213, 153, 30, 42, 240, 156, 31,
+        ],
+        [
+            15, 208, 192, 113, 116, 160, 10, 101, 148, 128, 253, 44, 233, 9, 78, 22, 56, 25, 98,
+            54, 63, 55, 113, 147, 151, 161, 116, 34, 245, 39, 75, 3,
+        ],
+        [
+            210, 150, 121, 196, 177, 196, 184, 180, 88, 219, 232, 40, 89, 169, 87, 199, 227, 151,
+            251, 74, 249, 12, 128, 2, 208, 145, 98, 160, 150, 112, 200, 5,
+        ],
+        [
+            253, 175, 188, 74, 246, 2, 160, 24, 157, 187, 41, 151, 103, 79, 161, 226, 146, 151, 46,
+            208, 37, 5, 86, 126, 191, 153, 231, 94, 147, 101, 189, 5,
+        ],
+        [
+            15, 30, 205, 151, 176, 243, 96, 206, 110, 125, 116, 143, 234, 172, 254, 151, 148, 18,
+            25, 224, 83, 167, 228, 13, 47, 241, 58, 218, 76, 104, 93, 3,
+        ],
+    ],
+    [
+        [
+            72, 10, 136, 27, 24, 16, 41, 48, 68, 158, 58, 254, 35, 250, 247, 107, 227, 74, 234, 98,
+            97, 242, 9, 158, 70, 85, 49, 198, 203, 11, 230, 20,
+        ],
+        [
+            214, 243, 43, 26, 120, 31, 250, 32, 6, 32, 255, 63, 75, 36, 248, 24, 236, 39, 227, 136,
+            236, 50, 219, 231, 16, 127, 24, 172, 146, 96, 244, 59,
+        ],
+        [
+            96, 191, 165, 84, 42, 112, 128, 149, 53, 170, 114, 219, 238, 65, 138, 252, 190, 104,
+            95, 28, 80, 239, 185, 250, 14, 0, 70, 112, 95, 96, 37, 48,
+        ],
+        [
+            23, 136, 200, 26, 146, 148, 183, 211, 0, 39, 126, 89, 25, 17, 253, 149, 215, 73, 33,
+            67, 99, 1, 207, 32, 180, 34, 81, 116, 182, 105, 39, 33,
+        ],
+        [
+            87, 95, 184, 76, 228, 106, 105, 36, 159, 100, 80, 25, 234, 27, 214, 63, 43, 106, 183,
+            209, 28, 154, 57, 252, 1, 33, 107, 197, 64, 155, 206, 45,
+        ],
+        [
+            61, 125, 226, 15, 206, 94, 85, 192, 206, 85, 168, 220, 114, 189, 128, 250, 80, 50, 167,
+            65, 231, 176, 99, 21, 82, 43, 218, 99, 153, 198, 55, 56,
+        ],
+        [
+            21, 41, 65, 249, 187, 151, 1, 15, 58, 96, 102, 96, 128, 158, 199, 143, 110, 200, 182,
+            55, 15, 40, 227, 249, 70, 24, 155, 205, 177, 248, 68, 36,
+        ],
+        [
+            153, 93, 124, 9, 139, 102, 83, 232, 141, 176, 183, 178, 149, 222, 54, 14, 181, 4, 83,
+            113, 81, 218, 84, 31, 86, 230, 20, 226, 169, 169, 147, 20,
+        ],
+    ],
+    [
+        [
+            42, 6, 69, 242, 47, 170, 149, 121, 142, 185, 225, 212, 167, 145, 100, 105, 224, 168,
+            223, 75, 70, 49, 78, 136, 148, 163, 129, 189, 213, 99, 57, 7,
+        ],
+        [
+            202, 48, 49, 166, 179, 127, 171, 43, 179, 215, 185, 98, 122, 169, 76, 163, 162, 152,
+            151, 234, 229, 1, 174, 31, 106, 210, 184, 103, 68, 174, 231, 14,
+        ],
+        [
+            4, 1, 223, 186, 118, 214, 99, 238, 170, 254, 46, 156, 164, 66, 220, 145, 35, 249, 225,
+            0, 146, 146, 32, 90, 63, 225, 4, 213, 120, 168, 202, 31,
+        ],
+        [
+            191, 2, 7, 207, 2, 3, 132, 59, 8, 17, 130, 119, 167, 244, 65, 80, 33, 93, 217, 36, 196,
+            247, 121, 191, 101, 80, 78, 103, 89, 253, 243, 4,
+        ],
+        [
+            9, 202, 97, 46, 9, 57, 25, 238, 13, 173, 253, 219, 178, 11, 191, 62, 82, 207, 231, 62,
+            8, 85, 176, 21, 98, 73, 141, 255, 69, 71, 22, 2,
+        ],
+        [
+            60, 6, 122, 230, 204, 92, 159, 86, 44, 51, 165, 228, 157, 166, 23, 89, 139, 113, 97,
+            190, 96, 11, 249, 114, 210, 177, 241, 181, 193, 129, 248, 45,
+        ],
+        [
+            127, 187, 205, 131, 198, 160, 221, 214, 70, 29, 3, 78, 25, 70, 87, 81, 163, 105, 247,
+            244, 39, 47, 27, 201, 134, 108, 160, 68, 208, 167, 154, 19,
+        ],
+        [
+            88, 198, 1, 133, 122, 100, 181, 13, 161, 66, 143, 128, 97, 99, 180, 200, 72, 50, 81,
+            197, 140, 51, 43, 34, 107, 170, 115, 22, 89, 214, 148, 19,
+        ],
+    ],
+    [
+        [
+            209, 79, 29, 202, 130, 199, 138, 237, 198, 43, 240, 165, 246, 59, 173, 155, 149, 89,
+            176, 38, 98, 32, 55, 57, 108, 38, 39, 35, 198, 30, 70, 19,
+        ],
+        [
+            62, 138, 183, 26, 93, 155, 177, 41, 76, 46, 239, 209, 50, 0, 254, 176, 243, 143, 41,
+            55, 205, 156, 52, 194, 186, 253, 134, 3, 91, 137, 64, 60,
+        ],
+        [
+            80, 193, 154, 56, 1, 162, 178, 97, 39, 58, 89, 158, 81, 12, 66, 239, 39, 78, 240, 163,
+            245, 197, 106, 91, 36, 144, 179, 175, 242, 170, 115, 9,
+        ],
+        [
+            88, 53, 242, 253, 61, 8, 226, 3, 32, 199, 199, 180, 38, 237, 102, 177, 91, 144, 79, 16,
+            43, 224, 47, 42, 149, 106, 48, 178, 185, 78, 194, 13,
+        ],
+        [
+            185, 170, 69, 129, 68, 165, 94, 97, 241, 117, 27, 40, 168, 74, 208, 125, 41, 231, 207,
+            184, 204, 188, 239, 161, 170, 101, 109, 96, 40, 127, 9, 47,
+        ],
+        [
+            81, 215, 213, 32, 75, 212, 14, 16, 55, 113, 242, 220, 197, 92, 200, 96, 231, 48, 87,
+            21, 233, 175, 160, 133, 37, 83, 165, 1, 105, 134, 137, 53,
+        ],
+        [
+            42, 175, 116, 152, 103, 108, 52, 117, 235, 100, 55, 253, 99, 9, 170, 189, 196, 204,
+            243, 121, 96, 28, 164, 2, 84, 75, 93, 32, 35, 74, 106, 19,
+        ],
+        [
+            205, 37, 25, 223, 168, 4, 64, 239, 149, 231, 158, 24, 100, 88, 21, 68, 153, 174, 171,
+            142, 203, 23, 79, 195, 120, 135, 251, 184, 199, 198, 118, 59,
+        ],
+    ],
+    [
+        [
+            236, 72, 236, 182, 97, 100, 170, 247, 194, 142, 191, 163, 104, 232, 55, 188, 179, 3,
+            241, 161, 130, 187, 201, 135, 36, 107, 194, 11, 58, 37, 198, 21,
+        ],
+        [
+            162, 108, 210, 213, 229, 7, 184, 128, 48, 218, 122, 152, 34, 44, 255, 129, 8, 7, 70,
+            159, 165, 102, 133, 198, 89, 136, 9, 210, 81, 209, 125, 62,
+        ],
+        [
+            19, 122, 208, 53, 54, 195, 80, 105, 130, 108, 101, 232, 213, 250, 94, 143, 34, 16, 123,
+            22, 85, 24, 222, 116, 81, 77, 146, 123, 63, 109, 155, 25,
+        ],
+        [
+            20, 202, 194, 34, 23, 228, 108, 225, 197, 169, 220, 145, 3, 87, 252, 183, 201, 134, 9,
+            70, 26, 33, 233, 245, 90, 40, 9, 193, 145, 177, 137, 30,
+        ],
+        [
+            142, 118, 192, 79, 106, 86, 122, 98, 133, 200, 92, 17, 203, 195, 232, 141, 214, 22,
+            103, 255, 60, 51, 44, 88, 64, 130, 184, 251, 182, 235, 174, 33,
+        ],
+        [
+            136, 174, 114, 92, 123, 204, 141, 133, 43, 185, 26, 57, 221, 186, 86, 185, 32, 212, 97,
+            202, 226, 129, 224, 47, 143, 83, 70, 209, 87, 203, 198, 21,
+        ],
+        [
+            59, 223, 14, 205, 86, 189, 127, 244, 44, 140, 133, 52, 255, 246, 253, 24, 44, 25, 191,
+            198, 49, 247, 200, 84, 150, 16, 205, 200, 110, 226, 60, 51,
+        ],
+        [
+            196, 65, 164, 48, 29, 211, 202, 47, 236, 1, 149, 74, 82, 175, 50, 154, 47, 128, 24,
+            144, 152, 172, 164, 95, 48, 1, 175, 159, 21, 247, 184, 45,
+        ],
+    ],
+    [
+        [
+            113, 63, 185, 131, 212, 136, 143, 154, 164, 166, 141, 78, 33, 22, 153, 205, 188, 108,
+            173, 204, 209, 27, 18, 248, 69, 250, 136, 134, 86, 66, 2, 25,
+        ],
+        [
+            81, 213, 197, 160, 99, 146, 255, 95, 58, 208, 199, 37, 174, 131, 30, 27, 44, 119, 238,
+            23, 8, 85, 177, 30, 23, 198, 236, 206, 160, 196, 192, 37,
+        ],
+        [
+            137, 140, 108, 240, 119, 166, 103, 173, 83, 168, 239, 88, 58, 195, 143, 255, 23, 197,
+            34, 204, 167, 220, 180, 119, 136, 63, 224, 235, 87, 32, 22, 19,
+        ],
+        [
+            9, 120, 1, 228, 172, 242, 68, 238, 34, 31, 73, 46, 221, 161, 229, 216, 212, 51, 236,
+            60, 129, 118, 235, 30, 173, 98, 105, 92, 38, 48, 179, 63,
+        ],
+        [
+            101, 254, 224, 108, 2, 7, 51, 58, 155, 127, 90, 231, 44, 99, 139, 228, 104, 107, 248,
+            235, 10, 231, 131, 133, 26, 9, 5, 238, 79, 173, 149, 53,
+        ],
+        [
+            173, 174, 13, 8, 187, 48, 186, 134, 32, 196, 154, 196, 109, 220, 41, 70, 235, 190, 7,
+            157, 94, 233, 100, 151, 26, 193, 252, 252, 204, 166, 215, 19,
+        ],
+        [
+            28, 95, 198, 85, 93, 171, 70, 119, 154, 50, 27, 16, 190, 246, 143, 130, 168, 183, 89,
+            119, 4, 58, 205, 161, 105, 28, 156, 158, 83, 20, 197, 49,
+        ],
+        [
+            113, 106, 199, 144, 147, 223, 231, 150, 7, 222, 112, 180, 120, 139, 99, 219, 8, 246,
+            89, 224, 255, 179, 139, 176, 16, 103, 178, 74, 156, 40, 204, 37,
+        ],
+    ],
+    [
+        [
+            38, 34, 221, 71, 220, 112, 148, 120, 84, 22, 39, 92, 53, 80, 244, 119, 64, 234, 90, 97,
+            135, 161, 115, 110, 22, 189, 44, 36, 23, 85, 38, 60,
+        ],
+        [
+            213, 170, 91, 62, 172, 9, 75, 190, 253, 21, 22, 180, 194, 51, 94, 46, 65, 244, 206,
+            220, 81, 152, 136, 195, 45, 33, 133, 242, 112, 223, 144, 7,
+        ],
+        [
+            29, 76, 103, 10, 234, 122, 243, 58, 113, 123, 43, 25, 116, 213, 214, 178, 247, 113,
+            135, 238, 148, 58, 116, 97, 83, 203, 1, 208, 121, 52, 38, 13,
+        ],
+        [
+            23, 152, 157, 192, 12, 28, 52, 28, 155, 182, 184, 142, 66, 105, 69, 154, 59, 92, 117,
+            37, 115, 67, 17, 111, 24, 253, 41, 147, 51, 203, 39, 46,
+        ],
+        [
+            255, 207, 178, 103, 215, 12, 12, 158, 83, 240, 123, 146, 137, 235, 116, 25, 102, 144,
+            56, 182, 234, 251, 238, 201, 56, 41, 137, 96, 239, 216, 162, 34,
+        ],
+        [
+            148, 146, 139, 236, 159, 116, 15, 54, 141, 119, 201, 163, 202, 166, 244, 120, 14, 220,
+            191, 209, 31, 121, 208, 243, 120, 106, 102, 3, 129, 135, 29, 36,
+        ],
+        [
+            80, 37, 232, 226, 149, 80, 204, 156, 22, 11, 19, 34, 221, 211, 204, 75, 173, 150, 68,
+            253, 109, 0, 156, 187, 182, 100, 79, 74, 250, 255, 2, 62,
+        ],
+        [
+            155, 207, 110, 75, 63, 173, 133, 240, 21, 108, 245, 233, 80, 114, 0, 221, 114, 148, 5,
+            141, 127, 163, 96, 9, 253, 75, 91, 74, 137, 126, 94, 59,
+        ],
+    ],
+    [
+        [
+            235, 150, 195, 122, 252, 131, 216, 100, 102, 193, 233, 212, 79, 117, 151, 50, 246, 124,
+            8, 1, 247, 254, 208, 90, 247, 231, 240, 3, 86, 82, 75, 58,
+        ],
+        [
+            41, 49, 135, 170, 77, 96, 175, 215, 190, 42, 192, 62, 122, 169, 219, 246, 241, 143, 42,
+            119, 172, 141, 224, 125, 128, 75, 40, 154, 90, 163, 236, 9,
+        ],
+        [
+            206, 138, 164, 80, 147, 233, 240, 203, 111, 52, 22, 4, 38, 199, 245, 224, 203, 7, 14,
+            101, 212, 245, 30, 178, 177, 76, 194, 55, 43, 124, 155, 15,
+        ],
+        [
+            93, 30, 127, 191, 82, 233, 253, 219, 58, 221, 171, 157, 164, 145, 223, 121, 11, 152,
+            114, 200, 186, 150, 146, 87, 11, 48, 157, 85, 162, 36, 127, 8,
+        ],
+        [
+            95, 35, 201, 218, 74, 87, 138, 236, 183, 10, 32, 124, 190, 37, 47, 8, 136, 96, 117,
+            164, 62, 4, 77, 251, 40, 70, 172, 22, 186, 85, 29, 30,
+        ],
+        [
+            133, 23, 191, 232, 143, 103, 124, 29, 186, 196, 156, 170, 254, 197, 48, 205, 114, 31,
+            159, 157, 72, 26, 86, 115, 177, 128, 75, 211, 207, 109, 187, 40,
+        ],
+        [
+            129, 18, 198, 231, 250, 247, 65, 206, 32, 191, 126, 179, 56, 192, 26, 255, 151, 215,
+            103, 101, 40, 182, 203, 39, 100, 126, 202, 129, 173, 114, 208, 46,
+        ],
+        [
+            232, 235, 95, 198, 201, 94, 246, 81, 82, 104, 27, 178, 133, 79, 120, 171, 186, 171, 89,
+            233, 83, 28, 26, 22, 73, 23, 229, 8, 239, 200, 19, 27,
+        ],
+    ],
+    [
+        [
+            210, 71, 108, 215, 152, 32, 62, 185, 111, 112, 16, 4, 13, 227, 37, 156, 126, 114, 174,
+            38, 138, 245, 46, 170, 103, 115, 52, 113, 17, 234, 43, 34,
+        ],
+        [
+            210, 57, 57, 191, 219, 197, 56, 74, 5, 219, 191, 250, 122, 229, 56, 27, 192, 255, 143,
+            226, 134, 81, 82, 20, 228, 137, 206, 11, 203, 171, 194, 2,
+        ],
+        [
+            2, 78, 48, 95, 121, 129, 100, 124, 153, 168, 144, 254, 51, 226, 117, 249, 102, 93, 236,
+            209, 195, 58, 248, 173, 65, 106, 174, 194, 116, 87, 96, 57,
+        ],
+        [
+            241, 60, 10, 54, 190, 93, 196, 234, 99, 112, 230, 21, 141, 232, 41, 30, 250, 202, 112,
+            58, 179, 160, 100, 1, 209, 6, 141, 184, 63, 124, 137, 38,
+        ],
+        [
+            58, 21, 254, 142, 179, 18, 16, 67, 218, 111, 138, 59, 181, 29, 207, 76, 39, 76, 177,
+            120, 66, 64, 22, 178, 208, 40, 155, 120, 211, 84, 207, 21,
+        ],
+        [
+            174, 159, 153, 25, 242, 221, 84, 226, 243, 117, 42, 141, 100, 128, 90, 79, 193, 255,
+            179, 12, 31, 233, 79, 219, 143, 35, 12, 139, 59, 105, 189, 25,
+        ],
+        [
+            218, 68, 43, 94, 237, 195, 110, 37, 78, 248, 223, 30, 109, 144, 98, 161, 59, 211, 240,
+            180, 222, 116, 134, 183, 183, 166, 97, 66, 241, 222, 53, 18,
+        ],
+        [
+            245, 148, 191, 198, 199, 1, 171, 246, 89, 150, 11, 34, 102, 248, 117, 200, 37, 182,
+            103, 126, 70, 226, 218, 203, 11, 125, 121, 32, 18, 230, 243, 18,
+        ],
+    ],
+    [
+        [
+            255, 144, 208, 132, 52, 254, 117, 148, 102, 19, 153, 74, 6, 56, 14, 56, 0, 104, 184,
+            201, 182, 204, 210, 221, 180, 73, 127, 109, 252, 126, 24, 33,
+        ],
+        [
+            47, 153, 208, 169, 51, 149, 24, 41, 69, 165, 93, 193, 209, 66, 187, 89, 18, 193, 252,
+            170, 55, 6, 107, 77, 170, 123, 155, 171, 170, 110, 41, 13,
+        ],
+        [
+            168, 134, 125, 156, 48, 7, 212, 22, 221, 205, 11, 8, 187, 85, 52, 124, 218, 128, 24,
+            106, 88, 190, 65, 166, 34, 120, 160, 186, 50, 209, 57, 27,
+        ],
+        [
+            12, 230, 242, 95, 27, 44, 255, 38, 151, 185, 224, 26, 193, 155, 36, 198, 219, 80, 217,
+            78, 29, 16, 14, 160, 95, 137, 114, 98, 32, 28, 117, 16,
+        ],
+        [
+            19, 221, 130, 39, 185, 145, 167, 178, 12, 122, 174, 141, 109, 15, 59, 92, 217, 193, 8,
+            140, 77, 168, 45, 8, 43, 157, 217, 73, 46, 223, 82, 23,
+        ],
+        [
+            11, 218, 183, 42, 61, 124, 53, 72, 153, 53, 169, 155, 23, 136, 33, 20, 216, 88, 174,
+            50, 165, 138, 100, 174, 31, 151, 244, 200, 102, 163, 211, 45,
+        ],
+        [
+            40, 208, 183, 220, 99, 217, 214, 147, 127, 3, 227, 197, 133, 174, 177, 28, 89, 48, 195,
+            227, 55, 51, 79, 76, 252, 236, 8, 4, 74, 196, 102, 57,
+        ],
+        [
+            217, 25, 168, 251, 68, 161, 167, 143, 58, 241, 41, 14, 245, 47, 92, 191, 48, 195, 26,
+            228, 238, 180, 236, 8, 105, 149, 218, 119, 31, 56, 177, 56,
+        ],
+    ],
+    [
+        [
+            31, 98, 35, 5, 253, 140, 112, 75, 250, 170, 119, 208, 186, 119, 54, 79, 34, 155, 132,
+            123, 178, 111, 84, 7, 45, 231, 74, 65, 216, 235, 174, 16,
+        ],
+        [
+            197, 28, 157, 33, 185, 182, 123, 128, 223, 137, 177, 196, 237, 219, 169, 53, 32, 100,
+            251, 238, 92, 182, 118, 231, 8, 2, 229, 32, 143, 187, 243, 11,
+        ],
+        [
+            53, 49, 78, 10, 50, 233, 255, 107, 193, 56, 21, 50, 236, 45, 145, 145, 147, 62, 44,
+            111, 70, 71, 175, 53, 203, 148, 52, 67, 100, 19, 26, 3,
+        ],
+        [
+            161, 103, 224, 78, 117, 78, 234, 195, 253, 216, 60, 242, 228, 181, 84, 115, 93, 60, 78,
+            177, 233, 239, 55, 51, 87, 29, 91, 73, 160, 22, 171, 28,
+        ],
+        [
+            106, 94, 122, 161, 158, 123, 47, 190, 164, 230, 236, 39, 112, 190, 86, 119, 220, 119,
+            136, 5, 205, 153, 136, 144, 195, 36, 8, 31, 156, 77, 197, 7,
+        ],
+        [
+            84, 189, 79, 111, 149, 133, 18, 214, 25, 129, 102, 3, 255, 214, 137, 117, 145, 219,
+            122, 117, 251, 157, 67, 103, 112, 156, 101, 60, 196, 24, 228, 9,
+        ],
+        [
+            221, 128, 184, 19, 209, 70, 94, 235, 168, 5, 193, 131, 176, 112, 12, 162, 60, 52, 126,
+            165, 78, 106, 205, 247, 39, 129, 58, 66, 183, 218, 92, 34,
+        ],
+        [
+            37, 90, 158, 71, 194, 0, 179, 71, 130, 53, 224, 14, 163, 30, 186, 122, 241, 4, 160,
+            224, 157, 159, 58, 19, 72, 213, 191, 207, 214, 79, 97, 7,
+        ],
+    ],
+    [
+        [
+            17, 77, 140, 150, 199, 124, 25, 200, 242, 238, 45, 141, 236, 5, 130, 183, 54, 235, 128,
+            228, 212, 54, 81, 133, 39, 76, 208, 190, 12, 132, 119, 11,
+        ],
+        [
+            107, 215, 140, 18, 7, 122, 91, 92, 146, 39, 245, 151, 85, 68, 229, 96, 154, 146, 33,
+            101, 126, 111, 236, 5, 204, 109, 157, 205, 70, 121, 217, 0,
+        ],
+        [
+            70, 94, 179, 106, 229, 170, 170, 47, 55, 65, 230, 43, 24, 82, 194, 151, 155, 198, 165,
+            155, 205, 28, 14, 104, 20, 71, 197, 140, 250, 71, 125, 17,
+        ],
+        [
+            106, 252, 217, 245, 224, 67, 205, 117, 213, 48, 7, 135, 102, 189, 26, 18, 4, 54, 28,
+            251, 124, 84, 93, 0, 40, 66, 115, 117, 204, 79, 228, 22,
+        ],
+        [
+            242, 35, 187, 88, 191, 59, 140, 236, 161, 109, 107, 209, 136, 246, 243, 27, 223, 98,
+            151, 100, 212, 119, 181, 232, 39, 21, 93, 43, 28, 54, 121, 28,
+        ],
+        [
+            71, 151, 100, 227, 73, 205, 19, 3, 130, 251, 173, 106, 89, 57, 39, 39, 122, 133, 165,
+            156, 3, 206, 44, 215, 128, 92, 207, 248, 158, 242, 254, 0,
+        ],
+        [
+            135, 68, 93, 82, 180, 183, 2, 251, 43, 188, 239, 107, 205, 155, 212, 29, 221, 31, 106,
+            214, 183, 206, 119, 193, 233, 125, 198, 221, 69, 92, 33, 62,
+        ],
+        [
+            30, 16, 32, 89, 21, 239, 233, 59, 207, 112, 12, 6, 215, 78, 169, 126, 167, 25, 242, 72,
+            91, 134, 70, 202, 21, 211, 175, 45, 241, 46, 126, 19,
+        ],
+    ],
+    [
+        [
+            239, 132, 33, 38, 102, 212, 72, 89, 11, 15, 97, 253, 10, 0, 7, 0, 193, 147, 176, 43,
+            213, 38, 141, 110, 55, 61, 127, 15, 217, 159, 199, 41,
+        ],
+        [
+            214, 253, 151, 31, 243, 238, 244, 4, 240, 234, 253, 169, 181, 192, 6, 57, 219, 163,
+            185, 123, 103, 228, 127, 129, 214, 214, 43, 225, 63, 75, 182, 53,
+        ],
+        [
+            32, 79, 73, 179, 13, 71, 33, 110, 122, 154, 127, 57, 134, 49, 208, 108, 5, 172, 153,
+            147, 192, 46, 212, 252, 33, 114, 20, 39, 244, 63, 96, 59,
+        ],
+        [
+            235, 135, 102, 44, 198, 110, 108, 192, 212, 172, 181, 10, 197, 131, 11, 220, 40, 83,
+            211, 8, 182, 147, 94, 90, 76, 129, 90, 194, 77, 213, 126, 55,
+        ],
+        [
+            134, 43, 3, 60, 183, 128, 197, 163, 170, 11, 127, 13, 12, 251, 24, 190, 45, 105, 181,
+            131, 97, 232, 88, 155, 212, 247, 110, 50, 247, 242, 78, 11,
+        ],
+        [
+            107, 99, 135, 228, 201, 238, 31, 15, 7, 159, 61, 63, 134, 124, 107, 227, 233, 133, 57,
+            126, 106, 183, 205, 196, 222, 230, 130, 213, 208, 64, 99, 20,
+        ],
+        [
+            136, 191, 122, 221, 143, 194, 149, 206, 210, 101, 122, 87, 41, 73, 39, 0, 203, 249,
+            255, 105, 157, 67, 114, 227, 107, 204, 112, 134, 137, 141, 192, 40,
+        ],
+        [
+            53, 251, 202, 6, 165, 211, 68, 162, 219, 79, 119, 243, 221, 34, 46, 97, 240, 59, 81,
+            62, 192, 122, 250, 188, 247, 91, 173, 184, 16, 162, 228, 42,
+        ],
+    ],
+    [
+        [
+            207, 188, 203, 116, 227, 47, 15, 94, 109, 85, 244, 221, 60, 114, 166, 91, 220, 124,
+            217, 87, 15, 10, 223, 41, 201, 185, 195, 188, 26, 179, 0, 42,
+        ],
+        [
+            169, 222, 42, 237, 79, 30, 175, 161, 31, 217, 5, 161, 189, 73, 91, 163, 120, 84, 89,
+            232, 151, 51, 37, 39, 130, 149, 209, 68, 215, 4, 169, 47,
+        ],
+        [
+            227, 83, 192, 240, 71, 1, 222, 202, 123, 190, 215, 154, 182, 192, 122, 211, 174, 143,
+            187, 185, 69, 74, 141, 161, 31, 218, 147, 239, 72, 246, 120, 4,
+        ],
+        [
+            137, 27, 69, 79, 29, 209, 12, 234, 186, 93, 226, 104, 95, 211, 110, 68, 30, 100, 164,
+            236, 245, 45, 0, 29, 59, 22, 176, 196, 130, 184, 217, 27,
+        ],
+        [
+            26, 62, 9, 239, 203, 49, 46, 166, 96, 81, 208, 1, 72, 8, 94, 190, 19, 237, 242, 213,
+            15, 157, 31, 240, 39, 122, 94, 8, 171, 16, 159, 28,
+        ],
+        [
+            191, 213, 238, 242, 171, 187, 13, 177, 204, 117, 29, 64, 237, 164, 165, 236, 142, 220,
+            60, 63, 61, 57, 146, 155, 58, 206, 128, 15, 73, 253, 188, 9,
+        ],
+        [
+            184, 134, 37, 128, 143, 22, 57, 204, 184, 89, 54, 236, 170, 123, 109, 20, 114, 172,
+            121, 243, 37, 217, 219, 38, 71, 67, 51, 49, 13, 31, 79, 36,
+        ],
+        [
+            223, 219, 38, 58, 177, 64, 40, 107, 71, 58, 211, 112, 35, 73, 154, 52, 180, 252, 153,
+            239, 154, 5, 210, 15, 116, 102, 250, 226, 17, 79, 2, 0,
+        ],
+    ],
+    [
+        [
+            86, 108, 216, 34, 154, 182, 132, 72, 67, 161, 20, 204, 92, 218, 109, 31, 146, 215, 73,
+            85, 186, 63, 178, 83, 74, 63, 115, 248, 215, 203, 131, 31,
+        ],
+        [
+            68, 146, 252, 110, 32, 80, 133, 118, 93, 102, 51, 124, 114, 76, 141, 132, 243, 175, 35,
+            2, 151, 83, 90, 137, 188, 59, 33, 45, 144, 241, 77, 59,
+        ],
+        [
+            199, 168, 25, 87, 146, 91, 7, 45, 196, 18, 34, 77, 121, 59, 49, 171, 218, 111, 121,
+            144, 67, 17, 163, 60, 41, 184, 123, 35, 107, 158, 204, 42,
+        ],
+        [
+            81, 34, 122, 126, 218, 213, 211, 210, 132, 204, 13, 131, 85, 187, 237, 173, 173, 72,
+            210, 134, 63, 167, 97, 139, 126, 221, 254, 217, 147, 76, 48, 36,
+        ],
+        [
+            212, 17, 78, 238, 49, 160, 218, 85, 86, 250, 124, 160, 63, 77, 80, 153, 20, 197, 70,
+            88, 8, 92, 28, 108, 34, 214, 138, 234, 220, 191, 6, 42,
+        ],
+        [
+            121, 219, 39, 10, 207, 76, 241, 73, 84, 53, 101, 47, 129, 70, 245, 235, 249, 253, 118,
+            193, 89, 63, 27, 201, 16, 103, 193, 199, 206, 22, 188, 4,
+        ],
+        [
+            32, 135, 154, 90, 39, 88, 11, 21, 28, 118, 172, 80, 157, 117, 227, 194, 95, 21, 193,
+            244, 134, 48, 20, 209, 135, 51, 22, 226, 172, 35, 170, 32,
+        ],
+        [
+            43, 221, 151, 128, 141, 210, 207, 198, 229, 190, 198, 122, 10, 175, 184, 64, 55, 212,
+            147, 45, 67, 156, 35, 168, 175, 147, 89, 191, 250, 231, 99, 62,
+        ],
+    ],
+    [
+        [
+            243, 133, 64, 65, 91, 46, 144, 139, 138, 115, 84, 217, 89, 221, 170, 23, 2, 205, 113,
+            152, 46, 159, 81, 126, 63, 7, 137, 165, 116, 51, 40, 11,
+        ],
+        [
+            109, 94, 105, 247, 230, 206, 57, 126, 225, 207, 205, 33, 125, 9, 155, 204, 119, 58,
+            221, 209, 138, 16, 203, 96, 189, 26, 45, 92, 3, 36, 48, 9,
+        ],
+        [
+            254, 204, 107, 219, 208, 50, 17, 142, 30, 121, 107, 37, 62, 51, 152, 159, 53, 134, 215,
+            86, 73, 214, 25, 237, 64, 69, 212, 112, 191, 153, 246, 44,
+        ],
+        [
+            99, 148, 101, 253, 131, 235, 77, 241, 22, 107, 74, 217, 103, 175, 136, 203, 69, 61,
+            221, 193, 214, 8, 102, 175, 83, 121, 218, 128, 206, 159, 25, 23,
+        ],
+        [
+            111, 64, 79, 248, 50, 79, 231, 252, 52, 151, 216, 18, 195, 193, 18, 109, 126, 164, 43,
+            102, 23, 39, 211, 247, 10, 29, 172, 211, 182, 31, 245, 13,
+        ],
+        [
+            3, 86, 28, 24, 154, 35, 148, 150, 230, 16, 146, 211, 24, 184, 121, 224, 111, 36, 128,
+            45, 67, 71, 97, 234, 173, 172, 203, 44, 219, 134, 47, 22,
+        ],
+        [
+            62, 127, 47, 223, 234, 188, 44, 197, 94, 21, 47, 75, 38, 226, 46, 82, 214, 220, 94,
+            205, 176, 252, 226, 208, 85, 7, 191, 28, 217, 158, 83, 13,
+        ],
+        [
+            96, 225, 72, 121, 83, 10, 196, 69, 54, 68, 161, 232, 58, 131, 166, 200, 208, 196, 134,
+            18, 85, 234, 37, 244, 239, 42, 197, 250, 60, 118, 37, 4,
+        ],
+    ],
+    [
+        [
+            100, 154, 11, 180, 188, 20, 222, 46, 29, 254, 104, 147, 128, 159, 209, 246, 95, 79, 6,
+            158, 211, 154, 74, 202, 45, 8, 199, 59, 67, 89, 31, 36,
+        ],
+        [
+            59, 218, 141, 48, 106, 107, 91, 63, 20, 57, 51, 66, 177, 136, 20, 151, 170, 87, 166,
+            122, 26, 134, 223, 101, 144, 92, 104, 253, 117, 115, 198, 48,
+        ],
+        [
+            6, 234, 190, 8, 45, 67, 212, 14, 215, 229, 43, 147, 98, 177, 241, 248, 142, 172, 9, 27,
+            42, 223, 91, 180, 75, 219, 159, 182, 205, 5, 110, 1,
+        ],
+        [
+            139, 41, 229, 150, 94, 20, 37, 79, 90, 170, 31, 21, 106, 60, 63, 40, 225, 44, 156, 254,
+            70, 77, 196, 147, 128, 130, 180, 151, 41, 75, 158, 33,
+        ],
+        [
+            139, 111, 3, 218, 41, 122, 103, 61, 112, 106, 17, 227, 74, 93, 112, 194, 70, 21, 101,
+            116, 48, 164, 124, 20, 170, 241, 78, 147, 89, 107, 12, 37,
+        ],
+        [
+            135, 10, 234, 73, 60, 129, 112, 145, 165, 224, 166, 60, 131, 105, 236, 222, 39, 59,
+            227, 161, 113, 246, 119, 103, 24, 162, 5, 55, 245, 221, 19, 11,
+        ],
+        [
+            79, 204, 186, 89, 248, 255, 253, 34, 43, 99, 55, 53, 162, 27, 15, 51, 206, 113, 185,
+            154, 102, 75, 154, 80, 115, 51, 169, 203, 111, 57, 253, 15,
+        ],
+        [
+            241, 70, 150, 96, 14, 181, 110, 248, 200, 60, 151, 32, 56, 236, 1, 160, 207, 239, 204,
+            96, 180, 20, 114, 141, 204, 79, 222, 42, 233, 93, 86, 4,
+        ],
+    ],
+    [
+        [
+            133, 42, 108, 146, 9, 233, 159, 193, 246, 146, 58, 201, 35, 57, 51, 79, 31, 110, 185,
+            80, 198, 123, 90, 212, 230, 44, 5, 125, 69, 245, 133, 8,
+        ],
+        [
+            229, 72, 83, 102, 213, 54, 195, 176, 137, 144, 238, 18, 31, 192, 209, 173, 251, 255,
+            140, 176, 244, 204, 213, 213, 163, 231, 2, 147, 229, 252, 61, 45,
+        ],
+        [
+            71, 127, 51, 61, 4, 61, 154, 153, 6, 190, 184, 184, 246, 195, 97, 120, 73, 143, 135,
+            84, 154, 23, 119, 144, 120, 38, 55, 242, 88, 180, 27, 19,
+        ],
+        [
+            75, 52, 60, 75, 156, 190, 238, 12, 77, 247, 183, 176, 64, 156, 173, 107, 27, 154, 11,
+            252, 58, 116, 8, 98, 74, 169, 127, 147, 196, 228, 107, 32,
+        ],
+        [
+            148, 235, 145, 32, 227, 216, 189, 85, 81, 174, 122, 74, 29, 157, 193, 199, 131, 131,
+            215, 200, 40, 168, 165, 204, 234, 158, 148, 212, 238, 62, 183, 18,
+        ],
+        [
+            154, 181, 252, 201, 70, 152, 237, 106, 10, 69, 44, 207, 168, 233, 5, 104, 110, 68, 207,
+            203, 85, 242, 149, 191, 125, 123, 34, 246, 37, 233, 36, 44,
+        ],
+        [
+            211, 231, 62, 59, 210, 172, 126, 106, 177, 163, 74, 94, 201, 226, 57, 90, 138, 213,
+            177, 154, 128, 11, 241, 24, 122, 183, 243, 189, 220, 68, 234, 7,
+        ],
+        [
+            56, 235, 124, 129, 101, 66, 101, 95, 248, 36, 151, 219, 71, 118, 126, 54, 161, 159,
+            130, 62, 236, 239, 129, 232, 227, 45, 180, 127, 204, 15, 191, 41,
+        ],
+    ],
+    [
+        [
+            58, 7, 140, 180, 114, 238, 131, 202, 207, 64, 62, 207, 210, 71, 132, 77, 52, 11, 81,
+            73, 215, 25, 106, 0, 178, 254, 238, 8, 223, 22, 116, 55,
+        ],
+        [
+            223, 58, 89, 147, 0, 219, 48, 190, 127, 47, 35, 39, 120, 55, 84, 162, 29, 15, 239, 70,
+            105, 190, 179, 179, 161, 77, 68, 62, 74, 245, 2, 0,
+        ],
+        [
+            119, 42, 91, 164, 172, 227, 112, 30, 94, 87, 129, 68, 103, 131, 240, 24, 28, 173, 61,
+            51, 123, 176, 110, 204, 238, 162, 214, 123, 67, 43, 77, 61,
+        ],
+        [
+            234, 137, 155, 145, 183, 245, 247, 147, 139, 194, 96, 144, 204, 154, 159, 94, 97, 150,
+            59, 129, 113, 213, 0, 184, 73, 215, 212, 114, 207, 10, 31, 30,
+        ],
+        [
+            42, 90, 73, 230, 113, 98, 152, 59, 179, 244, 222, 133, 142, 178, 172, 225, 57, 210, 95,
+            96, 162, 203, 63, 245, 108, 203, 167, 94, 125, 54, 162, 58,
+        ],
+        [
+            240, 196, 76, 186, 213, 181, 225, 51, 212, 188, 155, 194, 158, 183, 234, 110, 181, 97,
+            93, 116, 201, 160, 208, 67, 218, 169, 210, 210, 11, 33, 212, 7,
+        ],
+        [
+            68, 105, 62, 121, 37, 69, 237, 189, 194, 25, 197, 246, 64, 28, 252, 193, 66, 110, 140,
+            255, 218, 86, 133, 31, 198, 252, 165, 237, 73, 22, 15, 60,
+        ],
+        [
+            210, 33, 63, 244, 100, 40, 160, 16, 81, 38, 120, 211, 176, 13, 155, 255, 113, 214, 10,
+            73, 204, 178, 186, 189, 207, 91, 142, 112, 152, 74, 42, 17,
+        ],
+    ],
+    [
+        [
+            65, 190, 3, 42, 54, 225, 195, 120, 113, 25, 19, 40, 59, 78, 139, 70, 53, 104, 84, 240,
+            93, 38, 233, 201, 29, 218, 43, 14, 16, 238, 1, 3,
+        ],
+        [
+            94, 85, 50, 4, 205, 48, 215, 233, 248, 185, 111, 219, 70, 219, 70, 1, 2, 75, 187, 253,
+            5, 210, 180, 219, 163, 252, 251, 224, 27, 158, 205, 35,
+        ],
+        [
+            145, 45, 21, 30, 132, 8, 164, 37, 104, 121, 240, 200, 86, 247, 240, 166, 128, 202, 205,
+            12, 252, 53, 120, 60, 180, 106, 148, 158, 111, 18, 126, 40,
+        ],
+        [
+            53, 47, 28, 89, 156, 147, 71, 72, 158, 73, 217, 107, 73, 132, 49, 120, 42, 30, 182,
+            213, 150, 114, 90, 223, 215, 71, 92, 251, 21, 142, 200, 0,
+        ],
+        [
+            21, 187, 146, 84, 186, 214, 154, 62, 147, 23, 51, 157, 249, 201, 137, 79, 187, 184,
+            129, 149, 53, 241, 85, 154, 207, 58, 122, 229, 14, 246, 154, 7,
+        ],
+        [
+            71, 228, 225, 174, 83, 69, 84, 246, 152, 5, 21, 70, 130, 252, 61, 162, 9, 28, 95, 31,
+            115, 251, 224, 36, 219, 224, 124, 5, 249, 147, 129, 52,
+        ],
+        [
+            99, 84, 54, 113, 53, 228, 153, 72, 229, 33, 119, 65, 136, 127, 25, 133, 51, 92, 140,
+            149, 34, 123, 82, 14, 117, 69, 132, 126, 250, 215, 130, 47,
+        ],
+        [
+            158, 108, 91, 43, 179, 230, 110, 55, 17, 10, 220, 62, 145, 238, 91, 226, 158, 83, 51,
+            101, 189, 13, 71, 78, 184, 42, 243, 17, 201, 181, 140, 11,
+        ],
+    ],
+    [
+        [
+            194, 241, 4, 81, 158, 51, 209, 249, 35, 115, 149, 92, 55, 91, 174, 251, 202, 167, 82,
+            52, 253, 32, 43, 121, 206, 222, 164, 43, 248, 220, 122, 12,
+        ],
+        [
+            99, 154, 211, 41, 184, 45, 22, 111, 12, 195, 48, 243, 13, 253, 200, 229, 24, 205, 149,
+            165, 148, 197, 251, 209, 182, 19, 159, 152, 94, 232, 156, 4,
+        ],
+        [
+            0, 100, 188, 149, 90, 163, 159, 111, 0, 244, 218, 168, 18, 83, 125, 222, 206, 144, 226,
+            94, 118, 121, 221, 75, 14, 17, 94, 243, 202, 242, 253, 27,
+        ],
+        [
+            240, 46, 2, 247, 182, 224, 144, 79, 143, 124, 223, 40, 51, 131, 25, 96, 132, 163, 48,
+            24, 133, 37, 180, 92, 120, 224, 236, 140, 128, 1, 189, 40,
+        ],
+        [
+            119, 221, 95, 119, 141, 17, 159, 165, 72, 131, 170, 156, 220, 250, 5, 111, 209, 99, 9,
+            38, 230, 163, 50, 149, 172, 255, 56, 203, 136, 161, 48, 21,
+        ],
+        [
+            116, 77, 45, 31, 77, 80, 76, 36, 84, 112, 49, 174, 101, 182, 116, 15, 15, 242, 172,
+            150, 114, 212, 46, 120, 187, 34, 145, 212, 0, 158, 239, 36,
+        ],
+        [
+            234, 22, 164, 104, 165, 197, 122, 166, 202, 123, 178, 133, 187, 135, 235, 194, 206,
+            219, 58, 179, 30, 245, 147, 110, 141, 124, 206, 1, 148, 209, 101, 4,
+        ],
+        [
+            242, 73, 177, 217, 169, 198, 140, 205, 216, 73, 28, 38, 255, 90, 182, 211, 219, 192,
+            108, 40, 247, 162, 57, 211, 108, 105, 233, 230, 138, 168, 92, 63,
+        ],
+    ],
+    [
+        [
+            173, 95, 90, 146, 119, 75, 98, 69, 145, 115, 239, 18, 233, 216, 75, 241, 80, 100, 96,
+            37, 221, 214, 199, 94, 228, 153, 135, 100, 155, 155, 216, 2,
+        ],
+        [
+            150, 79, 236, 24, 163, 31, 70, 201, 143, 232, 204, 60, 220, 195, 134, 231, 11, 12, 144,
+            0, 193, 32, 61, 209, 239, 139, 83, 197, 150, 64, 148, 59,
+        ],
+        [
+            131, 108, 159, 162, 122, 223, 253, 251, 52, 16, 253, 139, 103, 224, 54, 119, 11, 188,
+            86, 103, 124, 47, 156, 143, 37, 30, 210, 118, 193, 210, 84, 34,
+        ],
+        [
+            43, 173, 230, 170, 177, 240, 16, 6, 56, 146, 203, 212, 135, 78, 45, 36, 207, 117, 225,
+            215, 190, 197, 187, 20, 2, 61, 52, 114, 11, 136, 193, 10,
+        ],
+        [
+            13, 77, 75, 121, 118, 79, 49, 124, 11, 205, 176, 65, 144, 48, 236, 222, 67, 180, 109,
+            168, 43, 77, 168, 27, 2, 222, 123, 135, 11, 103, 6, 22,
+        ],
+        [
+            214, 232, 233, 41, 25, 210, 118, 90, 85, 18, 143, 98, 244, 50, 251, 225, 101, 170, 229,
+            58, 207, 175, 175, 233, 208, 5, 52, 27, 209, 230, 169, 31,
+        ],
+        [
+            129, 131, 148, 184, 182, 36, 79, 246, 200, 243, 153, 36, 187, 3, 93, 208, 186, 153,
+            173, 154, 142, 119, 197, 27, 57, 122, 240, 85, 105, 206, 17, 50,
+        ],
+        [
+            241, 75, 9, 108, 156, 226, 162, 237, 221, 84, 169, 167, 11, 25, 191, 150, 233, 203, 61,
+            64, 95, 176, 96, 79, 39, 143, 83, 172, 33, 238, 82, 10,
+        ],
+    ],
+    [
+        [
+            249, 64, 46, 51, 246, 45, 133, 33, 65, 155, 225, 183, 65, 194, 179, 149, 118, 11, 201,
+            218, 20, 8, 7, 98, 19, 54, 211, 59, 226, 174, 181, 30,
+        ],
+        [
+            78, 52, 33, 54, 74, 139, 14, 51, 38, 151, 205, 116, 207, 250, 247, 61, 67, 250, 220,
+            248, 184, 120, 243, 69, 81, 143, 46, 190, 151, 25, 209, 7,
+        ],
+        [
+            117, 44, 92, 67, 68, 250, 114, 230, 86, 95, 107, 31, 210, 141, 32, 48, 43, 80, 5, 102,
+            72, 39, 215, 25, 246, 7, 20, 183, 170, 130, 203, 40,
+        ],
+        [
+            248, 52, 236, 99, 245, 230, 43, 187, 159, 164, 252, 246, 45, 35, 142, 166, 203, 99,
+            243, 180, 131, 234, 104, 61, 198, 159, 140, 136, 45, 120, 20, 55,
+        ],
+        [
+            197, 252, 78, 164, 142, 18, 216, 81, 116, 199, 65, 0, 35, 6, 95, 105, 67, 83, 162, 56,
+            231, 180, 36, 75, 119, 162, 211, 252, 162, 108, 87, 7,
+        ],
+        [
+            67, 43, 183, 166, 242, 83, 163, 0, 72, 129, 240, 196, 178, 90, 3, 33, 144, 139, 80,
+            173, 176, 17, 119, 45, 223, 30, 157, 64, 198, 232, 11, 8,
+        ],
+        [
+            236, 216, 184, 177, 72, 88, 104, 89, 162, 120, 101, 134, 110, 49, 69, 253, 105, 171,
+            109, 13, 86, 253, 38, 253, 135, 146, 38, 248, 160, 88, 12, 6,
+        ],
+        [
+            87, 44, 230, 170, 54, 93, 209, 204, 5, 240, 55, 102, 218, 228, 105, 33, 171, 112, 84,
+            227, 131, 207, 119, 121, 115, 23, 26, 179, 8, 111, 253, 3,
+        ],
+    ],
+    [
+        [
+            100, 157, 27, 13, 92, 74, 138, 226, 131, 160, 172, 107, 65, 128, 45, 170, 169, 90, 155,
+            25, 167, 166, 136, 89, 232, 252, 203, 155, 70, 6, 182, 32,
+        ],
+        [
+            159, 197, 68, 197, 232, 244, 71, 69, 251, 104, 129, 20, 231, 138, 116, 216, 109, 77,
+            148, 92, 134, 5, 135, 227, 146, 116, 246, 221, 236, 104, 83, 26,
+        ],
+        [
+            149, 158, 108, 59, 214, 113, 52, 126, 198, 118, 186, 164, 142, 109, 2, 1, 124, 233, 0,
+            84, 130, 41, 182, 172, 37, 217, 212, 126, 222, 145, 202, 4,
+        ],
+        [
+            165, 213, 205, 252, 170, 149, 33, 185, 40, 200, 132, 94, 128, 188, 2, 243, 141, 30,
+            126, 208, 209, 234, 78, 69, 70, 69, 205, 216, 154, 51, 86, 10,
+        ],
+        [
+            153, 122, 142, 76, 38, 219, 144, 223, 227, 232, 9, 56, 225, 5, 191, 92, 100, 51, 155,
+            107, 205, 202, 74, 170, 103, 189, 30, 159, 68, 61, 202, 13,
+        ],
+        [
+            134, 38, 203, 216, 65, 140, 214, 94, 24, 224, 177, 151, 140, 7, 41, 124, 40, 41, 1, 51,
+            59, 89, 30, 130, 108, 87, 127, 214, 162, 183, 246, 22,
+        ],
+        [
+            187, 193, 99, 160, 244, 73, 163, 177, 215, 30, 255, 31, 114, 223, 43, 85, 84, 226, 220,
+            164, 67, 0, 238, 185, 249, 231, 198, 124, 172, 35, 149, 60,
+        ],
+        [
+            45, 186, 4, 252, 12, 240, 229, 162, 18, 91, 136, 107, 201, 227, 77, 8, 175, 8, 198,
+            103, 34, 168, 221, 193, 176, 128, 72, 93, 195, 26, 172, 3,
+        ],
+    ],
+    [
+        [
+            91, 46, 86, 226, 133, 67, 28, 86, 126, 29, 234, 89, 216, 65, 179, 40, 36, 237, 114,
+            194, 111, 26, 250, 5, 252, 24, 131, 155, 178, 92, 10, 11,
+        ],
+        [
+            67, 208, 75, 127, 148, 190, 127, 53, 27, 219, 88, 183, 139, 50, 201, 19, 250, 158, 128,
+            169, 150, 92, 76, 50, 89, 132, 55, 122, 219, 124, 16, 11,
+        ],
+        [
+            140, 159, 86, 156, 195, 225, 138, 7, 78, 241, 245, 181, 207, 152, 209, 52, 121, 95, 35,
+            65, 101, 20, 101, 88, 9, 130, 39, 135, 135, 74, 9, 1,
+        ],
+        [
+            253, 181, 175, 91, 246, 184, 164, 214, 93, 116, 66, 47, 57, 58, 32, 0, 45, 28, 106, 79,
+            214, 62, 176, 226, 255, 241, 191, 101, 224, 247, 9, 29,
+        ],
+        [
+            233, 235, 128, 119, 38, 23, 25, 207, 212, 163, 148, 62, 177, 73, 115, 228, 237, 228,
+            174, 133, 58, 20, 187, 192, 111, 239, 218, 119, 132, 233, 147, 28,
+        ],
+        [
+            102, 191, 62, 245, 131, 141, 134, 94, 211, 147, 155, 226, 34, 19, 146, 177, 54, 235,
+            23, 15, 176, 169, 246, 97, 178, 252, 103, 39, 105, 178, 162, 51,
+        ],
+        [
+            7, 50, 217, 129, 106, 152, 234, 81, 110, 193, 51, 82, 62, 50, 179, 59, 89, 116, 206,
+            117, 204, 73, 35, 115, 85, 176, 39, 231, 60, 170, 116, 47,
+        ],
+        [
+            75, 196, 187, 39, 241, 38, 201, 59, 230, 232, 134, 175, 19, 66, 71, 243, 254, 64, 242,
+            14, 160, 95, 24, 130, 33, 51, 183, 120, 216, 162, 193, 32,
+        ],
+    ],
+    [
+        [
+            80, 139, 231, 43, 42, 117, 92, 23, 23, 28, 89, 92, 0, 118, 252, 26, 197, 165, 70, 191,
+            196, 203, 169, 72, 141, 197, 13, 103, 216, 197, 184, 13,
+        ],
+        [
+            171, 152, 143, 232, 240, 5, 166, 106, 27, 18, 57, 228, 232, 129, 41, 209, 77, 30, 210,
+            74, 209, 33, 45, 74, 163, 209, 238, 156, 80, 77, 158, 15,
+        ],
+        [
+            96, 136, 152, 220, 61, 122, 124, 180, 101, 158, 18, 10, 19, 70, 9, 13, 228, 26, 191,
+            48, 235, 92, 34, 90, 241, 180, 94, 57, 155, 70, 144, 42,
+        ],
+        [
+            179, 252, 92, 89, 59, 253, 147, 136, 110, 199, 105, 197, 235, 217, 159, 216, 232, 248,
+            23, 191, 13, 61, 223, 38, 104, 236, 204, 89, 222, 220, 240, 61,
+        ],
+        [
+            217, 91, 66, 69, 68, 44, 20, 147, 18, 87, 88, 66, 142, 170, 173, 93, 77, 15, 82, 94,
+            26, 144, 31, 224, 164, 45, 203, 84, 24, 139, 14, 23,
+        ],
+        [
+            61, 139, 126, 42, 167, 228, 59, 215, 79, 212, 163, 10, 48, 212, 246, 81, 180, 25, 156,
+            101, 209, 148, 57, 138, 78, 49, 193, 14, 101, 158, 189, 55,
+        ],
+        [
+            159, 6, 43, 236, 178, 210, 174, 111, 168, 153, 94, 23, 184, 185, 247, 237, 207, 133,
+            190, 220, 41, 179, 2, 74, 193, 144, 244, 247, 129, 121, 73, 41,
+        ],
+        [
+            73, 81, 174, 197, 26, 219, 123, 128, 63, 219, 134, 33, 79, 124, 244, 18, 207, 94, 155,
+            181, 248, 239, 24, 32, 62, 101, 30, 162, 200, 148, 17, 59,
+        ],
+    ],
+    [
+        [
+            21, 11, 152, 124, 138, 60, 93, 36, 7, 60, 214, 84, 45, 154, 172, 52, 35, 153, 17, 9,
+            203, 118, 210, 182, 10, 95, 57, 145, 126, 8, 5, 42,
+        ],
+        [
+            71, 101, 167, 15, 118, 90, 63, 8, 124, 156, 180, 28, 65, 161, 49, 86, 131, 205, 169,
+            69, 84, 231, 193, 228, 214, 212, 145, 49, 194, 101, 242, 29,
+        ],
+        [
+            7, 34, 97, 70, 161, 98, 83, 134, 241, 74, 132, 136, 64, 214, 70, 28, 200, 90, 12, 111,
+            86, 123, 8, 251, 164, 2, 58, 177, 195, 146, 182, 21,
+        ],
+        [
+            164, 230, 11, 145, 185, 76, 76, 97, 238, 93, 215, 40, 162, 213, 31, 242, 100, 67, 139,
+            137, 118, 188, 204, 150, 253, 175, 94, 60, 210, 138, 9, 32,
+        ],
+        [
+            108, 48, 162, 95, 78, 234, 152, 114, 166, 28, 255, 6, 184, 151, 224, 174, 128, 95, 140,
+            153, 230, 85, 248, 241, 64, 210, 182, 139, 32, 250, 41, 32,
+        ],
+        [
+            154, 194, 221, 96, 105, 253, 154, 78, 151, 82, 214, 33, 56, 41, 200, 160, 107, 92, 70,
+            233, 152, 50, 229, 239, 233, 141, 44, 101, 191, 20, 37, 8,
+        ],
+        [
+            87, 249, 195, 51, 136, 74, 211, 133, 253, 248, 97, 146, 179, 28, 66, 93, 36, 153, 66,
+            239, 16, 69, 135, 216, 35, 151, 73, 200, 68, 9, 32, 13,
+        ],
+        [
+            184, 229, 139, 19, 69, 111, 241, 199, 83, 10, 138, 24, 203, 217, 63, 209, 81, 219, 24,
+            37, 49, 241, 79, 9, 138, 240, 48, 107, 29, 46, 55, 4,
+        ],
+    ],
+    [
+        [
+            222, 18, 27, 133, 130, 121, 92, 228, 235, 31, 219, 249, 77, 230, 39, 140, 187, 30, 119,
+            112, 172, 56, 28, 218, 242, 51, 136, 143, 49, 179, 27, 25,
+        ],
+        [
+            2, 99, 67, 80, 156, 33, 160, 127, 126, 26, 10, 176, 146, 164, 212, 207, 172, 162, 165,
+            143, 181, 41, 188, 59, 128, 2, 140, 243, 6, 191, 47, 50,
+        ],
+        [
+            80, 146, 67, 231, 83, 95, 75, 75, 198, 78, 97, 42, 71, 41, 87, 178, 100, 226, 240, 179,
+            51, 94, 229, 133, 55, 227, 162, 161, 155, 14, 160, 51,
+        ],
+        [
+            184, 82, 151, 20, 59, 61, 157, 47, 88, 40, 125, 76, 132, 98, 13, 220, 157, 43, 174,
+            135, 113, 131, 232, 159, 134, 112, 131, 61, 229, 56, 187, 31,
+        ],
+        [
+            103, 159, 75, 105, 229, 173, 33, 147, 222, 198, 216, 51, 158, 126, 253, 155, 209, 71,
+            97, 213, 227, 160, 59, 169, 255, 4, 158, 246, 202, 37, 41, 55,
+        ],
+        [
+            70, 44, 245, 153, 162, 248, 57, 34, 159, 124, 179, 43, 174, 127, 126, 62, 239, 103, 71,
+            230, 168, 6, 1, 249, 202, 249, 58, 64, 50, 84, 166, 49,
+        ],
+        [
+            24, 11, 169, 224, 141, 175, 98, 63, 54, 81, 30, 229, 141, 220, 77, 48, 160, 66, 234,
+            155, 148, 214, 56, 206, 162, 192, 93, 21, 37, 68, 223, 20,
+        ],
+        [
+            12, 206, 30, 240, 150, 168, 254, 195, 216, 250, 139, 93, 74, 204, 177, 206, 186, 183,
+            11, 216, 8, 219, 75, 55, 158, 241, 27, 121, 158, 126, 89, 37,
+        ],
+    ],
+    [
+        [
+            126, 244, 161, 84, 141, 63, 108, 50, 97, 130, 49, 143, 229, 206, 114, 37, 17, 244, 30,
+            5, 5, 65, 90, 231, 102, 176, 228, 110, 42, 206, 59, 7,
+        ],
+        [
+            171, 250, 110, 27, 19, 51, 98, 97, 147, 101, 9, 200, 255, 24, 103, 220, 213, 243, 63,
+            100, 129, 94, 129, 237, 192, 53, 44, 54, 81, 150, 163, 49,
+        ],
+        [
+            207, 235, 227, 240, 49, 150, 106, 200, 76, 72, 90, 46, 38, 172, 83, 132, 225, 207, 25,
+            95, 29, 88, 178, 163, 130, 5, 41, 2, 35, 56, 242, 5,
+        ],
+        [
+            150, 235, 254, 218, 81, 133, 9, 45, 179, 227, 128, 87, 212, 188, 250, 90, 210, 132, 40,
+            16, 118, 238, 125, 165, 27, 219, 224, 239, 34, 178, 94, 39,
+        ],
+        [
+            104, 208, 155, 48, 14, 222, 119, 22, 228, 238, 214, 217, 249, 175, 117, 113, 143, 198,
+            122, 25, 87, 198, 212, 60, 57, 28, 213, 213, 91, 130, 12, 38,
+        ],
+        [
+            201, 85, 96, 155, 78, 135, 127, 238, 44, 177, 100, 78, 247, 155, 175, 223, 170, 205,
+            210, 140, 238, 45, 94, 95, 244, 19, 5, 32, 43, 139, 214, 48,
+        ],
+        [
+            249, 240, 53, 215, 1, 213, 54, 151, 143, 107, 23, 223, 161, 19, 249, 213, 102, 137,
+            228, 184, 2, 78, 237, 177, 23, 49, 218, 85, 55, 62, 215, 20,
+        ],
+        [
+            96, 201, 226, 19, 157, 94, 105, 10, 170, 204, 220, 109, 21, 94, 224, 26, 132, 56, 89,
+            173, 176, 87, 145, 180, 174, 90, 228, 72, 206, 159, 48, 45,
+        ],
+    ],
+    [
+        [
+            113, 76, 55, 16, 2, 198, 219, 166, 149, 128, 101, 84, 86, 171, 12, 5, 131, 54, 86, 113,
+            196, 45, 45, 11, 118, 194, 183, 17, 58, 196, 31, 10,
+        ],
+        [
+            172, 125, 221, 60, 54, 229, 101, 125, 102, 252, 27, 200, 177, 87, 186, 178, 60, 164,
+            109, 220, 15, 121, 133, 105, 9, 238, 96, 11, 36, 59, 9, 30,
+        ],
+        [
+            183, 108, 71, 108, 153, 232, 119, 177, 137, 136, 110, 110, 3, 219, 142, 115, 255, 120,
+            114, 121, 148, 17, 97, 46, 218, 123, 63, 232, 214, 16, 147, 41,
+        ],
+        [
+            173, 231, 224, 166, 86, 142, 54, 70, 179, 225, 252, 2, 244, 75, 83, 118, 10, 20, 156,
+            247, 202, 76, 237, 164, 61, 66, 13, 122, 141, 245, 173, 44,
+        ],
+        [
+            108, 239, 77, 249, 18, 117, 63, 85, 58, 86, 175, 32, 30, 153, 255, 100, 84, 29, 190,
+            31, 229, 96, 136, 89, 133, 204, 51, 185, 137, 216, 164, 20,
+        ],
+        [
+            59, 220, 40, 70, 32, 241, 241, 203, 179, 230, 248, 247, 43, 169, 181, 150, 156, 133,
+            147, 122, 253, 248, 32, 86, 24, 136, 5, 111, 169, 164, 215, 56,
+        ],
+        [
+            98, 209, 76, 142, 205, 4, 81, 26, 135, 170, 10, 201, 252, 197, 53, 94, 254, 105, 146,
+            81, 160, 43, 12, 97, 126, 94, 64, 186, 207, 201, 68, 56,
+        ],
+        [
+            201, 190, 210, 46, 86, 174, 226, 108, 128, 111, 77, 178, 211, 163, 110, 111, 62, 61,
+            153, 63, 216, 125, 9, 48, 127, 164, 43, 106, 64, 147, 129, 57,
+        ],
+    ],
+    [
+        [
+            255, 240, 106, 196, 39, 210, 196, 148, 144, 253, 91, 141, 51, 240, 165, 236, 108, 169,
+            69, 223, 235, 23, 160, 124, 2, 48, 44, 255, 167, 134, 112, 57,
+        ],
+        [
+            124, 68, 80, 75, 141, 236, 245, 254, 13, 176, 89, 204, 71, 154, 156, 56, 117, 53, 210,
+            213, 47, 41, 149, 84, 28, 125, 7, 64, 72, 79, 177, 38,
+        ],
+        [
+            61, 71, 251, 185, 213, 100, 253, 192, 180, 4, 68, 195, 221, 45, 113, 19, 246, 221, 88,
+            76, 165, 136, 14, 114, 197, 112, 100, 42, 89, 152, 91, 5,
+        ],
+        [
+            42, 226, 253, 216, 123, 40, 107, 109, 166, 66, 10, 217, 98, 141, 231, 69, 243, 226, 46,
+            114, 123, 117, 180, 33, 18, 136, 116, 160, 222, 248, 162, 11,
+        ],
+        [
+            34, 220, 174, 123, 63, 171, 95, 68, 127, 18, 102, 15, 252, 35, 255, 63, 161, 228, 65,
+            19, 218, 181, 243, 128, 113, 164, 244, 94, 67, 79, 147, 56,
+        ],
+        [
+            209, 56, 211, 64, 210, 9, 133, 186, 36, 212, 196, 71, 50, 82, 23, 95, 76, 75, 155, 87,
+            37, 250, 226, 170, 148, 75, 75, 60, 138, 186, 40, 37,
+        ],
+        [
+            220, 163, 215, 26, 244, 235, 220, 165, 176, 44, 86, 158, 231, 85, 52, 25, 149, 119,
+            195, 200, 49, 40, 140, 123, 192, 128, 4, 162, 187, 171, 90, 9,
+        ],
+        [
+            225, 7, 90, 21, 111, 77, 213, 55, 198, 207, 93, 231, 90, 26, 147, 18, 234, 190, 254,
+            163, 41, 26, 104, 7, 234, 53, 80, 54, 100, 142, 14, 48,
+        ],
+    ],
+    [
+        [
+            103, 49, 41, 63, 34, 209, 87, 117, 41, 188, 144, 57, 24, 205, 210, 209, 219, 178, 104,
+            6, 21, 18, 145, 241, 202, 73, 252, 3, 136, 255, 16, 36,
+        ],
+        [
+            126, 141, 157, 92, 89, 211, 65, 46, 189, 255, 55, 182, 185, 222, 254, 89, 158, 15, 249,
+            216, 37, 35, 39, 19, 124, 89, 81, 246, 62, 174, 73, 47,
+        ],
+        [
+            224, 229, 224, 38, 180, 80, 136, 160, 85, 100, 115, 226, 227, 6, 130, 184, 52, 91, 188,
+            70, 78, 48, 79, 177, 179, 45, 224, 193, 145, 116, 220, 6,
+        ],
+        [
+            240, 89, 82, 251, 24, 123, 117, 60, 200, 187, 3, 66, 226, 200, 129, 133, 208, 196, 24,
+            206, 61, 85, 56, 87, 169, 251, 87, 152, 109, 102, 86, 10,
+        ],
+        [
+            219, 120, 137, 97, 77, 109, 105, 128, 53, 170, 171, 221, 142, 205, 205, 243, 140, 73,
+            150, 192, 58, 248, 218, 204, 10, 22, 80, 10, 145, 140, 23, 7,
+        ],
+        [
+            97, 62, 153, 212, 157, 7, 197, 172, 187, 181, 216, 197, 154, 222, 232, 25, 162, 34,
+            115, 231, 82, 58, 59, 23, 244, 49, 112, 205, 47, 222, 162, 59,
+        ],
+        [
+            67, 55, 27, 153, 104, 30, 226, 63, 37, 218, 100, 170, 15, 229, 63, 147, 159, 80, 136,
+            152, 199, 99, 121, 227, 100, 146, 169, 44, 76, 162, 53, 15,
+        ],
+        [
+            44, 140, 65, 137, 229, 185, 246, 138, 6, 180, 68, 32, 124, 9, 94, 142, 211, 153, 126,
+            82, 82, 90, 75, 97, 238, 201, 97, 201, 147, 106, 102, 45,
+        ],
+    ],
+    [
+        [
+            154, 78, 13, 175, 144, 144, 181, 254, 86, 176, 140, 173, 101, 106, 138, 95, 233, 97,
+            107, 87, 110, 243, 211, 168, 113, 244, 0, 143, 106, 163, 103, 49,
+        ],
+        [
+            113, 86, 6, 11, 223, 129, 113, 20, 87, 6, 149, 189, 142, 165, 81, 44, 77, 211, 189,
+            211, 155, 63, 227, 198, 235, 245, 238, 220, 145, 222, 131, 0,
+        ],
+        [
+            239, 34, 158, 133, 28, 172, 184, 246, 211, 95, 144, 164, 222, 37, 57, 217, 243, 104,
+            162, 216, 71, 180, 230, 178, 65, 102, 237, 102, 33, 27, 64, 29,
+        ],
+        [
+            189, 2, 47, 8, 126, 160, 149, 81, 2, 192, 56, 35, 16, 216, 1, 185, 78, 101, 205, 142,
+            248, 26, 138, 78, 19, 227, 132, 76, 211, 101, 143, 36,
+        ],
+        [
+            9, 244, 15, 160, 155, 180, 106, 160, 138, 78, 142, 12, 224, 162, 60, 80, 62, 44, 201,
+            200, 85, 40, 69, 242, 28, 63, 119, 55, 55, 1, 187, 48,
+        ],
+        [
+            230, 52, 100, 80, 122, 148, 40, 24, 136, 15, 108, 33, 241, 1, 150, 97, 30, 12, 157, 14,
+            247, 86, 117, 42, 218, 238, 93, 130, 148, 50, 76, 9,
+        ],
+        [
+            204, 114, 216, 224, 115, 175, 115, 198, 33, 211, 13, 20, 101, 254, 128, 182, 219, 99,
+            49, 136, 34, 104, 131, 176, 57, 127, 217, 238, 87, 74, 149, 41,
+        ],
+        [
+            252, 28, 170, 15, 158, 141, 226, 80, 34, 113, 118, 234, 44, 161, 4, 180, 81, 42, 246,
+            29, 137, 65, 208, 21, 184, 245, 74, 248, 211, 96, 223, 42,
+        ],
+    ],
+    [
+        [
+            99, 73, 57, 46, 43, 160, 177, 18, 52, 120, 173, 225, 193, 243, 102, 8, 209, 4, 27, 211,
+            18, 8, 26, 208, 100, 9, 229, 162, 211, 226, 100, 8,
+        ],
+        [
+            89, 148, 122, 14, 37, 150, 254, 164, 84, 248, 1, 148, 99, 59, 136, 157, 50, 211, 11,
+            131, 52, 223, 87, 90, 47, 199, 113, 72, 114, 117, 27, 16,
+        ],
+        [
+            54, 224, 16, 104, 41, 121, 198, 104, 97, 16, 200, 211, 177, 6, 144, 107, 166, 233, 125,
+            93, 81, 144, 234, 166, 100, 27, 56, 198, 215, 110, 191, 8,
+        ],
+        [
+            120, 49, 186, 107, 174, 192, 21, 80, 127, 55, 201, 252, 245, 21, 234, 199, 197, 0, 127,
+            79, 165, 21, 163, 227, 148, 6, 201, 182, 212, 74, 85, 60,
+        ],
+        [
+            32, 206, 13, 185, 245, 1, 247, 16, 12, 178, 178, 51, 66, 213, 224, 253, 141, 191, 123,
+            215, 206, 96, 242, 167, 21, 252, 216, 198, 200, 113, 138, 23,
+        ],
+        [
+            214, 146, 47, 116, 13, 140, 129, 199, 78, 218, 105, 47, 184, 183, 37, 176, 138, 116,
+            29, 152, 211, 234, 236, 128, 221, 19, 16, 180, 5, 31, 38, 52,
+        ],
+        [
+            53, 22, 251, 54, 25, 10, 180, 124, 152, 90, 251, 137, 121, 218, 152, 77, 36, 39, 110,
+            131, 149, 164, 253, 218, 195, 159, 8, 17, 163, 180, 48, 54,
+        ],
+        [
+            79, 222, 175, 84, 68, 207, 171, 218, 9, 173, 100, 196, 4, 209, 60, 217, 95, 220, 33,
+            210, 226, 131, 0, 236, 216, 61, 217, 44, 220, 178, 178, 22,
+        ],
+    ],
+    [
+        [
+            107, 105, 93, 217, 54, 82, 75, 109, 105, 29, 83, 80, 248, 146, 161, 232, 150, 85, 45,
+            8, 3, 22, 194, 208, 55, 67, 26, 125, 7, 148, 129, 37,
+        ],
+        [
+            29, 95, 48, 152, 141, 85, 76, 104, 69, 146, 226, 5, 55, 108, 221, 235, 242, 85, 175,
+            127, 92, 127, 161, 193, 47, 225, 40, 74, 235, 163, 158, 32,
+        ],
+        [
+            227, 244, 182, 232, 84, 114, 73, 222, 186, 128, 35, 45, 188, 135, 174, 135, 186, 197,
+            229, 218, 9, 125, 136, 27, 131, 145, 163, 103, 77, 34, 43, 33,
+        ],
+        [
+            195, 68, 118, 100, 210, 211, 111, 3, 155, 3, 156, 224, 132, 248, 95, 134, 129, 212, 28,
+            125, 239, 111, 143, 163, 225, 20, 226, 153, 87, 30, 30, 19,
+        ],
+        [
+            142, 241, 239, 103, 84, 171, 22, 132, 95, 60, 94, 44, 167, 21, 215, 45, 59, 120, 47, 0,
+            131, 89, 140, 239, 48, 106, 10, 231, 219, 66, 142, 39,
+        ],
+        [
+            198, 220, 99, 166, 20, 56, 174, 133, 222, 155, 196, 81, 30, 232, 17, 138, 240, 13, 195,
+            17, 216, 102, 91, 153, 195, 251, 189, 122, 157, 150, 7, 5,
+        ],
+        [
+            13, 239, 171, 80, 251, 163, 115, 201, 8, 163, 26, 149, 243, 103, 167, 155, 194, 39,
+            226, 136, 8, 190, 219, 117, 165, 246, 254, 248, 156, 148, 87, 30,
+        ],
+        [
+            104, 157, 26, 155, 195, 128, 35, 82, 221, 218, 54, 250, 194, 68, 185, 187, 136, 145,
+            79, 166, 157, 58, 86, 9, 247, 239, 103, 175, 218, 226, 137, 19,
+        ],
+    ],
+    [
+        [
+            76, 222, 120, 1, 103, 34, 213, 86, 193, 6, 130, 96, 165, 215, 27, 94, 77, 215, 179,
+            150, 125, 6, 171, 65, 24, 8, 61, 139, 250, 144, 31, 31,
+        ],
+        [
+            134, 23, 114, 162, 211, 19, 156, 246, 34, 170, 93, 193, 218, 142, 88, 4, 248, 192, 40,
+            118, 53, 217, 131, 17, 168, 129, 200, 206, 4, 196, 235, 20,
+        ],
+        [
+            181, 35, 108, 194, 46, 27, 101, 145, 74, 17, 49, 227, 145, 110, 34, 95, 112, 64, 9,
+            241, 215, 205, 232, 135, 35, 194, 234, 141, 80, 6, 89, 37,
+        ],
+        [
+            184, 177, 62, 50, 1, 237, 106, 151, 102, 29, 108, 160, 83, 99, 212, 156, 164, 218, 16,
+            75, 167, 201, 62, 156, 91, 188, 199, 8, 195, 74, 196, 28,
+        ],
+        [
+            17, 89, 59, 91, 140, 2, 44, 45, 192, 13, 217, 135, 26, 70, 171, 156, 117, 198, 240, 1,
+            218, 24, 48, 197, 51, 45, 56, 194, 94, 94, 51, 40,
+        ],
+        [
+            158, 122, 35, 55, 187, 102, 254, 58, 132, 214, 105, 217, 35, 171, 216, 216, 152, 172,
+            126, 106, 107, 206, 127, 41, 164, 33, 165, 71, 247, 92, 143, 14,
+        ],
+        [
+            120, 71, 69, 120, 156, 189, 181, 43, 176, 232, 130, 201, 238, 12, 22, 58, 133, 25, 155,
+            146, 9, 188, 14, 153, 53, 156, 38, 212, 195, 134, 95, 7,
+        ],
+        [
+            157, 96, 229, 115, 219, 58, 67, 16, 224, 9, 44, 240, 209, 213, 218, 68, 247, 237, 57,
+            28, 228, 198, 146, 99, 140, 224, 145, 231, 119, 223, 118, 48,
+        ],
+    ],
+    [
+        [
+            213, 203, 57, 233, 35, 161, 91, 226, 27, 23, 16, 217, 18, 194, 126, 205, 148, 142, 190,
+            53, 58, 59, 253, 86, 70, 219, 212, 125, 153, 224, 6, 9,
+        ],
+        [
+            155, 137, 19, 65, 34, 199, 103, 121, 244, 81, 27, 130, 6, 116, 234, 102, 44, 199, 4,
+            19, 80, 173, 42, 110, 70, 143, 130, 125, 159, 106, 236, 39,
+        ],
+        [
+            122, 10, 176, 127, 83, 36, 22, 172, 72, 92, 139, 199, 151, 96, 70, 203, 154, 81, 240,
+            22, 29, 6, 119, 248, 46, 45, 132, 169, 166, 30, 90, 22,
+        ],
+        [
+            26, 13, 5, 45, 142, 71, 73, 137, 254, 3, 246, 242, 178, 98, 165, 194, 210, 131, 252,
+            15, 162, 70, 72, 143, 67, 161, 142, 16, 152, 79, 80, 61,
+        ],
+        [
+            19, 13, 118, 209, 24, 155, 176, 112, 201, 217, 188, 152, 118, 164, 78, 191, 232, 62,
+            216, 249, 142, 131, 126, 180, 90, 1, 150, 49, 78, 96, 75, 31,
+        ],
+        [
+            26, 242, 23, 163, 221, 125, 25, 226, 219, 86, 141, 10, 85, 252, 140, 215, 130, 142,
+            159, 229, 169, 103, 118, 242, 183, 177, 223, 236, 90, 61, 233, 55,
+        ],
+        [
+            10, 208, 13, 145, 192, 166, 233, 172, 141, 58, 55, 234, 155, 69, 41, 247, 190, 194, 81,
+            157, 179, 146, 197, 146, 251, 187, 218, 11, 60, 144, 237, 58,
+        ],
+        [
+            240, 206, 55, 40, 176, 39, 191, 197, 6, 96, 136, 229, 46, 153, 100, 47, 62, 60, 214,
+            146, 206, 84, 114, 69, 26, 45, 157, 102, 40, 72, 91, 28,
+        ],
+    ],
+    [
+        [
+            43, 161, 254, 90, 188, 123, 114, 200, 17, 242, 129, 50, 94, 237, 177, 114, 185, 147,
+            161, 2, 170, 118, 128, 252, 95, 241, 149, 1, 49, 204, 201, 59,
+        ],
+        [
+            122, 217, 240, 150, 125, 123, 87, 55, 111, 22, 243, 27, 215, 190, 60, 91, 116, 68, 96,
+            197, 18, 223, 203, 149, 121, 151, 239, 104, 126, 189, 132, 5,
+        ],
+        [
+            121, 57, 216, 35, 130, 22, 227, 222, 233, 39, 46, 77, 2, 167, 64, 44, 59, 50, 64, 48,
+            204, 175, 113, 77, 238, 211, 91, 23, 98, 243, 90, 14,
+        ],
+        [
+            90, 181, 29, 181, 36, 252, 218, 201, 12, 206, 43, 100, 88, 235, 1, 117, 73, 51, 208,
+            240, 30, 133, 64, 151, 40, 151, 233, 173, 66, 146, 212, 22,
+        ],
+        [
+            85, 121, 202, 247, 237, 164, 240, 148, 100, 11, 187, 140, 202, 183, 225, 244, 244, 207,
+            198, 197, 209, 28, 26, 58, 202, 83, 113, 214, 181, 78, 222, 41,
+        ],
+        [
+            180, 231, 142, 160, 125, 98, 227, 7, 143, 3, 69, 171, 93, 224, 114, 156, 125, 17, 181,
+            18, 0, 115, 49, 15, 15, 34, 81, 186, 185, 117, 184, 45,
+        ],
+        [
+            66, 196, 173, 255, 17, 239, 59, 139, 157, 5, 120, 107, 8, 206, 0, 133, 65, 23, 102, 73,
+            131, 86, 172, 35, 99, 27, 238, 142, 167, 99, 224, 29,
+        ],
+        [
+            87, 234, 21, 65, 77, 92, 71, 146, 253, 59, 106, 150, 122, 185, 113, 28, 4, 114, 34,
+            172, 19, 85, 11, 106, 118, 8, 215, 10, 29, 202, 109, 56,
+        ],
+    ],
+    [
+        [
+            204, 119, 78, 168, 255, 167, 165, 38, 156, 195, 194, 168, 90, 72, 102, 86, 246, 39, 82,
+            194, 147, 87, 28, 41, 208, 198, 242, 252, 144, 50, 134, 56,
+        ],
+        [
+            89, 168, 85, 62, 11, 67, 112, 59, 249, 65, 53, 37, 136, 204, 207, 189, 131, 40, 126,
+            21, 99, 186, 208, 46, 113, 66, 38, 133, 191, 32, 81, 56,
+        ],
+        [
+            59, 65, 171, 57, 1, 188, 192, 11, 248, 82, 69, 83, 153, 237, 51, 109, 39, 20, 9, 93,
+            219, 37, 123, 106, 255, 133, 228, 77, 110, 85, 86, 12,
+        ],
+        [
+            220, 71, 156, 57, 178, 156, 43, 207, 183, 201, 186, 96, 127, 23, 55, 116, 0, 21, 158,
+            116, 250, 252, 242, 252, 253, 8, 81, 42, 200, 209, 23, 7,
+        ],
+        [
+            152, 231, 245, 77, 243, 134, 75, 92, 238, 114, 243, 21, 28, 94, 81, 19, 67, 215, 7,
+            155, 62, 252, 92, 137, 224, 23, 81, 196, 41, 120, 45, 31,
+        ],
+        [
+            88, 86, 212, 205, 201, 188, 34, 237, 245, 154, 110, 89, 224, 247, 247, 53, 251, 109,
+            178, 217, 100, 216, 154, 42, 254, 31, 115, 102, 112, 207, 154, 22,
+        ],
+        [
+            227, 134, 163, 64, 117, 82, 220, 198, 240, 28, 86, 151, 125, 205, 72, 70, 186, 42, 142,
+            20, 138, 239, 66, 221, 249, 247, 198, 177, 8, 226, 29, 62,
+        ],
+        [
+            90, 225, 249, 139, 11, 83, 149, 107, 183, 239, 107, 72, 71, 9, 216, 151, 44, 79, 63,
+            221, 56, 152, 219, 200, 185, 214, 29, 93, 202, 116, 166, 47,
+        ],
+    ],
+    [
+        [
+            228, 25, 203, 131, 72, 219, 121, 155, 238, 243, 156, 151, 72, 209, 251, 93, 197, 32,
+            228, 115, 26, 13, 254, 51, 249, 232, 59, 57, 46, 81, 82, 55,
+        ],
+        [
+            78, 128, 240, 159, 205, 127, 13, 51, 72, 25, 28, 151, 53, 55, 190, 169, 240, 58, 252,
+            198, 109, 187, 49, 106, 176, 72, 218, 91, 146, 127, 109, 52,
+        ],
+        [
+            240, 19, 94, 221, 101, 239, 76, 3, 110, 229, 128, 156, 74, 63, 200, 43, 28, 157, 127,
+            164, 254, 141, 137, 22, 137, 103, 214, 120, 105, 215, 42, 31,
+        ],
+        [
+            218, 88, 204, 255, 86, 211, 52, 151, 180, 145, 248, 64, 196, 167, 68, 246, 119, 170,
+            90, 21, 120, 194, 93, 3, 12, 145, 33, 24, 91, 50, 116, 19,
+        ],
+        [
+            148, 134, 195, 91, 255, 65, 238, 49, 239, 141, 111, 9, 94, 137, 1, 152, 121, 224, 25,
+            170, 66, 243, 161, 10, 215, 177, 161, 60, 36, 9, 75, 20,
+        ],
+        [
+            184, 101, 185, 170, 85, 116, 0, 47, 172, 203, 160, 18, 109, 98, 250, 162, 255, 213,
+            245, 164, 53, 87, 62, 30, 115, 76, 152, 245, 10, 217, 214, 43,
+        ],
+        [
+            111, 35, 157, 172, 67, 135, 219, 111, 41, 3, 184, 115, 38, 234, 133, 124, 249, 119,
+            160, 155, 221, 133, 28, 122, 176, 170, 19, 151, 104, 79, 85, 51,
+        ],
+        [
+            181, 239, 109, 111, 233, 193, 199, 150, 223, 181, 215, 54, 196, 216, 251, 35, 21, 10,
+            6, 44, 120, 98, 170, 250, 231, 90, 99, 189, 50, 189, 19, 60,
+        ],
+    ],
+    [
+        [
+            40, 12, 194, 46, 247, 222, 58, 252, 87, 215, 47, 154, 251, 107, 52, 13, 128, 24, 213,
+            13, 195, 35, 191, 235, 68, 93, 189, 189, 252, 252, 167, 24,
+        ],
+        [
+            38, 105, 73, 132, 137, 11, 105, 85, 16, 244, 223, 124, 93, 158, 118, 81, 177, 159, 1,
+            69, 113, 28, 17, 50, 79, 17, 28, 208, 35, 218, 212, 25,
+        ],
+        [
+            76, 198, 33, 207, 191, 213, 53, 3, 200, 102, 78, 223, 93, 40, 61, 123, 106, 236, 185,
+            131, 214, 106, 80, 153, 115, 228, 225, 71, 31, 140, 113, 57,
+        ],
+        [
+            214, 79, 107, 70, 115, 107, 122, 106, 0, 239, 195, 79, 62, 111, 169, 40, 204, 73, 217,
+            164, 131, 200, 145, 244, 54, 62, 40, 186, 182, 44, 248, 23,
+        ],
+        [
+            242, 254, 205, 32, 90, 19, 103, 203, 170, 64, 162, 67, 182, 13, 75, 230, 28, 194, 34,
+            240, 204, 197, 198, 219, 78, 74, 72, 236, 11, 206, 32, 46,
+        ],
+        [
+            152, 23, 75, 211, 211, 169, 146, 12, 223, 100, 17, 184, 84, 89, 76, 194, 212, 15, 78,
+            245, 16, 56, 80, 218, 164, 120, 72, 246, 19, 28, 116, 28,
+        ],
+        [
+            74, 5, 117, 170, 126, 141, 251, 3, 12, 184, 128, 229, 31, 147, 243, 221, 79, 250, 241,
+            162, 81, 183, 76, 169, 164, 167, 195, 37, 111, 145, 214, 51,
+        ],
+        [
+            71, 243, 35, 221, 187, 141, 25, 109, 57, 157, 201, 174, 128, 157, 50, 164, 198, 111,
+            235, 150, 36, 252, 127, 131, 76, 90, 169, 91, 222, 26, 201, 6,
+        ],
+    ],
+    [
+        [
+            213, 238, 194, 146, 94, 121, 106, 132, 205, 35, 198, 73, 149, 185, 16, 238, 184, 3, 36,
+            162, 134, 91, 66, 150, 229, 202, 155, 71, 36, 244, 31, 18,
+        ],
+        [
+            114, 6, 174, 91, 0, 229, 59, 73, 36, 11, 45, 159, 105, 145, 142, 172, 102, 234, 203,
+            14, 22, 138, 48, 23, 194, 172, 140, 16, 65, 157, 119, 42,
+        ],
+        [
+            242, 66, 98, 57, 205, 27, 28, 168, 126, 141, 54, 41, 206, 178, 252, 138, 29, 199, 151,
+            192, 196, 176, 69, 22, 45, 185, 84, 64, 200, 215, 82, 19,
+        ],
+        [
+            50, 189, 133, 225, 116, 129, 14, 69, 207, 164, 13, 13, 250, 172, 186, 243, 244, 127,
+            185, 242, 1, 232, 229, 7, 170, 2, 10, 118, 44, 62, 29, 63,
+        ],
+        [
+            134, 20, 230, 242, 6, 31, 69, 27, 232, 249, 58, 102, 106, 148, 1, 224, 138, 125, 66,
+            223, 207, 45, 175, 235, 24, 152, 126, 136, 97, 120, 156, 26,
+        ],
+        [
+            206, 69, 248, 240, 137, 112, 230, 15, 55, 6, 9, 161, 176, 42, 199, 151, 177, 92, 10,
+            76, 38, 22, 158, 101, 58, 246, 68, 112, 208, 242, 223, 31,
+        ],
+        [
+            9, 185, 158, 109, 54, 50, 170, 95, 16, 229, 14, 119, 229, 171, 193, 73, 205, 98, 125,
+            87, 205, 43, 194, 214, 47, 121, 248, 196, 175, 28, 71, 18,
+        ],
+        [
+            166, 6, 125, 245, 207, 115, 3, 74, 255, 191, 88, 77, 92, 152, 122, 155, 252, 125, 203,
+            199, 219, 49, 179, 95, 85, 60, 174, 52, 41, 46, 122, 57,
+        ],
+    ],
+    [
+        [
+            215, 197, 242, 170, 148, 210, 105, 84, 28, 246, 154, 48, 114, 11, 47, 104, 198, 29, 79,
+            121, 85, 192, 83, 226, 104, 221, 36, 167, 10, 230, 9, 44,
+        ],
+        [
+            38, 101, 71, 27, 235, 109, 39, 104, 162, 219, 2, 102, 130, 75, 149, 224, 208, 106, 36,
+            35, 126, 77, 200, 120, 248, 70, 189, 98, 147, 56, 196, 33,
+        ],
+        [
+            43, 254, 197, 70, 182, 96, 195, 113, 109, 4, 37, 174, 86, 22, 45, 155, 149, 166, 47,
+            41, 235, 155, 60, 143, 107, 202, 246, 174, 99, 81, 182, 37,
+        ],
+        [
+            204, 133, 71, 6, 137, 11, 247, 251, 200, 146, 71, 8, 134, 144, 30, 115, 180, 230, 96,
+            37, 126, 8, 96, 241, 78, 104, 95, 13, 231, 243, 172, 0,
+        ],
+        [
+            19, 155, 215, 193, 160, 46, 131, 2, 59, 139, 238, 194, 57, 178, 12, 140, 3, 243, 64,
+            237, 112, 40, 81, 250, 124, 241, 12, 117, 130, 116, 254, 40,
+        ],
+        [
+            137, 165, 36, 240, 128, 172, 202, 88, 237, 127, 204, 45, 69, 177, 242, 25, 100, 146,
+            236, 198, 192, 92, 215, 18, 69, 4, 245, 4, 1, 10, 43, 52,
+        ],
+        [
+            3, 158, 53, 179, 240, 14, 146, 201, 182, 180, 67, 159, 181, 33, 165, 229, 217, 247, 33,
+            27, 167, 152, 110, 131, 85, 43, 206, 221, 226, 250, 123, 23,
+        ],
+        [
+            229, 92, 186, 133, 10, 181, 79, 50, 154, 37, 248, 83, 217, 228, 33, 159, 103, 149, 143,
+            33, 8, 183, 95, 113, 63, 102, 224, 73, 156, 251, 98, 37,
+        ],
+    ],
+    [
+        [
+            247, 74, 62, 239, 168, 228, 32, 209, 222, 23, 144, 181, 39, 128, 160, 88, 15, 214, 249,
+            216, 183, 217, 18, 79, 72, 114, 111, 253, 179, 143, 225, 48,
+        ],
+        [
+            40, 173, 194, 76, 40, 155, 20, 143, 254, 219, 116, 6, 91, 177, 224, 105, 43, 133, 196,
+            4, 242, 87, 73, 118, 249, 232, 136, 223, 69, 92, 238, 24,
+        ],
+        [
+            158, 53, 48, 117, 246, 139, 220, 102, 7, 22, 194, 218, 130, 117, 34, 146, 1, 31, 87,
+            139, 146, 132, 54, 142, 233, 247, 135, 110, 93, 193, 162, 4,
+        ],
+        [
+            134, 20, 204, 240, 252, 33, 224, 236, 178, 214, 249, 240, 220, 247, 221, 114, 160, 124,
+            110, 165, 70, 19, 132, 54, 244, 161, 6, 225, 112, 95, 154, 35,
+        ],
+        [
+            106, 46, 14, 29, 169, 215, 146, 162, 206, 26, 154, 130, 201, 59, 173, 149, 168, 203,
+            105, 14, 148, 193, 107, 250, 103, 1, 79, 222, 39, 226, 119, 0,
+        ],
+        [
+            234, 18, 118, 231, 14, 17, 232, 50, 40, 103, 81, 18, 143, 207, 224, 52, 62, 0, 102,
+            217, 182, 165, 217, 235, 230, 180, 13, 68, 2, 18, 40, 40,
+        ],
+        [
+            75, 123, 96, 255, 76, 203, 72, 134, 54, 123, 235, 42, 70, 231, 240, 72, 34, 190, 255,
+            142, 236, 80, 214, 84, 148, 191, 46, 41, 191, 9, 249, 49,
+        ],
+        [
+            81, 106, 77, 254, 224, 248, 86, 236, 175, 228, 23, 60, 12, 21, 156, 181, 16, 96, 194,
+            65, 43, 72, 84, 213, 169, 23, 235, 175, 17, 160, 101, 40,
+        ],
+    ],
+    [
+        [
+            255, 202, 243, 40, 59, 189, 65, 206, 36, 58, 220, 59, 32, 50, 215, 251, 250, 199, 144,
+            167, 60, 147, 124, 145, 211, 191, 40, 253, 45, 57, 65, 62,
+        ],
+        [
+            216, 142, 222, 34, 95, 115, 109, 52, 136, 6, 48, 112, 55, 233, 214, 65, 188, 63, 63,
+            188, 30, 125, 219, 228, 96, 39, 2, 232, 216, 236, 36, 24,
+        ],
+        [
+            49, 214, 133, 89, 17, 232, 45, 73, 222, 70, 231, 0, 157, 115, 175, 226, 197, 144, 161,
+            60, 109, 17, 96, 18, 208, 193, 222, 87, 232, 106, 203, 63,
+        ],
+        [
+            222, 205, 168, 98, 100, 250, 218, 211, 223, 20, 227, 19, 84, 40, 183, 228, 179, 174,
+            193, 9, 150, 36, 54, 235, 138, 48, 91, 217, 90, 2, 68, 12,
+        ],
+        [
+            248, 49, 13, 135, 252, 104, 109, 197, 85, 103, 6, 201, 50, 224, 152, 124, 78, 50, 46,
+            240, 133, 124, 241, 227, 25, 35, 192, 2, 228, 37, 30, 58,
+        ],
+        [
+            14, 157, 212, 178, 33, 141, 195, 233, 148, 209, 99, 31, 162, 136, 5, 142, 120, 233,
+            220, 15, 79, 175, 177, 241, 146, 49, 102, 211, 252, 130, 121, 9,
+        ],
+        [
+            221, 245, 13, 62, 16, 26, 233, 246, 17, 220, 110, 118, 6, 251, 172, 236, 231, 108, 147,
+            73, 160, 123, 205, 72, 54, 107, 216, 172, 212, 227, 197, 56,
+        ],
+        [
+            26, 183, 159, 163, 99, 211, 238, 142, 63, 162, 131, 254, 192, 50, 122, 30, 11, 165, 0,
+            34, 137, 201, 18, 44, 35, 67, 75, 29, 91, 3, 64, 24,
+        ],
+    ],
+    [
+        [
+            217, 170, 198, 82, 164, 156, 48, 78, 243, 8, 162, 5, 161, 214, 26, 30, 105, 121, 221,
+            15, 178, 235, 126, 91, 240, 231, 234, 164, 129, 163, 23, 54,
+        ],
+        [
+            254, 124, 232, 46, 154, 234, 41, 132, 147, 167, 82, 156, 255, 152, 165, 188, 194, 112,
+            118, 106, 96, 179, 109, 52, 246, 42, 79, 35, 107, 57, 212, 26,
+        ],
+        [
+            38, 115, 40, 37, 250, 17, 254, 56, 6, 112, 253, 115, 15, 36, 210, 211, 238, 33, 204,
+            253, 199, 143, 3, 65, 134, 74, 79, 33, 60, 28, 170, 43,
+        ],
+        [
+            19, 156, 2, 238, 173, 43, 201, 213, 118, 138, 29, 250, 53, 73, 7, 189, 20, 61, 113,
+            139, 64, 230, 97, 1, 225, 169, 162, 11, 77, 134, 136, 53,
+        ],
+        [
+            78, 97, 56, 58, 166, 149, 113, 8, 98, 0, 137, 188, 8, 124, 162, 118, 177, 116, 251,
+            177, 116, 210, 102, 31, 183, 243, 26, 52, 83, 79, 186, 33,
+        ],
+        [
+            51, 200, 124, 61, 128, 141, 234, 223, 108, 47, 120, 168, 202, 74, 72, 146, 10, 40, 157,
+            61, 25, 196, 20, 146, 157, 45, 194, 230, 131, 171, 53, 16,
+        ],
+        [
+            181, 85, 36, 16, 18, 181, 21, 254, 141, 102, 213, 159, 132, 1, 57, 130, 9, 143, 121,
+            68, 15, 119, 7, 171, 143, 183, 193, 1, 249, 253, 36, 20,
+        ],
+        [
+            107, 77, 204, 52, 72, 81, 22, 230, 177, 54, 238, 49, 183, 222, 112, 78, 164, 255, 134,
+            65, 123, 8, 4, 195, 184, 24, 216, 143, 48, 172, 114, 26,
+        ],
+    ],
+    [
+        [
+            224, 165, 239, 181, 244, 151, 129, 54, 85, 87, 124, 240, 174, 1, 70, 118, 30, 155, 51,
+            250, 142, 68, 46, 119, 171, 232, 52, 161, 115, 45, 192, 28,
+        ],
+        [
+            177, 83, 89, 10, 98, 235, 250, 204, 137, 157, 85, 57, 213, 67, 50, 214, 196, 32, 115,
+            160, 55, 99, 37, 105, 50, 158, 157, 95, 87, 89, 12, 6,
+        ],
+        [
+            31, 181, 62, 233, 183, 232, 177, 247, 241, 220, 131, 89, 222, 45, 15, 22, 2, 29, 216,
+            31, 154, 176, 224, 163, 152, 55, 230, 74, 194, 64, 29, 1,
+        ],
+        [
+            174, 31, 125, 191, 176, 122, 35, 41, 104, 113, 68, 147, 119, 17, 103, 38, 222, 44, 81,
+            3, 250, 74, 9, 106, 176, 7, 241, 139, 171, 202, 152, 32,
+        ],
+        [
+            54, 165, 3, 154, 4, 5, 149, 0, 125, 146, 154, 23, 61, 148, 76, 158, 82, 143, 229, 163,
+            204, 218, 102, 166, 23, 255, 201, 209, 86, 160, 68, 15,
+        ],
+        [
+            107, 49, 88, 210, 239, 78, 195, 211, 215, 223, 154, 25, 177, 128, 228, 39, 237, 211,
+            251, 201, 51, 177, 160, 171, 26, 199, 234, 13, 143, 210, 6, 19,
+        ],
+        [
+            129, 220, 49, 186, 238, 46, 18, 145, 214, 116, 177, 103, 238, 253, 156, 98, 208, 242,
+            61, 98, 82, 77, 93, 237, 42, 106, 139, 37, 40, 119, 94, 21,
+        ],
+        [
+            99, 86, 197, 177, 154, 78, 39, 72, 132, 166, 108, 253, 48, 59, 67, 185, 2, 130, 56,
+            151, 148, 78, 188, 50, 138, 40, 127, 115, 8, 30, 195, 47,
+        ],
+    ],
+    [
+        [
+            161, 97, 38, 183, 81, 130, 85, 252, 94, 241, 250, 149, 204, 211, 68, 21, 144, 223, 76,
+            73, 67, 83, 162, 151, 197, 108, 157, 32, 148, 143, 62, 26,
+        ],
+        [
+            186, 237, 123, 78, 107, 54, 30, 146, 192, 222, 165, 177, 2, 125, 183, 167, 236, 168,
+            96, 121, 6, 147, 225, 117, 86, 8, 15, 115, 149, 199, 1, 31,
+        ],
+        [
+            91, 208, 64, 25, 137, 126, 121, 244, 6, 205, 13, 56, 5, 211, 30, 139, 68, 85, 197, 221,
+            100, 14, 18, 32, 193, 3, 151, 227, 148, 4, 192, 0,
+        ],
+        [
+            132, 233, 13, 214, 23, 47, 150, 6, 226, 216, 88, 203, 152, 212, 8, 231, 1, 141, 112,
+            240, 220, 127, 199, 201, 254, 112, 119, 135, 253, 128, 237, 24,
+        ],
+        [
+            208, 154, 28, 21, 219, 23, 84, 233, 114, 177, 88, 89, 112, 204, 130, 28, 13, 124, 13,
+            71, 67, 197, 83, 80, 157, 25, 105, 158, 2, 150, 133, 47,
+        ],
+        [
+            102, 50, 242, 246, 255, 157, 245, 139, 43, 72, 245, 232, 239, 122, 214, 227, 114, 31,
+            59, 175, 126, 249, 229, 161, 47, 124, 232, 45, 116, 187, 11, 6,
+        ],
+        [
+            195, 235, 184, 23, 101, 52, 32, 120, 163, 252, 87, 10, 118, 21, 95, 10, 118, 95, 109,
+            88, 251, 173, 11, 86, 187, 194, 230, 32, 85, 54, 187, 6,
+        ],
+        [
+            11, 77, 255, 109, 67, 103, 249, 253, 225, 160, 107, 82, 170, 72, 28, 221, 50, 158, 118,
+            22, 15, 51, 157, 150, 64, 174, 9, 18, 110, 94, 134, 63,
+        ],
+    ],
+    [
+        [
+            22, 249, 212, 177, 47, 64, 198, 103, 181, 243, 4, 164, 46, 243, 160, 120, 81, 116, 50,
+            224, 30, 154, 199, 23, 49, 128, 92, 209, 125, 1, 248, 10,
+        ],
+        [
+            202, 149, 25, 118, 221, 245, 101, 65, 28, 151, 69, 128, 19, 207, 9, 86, 54, 248, 254,
+            163, 143, 209, 12, 53, 158, 149, 44, 216, 140, 192, 33, 1,
+        ],
+        [
+            160, 220, 56, 72, 111, 111, 70, 75, 244, 213, 20, 118, 166, 117, 67, 124, 122, 251, 51,
+            98, 117, 157, 56, 173, 9, 19, 156, 208, 121, 109, 33, 7,
+        ],
+        [
+            88, 192, 255, 45, 177, 228, 254, 60, 125, 5, 56, 103, 211, 6, 132, 123, 20, 169, 138,
+            89, 208, 137, 112, 92, 166, 113, 164, 47, 31, 242, 69, 19,
+        ],
+        [
+            71, 100, 47, 249, 20, 104, 251, 81, 0, 130, 176, 233, 221, 69, 63, 21, 95, 229, 105,
+            213, 176, 43, 152, 148, 63, 203, 237, 97, 68, 27, 5, 46,
+        ],
+        [
+            213, 68, 150, 155, 57, 103, 131, 237, 51, 253, 41, 186, 132, 242, 66, 88, 43, 204, 111,
+            137, 65, 204, 245, 92, 57, 182, 47, 87, 206, 38, 232, 56,
+        ],
+        [
+            5, 222, 1, 109, 48, 37, 104, 111, 196, 51, 129, 84, 228, 187, 45, 176, 46, 194, 26,
+            108, 193, 235, 216, 205, 73, 148, 115, 216, 187, 176, 202, 33,
+        ],
+        [
+            52, 125, 84, 43, 125, 255, 223, 79, 212, 184, 34, 97, 130, 37, 146, 155, 142, 123, 197,
+            113, 16, 190, 149, 192, 3, 69, 64, 162, 2, 247, 186, 39,
+        ],
+    ],
+    [
+        [
+            100, 246, 118, 128, 108, 93, 29, 54, 43, 222, 151, 194, 22, 167, 184, 64, 178, 30, 254,
+            104, 231, 101, 219, 176, 100, 66, 227, 21, 60, 56, 141, 30,
+        ],
+        [
+            25, 82, 5, 57, 97, 112, 70, 14, 177, 181, 80, 33, 243, 121, 214, 125, 15, 56, 54, 178,
+            173, 129, 105, 53, 204, 161, 47, 31, 104, 212, 113, 30,
+        ],
+        [
+            165, 241, 162, 162, 146, 225, 123, 214, 227, 9, 94, 232, 224, 33, 220, 126, 140, 230,
+            100, 6, 146, 206, 32, 87, 34, 226, 9, 137, 94, 24, 29, 56,
+        ],
+        [
+            210, 204, 192, 45, 111, 180, 6, 42, 143, 142, 209, 66, 70, 70, 165, 125, 177, 136, 61,
+            170, 218, 137, 47, 140, 145, 98, 97, 201, 242, 38, 159, 13,
+        ],
+        [
+            145, 131, 248, 82, 176, 63, 234, 187, 225, 244, 68, 228, 160, 221, 168, 229, 196, 111,
+            210, 249, 182, 190, 50, 110, 79, 189, 198, 201, 186, 177, 167, 22,
+        ],
+        [
+            64, 115, 113, 246, 255, 216, 234, 56, 117, 195, 120, 55, 240, 134, 160, 169, 39, 37,
+            80, 157, 183, 5, 183, 141, 102, 99, 209, 75, 179, 115, 212, 40,
+        ],
+        [
+            168, 252, 46, 212, 207, 192, 61, 237, 74, 29, 184, 78, 230, 155, 18, 104, 17, 182, 192,
+            138, 131, 165, 221, 197, 28, 227, 210, 173, 81, 160, 166, 58,
+        ],
+        [
+            77, 53, 146, 43, 89, 3, 223, 140, 112, 124, 116, 255, 250, 126, 220, 113, 46, 150, 26,
+            249, 193, 109, 169, 1, 91, 73, 98, 140, 174, 75, 63, 15,
+        ],
+    ],
+    [
+        [
+            27, 205, 44, 170, 203, 156, 219, 207, 220, 128, 50, 89, 195, 109, 65, 110, 108, 8, 55,
+            253, 180, 73, 204, 109, 234, 238, 167, 255, 123, 234, 84, 24,
+        ],
+        [
+            127, 219, 25, 52, 81, 140, 114, 75, 213, 68, 108, 1, 95, 51, 226, 118, 149, 197, 171,
+            220, 251, 33, 88, 169, 50, 122, 38, 100, 3, 102, 47, 31,
+        ],
+        [
+            116, 246, 165, 168, 166, 54, 240, 34, 61, 44, 75, 36, 18, 76, 242, 135, 212, 88, 133,
+            169, 34, 137, 102, 214, 6, 14, 5, 61, 212, 36, 247, 51,
+        ],
+        [
+            181, 3, 99, 237, 164, 47, 170, 88, 174, 148, 98, 149, 163, 57, 231, 192, 105, 214, 110,
+            164, 11, 208, 98, 230, 184, 137, 159, 127, 173, 163, 196, 36,
+        ],
+        [
+            62, 15, 190, 131, 36, 208, 162, 22, 187, 30, 242, 168, 211, 115, 26, 134, 153, 102, 79,
+            19, 117, 123, 31, 37, 200, 237, 190, 49, 222, 82, 194, 6,
+        ],
+        [
+            130, 193, 193, 11, 20, 203, 1, 24, 41, 18, 242, 33, 158, 52, 92, 183, 150, 111, 127,
+            153, 106, 13, 55, 96, 121, 87, 76, 174, 91, 50, 8, 21,
+        ],
+        [
+            25, 206, 189, 81, 111, 245, 100, 197, 220, 52, 174, 171, 137, 120, 124, 247, 234, 110,
+            216, 252, 100, 114, 82, 52, 23, 134, 212, 218, 74, 119, 94, 20,
+        ],
+        [
+            222, 24, 83, 2, 137, 110, 39, 174, 67, 16, 243, 169, 132, 178, 196, 239, 153, 218, 85,
+            165, 204, 160, 193, 202, 190, 116, 134, 156, 227, 79, 126, 31,
+        ],
+    ],
+    [
+        [
+            78, 127, 250, 132, 73, 120, 250, 80, 235, 105, 226, 127, 217, 64, 142, 70, 102, 179,
+            220, 176, 43, 150, 213, 22, 220, 27, 16, 110, 202, 206, 150, 2,
+        ],
+        [
+            59, 135, 36, 89, 92, 38, 243, 89, 157, 94, 193, 187, 36, 198, 31, 210, 144, 172, 169,
+            226, 100, 166, 162, 107, 179, 124, 242, 58, 192, 181, 120, 31,
+        ],
+        [
+            244, 226, 171, 215, 32, 82, 150, 4, 29, 112, 228, 54, 44, 49, 219, 85, 165, 229, 235,
+            179, 29, 52, 144, 132, 17, 254, 63, 120, 60, 4, 33, 28,
+        ],
+        [
+            94, 250, 234, 126, 51, 236, 214, 132, 207, 148, 71, 2, 99, 254, 12, 161, 167, 46, 79,
+            54, 232, 205, 208, 140, 236, 34, 79, 62, 195, 152, 152, 44,
+        ],
+        [
+            236, 54, 144, 91, 214, 215, 143, 43, 147, 135, 206, 43, 142, 33, 216, 123, 160, 20,
+            128, 138, 19, 57, 31, 213, 191, 145, 230, 241, 196, 67, 228, 45,
+        ],
+        [
+            209, 246, 124, 2, 205, 158, 164, 155, 232, 52, 224, 121, 49, 167, 125, 186, 64, 190,
+            110, 213, 253, 154, 230, 8, 203, 72, 208, 156, 224, 14, 26, 36,
+        ],
+        [
+            2, 163, 112, 13, 243, 117, 175, 20, 37, 74, 70, 184, 159, 43, 64, 58, 196, 60, 58, 97,
+            217, 56, 155, 232, 182, 122, 231, 235, 63, 244, 85, 54,
+        ],
+        [
+            198, 207, 127, 56, 2, 173, 97, 18, 140, 235, 98, 17, 74, 58, 229, 135, 107, 233, 107,
+            97, 101, 167, 19, 153, 50, 196, 142, 26, 74, 12, 31, 24,
+        ],
+    ],
+    [
+        [
+            27, 63, 161, 142, 183, 196, 17, 99, 100, 98, 158, 20, 142, 103, 84, 220, 11, 21, 113,
+            159, 248, 107, 32, 78, 227, 20, 95, 12, 63, 74, 188, 50,
+        ],
+        [
+            202, 124, 66, 161, 185, 74, 107, 125, 210, 209, 173, 82, 129, 191, 17, 80, 68, 23, 17,
+            109, 138, 102, 163, 219, 39, 177, 231, 178, 186, 189, 100, 41,
+        ],
+        [
+            165, 199, 235, 218, 57, 201, 68, 38, 225, 8, 202, 8, 122, 10, 9, 3, 108, 9, 192, 10,
+            77, 228, 225, 137, 192, 34, 172, 150, 3, 144, 72, 50,
+        ],
+        [
+            243, 144, 241, 83, 19, 129, 69, 136, 39, 17, 21, 64, 217, 91, 137, 38, 123, 162, 240,
+            193, 242, 181, 40, 21, 87, 126, 38, 49, 184, 28, 16, 7,
+        ],
+        [
+            238, 195, 172, 123, 53, 111, 247, 70, 103, 77, 54, 97, 229, 183, 174, 143, 101, 174,
+            158, 2, 5, 2, 30, 76, 208, 223, 129, 66, 119, 241, 118, 17,
+        ],
+        [
+            94, 251, 39, 193, 48, 215, 167, 73, 107, 136, 251, 46, 162, 178, 167, 131, 148, 160,
+            247, 72, 132, 67, 69, 217, 32, 144, 252, 60, 155, 172, 213, 11,
+        ],
+        [
+            136, 203, 58, 211, 248, 4, 150, 29, 122, 226, 157, 183, 129, 29, 48, 15, 99, 138, 246,
+            99, 67, 146, 78, 105, 219, 58, 247, 132, 205, 250, 234, 13,
+        ],
+        [
+            131, 246, 106, 110, 134, 217, 32, 180, 116, 227, 242, 87, 223, 171, 248, 156, 56, 249,
+            118, 66, 102, 195, 13, 122, 117, 15, 166, 104, 223, 110, 200, 38,
+        ],
+    ],
+    [
+        [
+            248, 41, 85, 64, 78, 103, 70, 171, 95, 20, 190, 196, 220, 19, 20, 34, 203, 240, 224,
+            22, 20, 168, 71, 249, 105, 188, 34, 115, 181, 131, 207, 26,
+        ],
+        [
+            130, 35, 15, 37, 46, 188, 165, 135, 236, 67, 238, 130, 228, 16, 12, 182, 223, 202, 150,
+            47, 130, 124, 225, 5, 183, 157, 197, 97, 133, 28, 77, 6,
+        ],
+        [
+            200, 136, 113, 135, 204, 108, 67, 234, 187, 200, 171, 194, 9, 124, 29, 232, 155, 249,
+            23, 190, 69, 94, 168, 236, 104, 122, 134, 228, 92, 98, 135, 15,
+        ],
+        [
+            40, 64, 67, 103, 146, 167, 207, 42, 161, 242, 39, 181, 77, 11, 239, 91, 33, 194, 4,
+            143, 210, 181, 34, 134, 240, 253, 73, 170, 44, 240, 204, 60,
+        ],
+        [
+            251, 77, 3, 112, 185, 64, 10, 145, 1, 112, 49, 180, 162, 46, 158, 133, 19, 73, 150,
+            189, 121, 207, 13, 244, 198, 103, 144, 22, 66, 97, 93, 20,
+        ],
+        [
+            127, 204, 42, 168, 86, 226, 173, 153, 6, 106, 143, 186, 137, 126, 128, 239, 134, 108,
+            77, 33, 189, 136, 242, 212, 142, 45, 206, 210, 159, 136, 78, 12,
+        ],
+        [
+            15, 253, 114, 72, 101, 192, 37, 62, 200, 113, 200, 20, 58, 212, 84, 36, 71, 29, 81,
+            225, 177, 24, 48, 98, 16, 4, 235, 72, 37, 79, 154, 60,
+        ],
+        [
+            153, 113, 168, 211, 229, 185, 26, 190, 217, 41, 18, 202, 163, 69, 193, 138, 93, 70, 45,
+            180, 29, 242, 126, 146, 176, 107, 25, 21, 253, 61, 191, 36,
+        ],
+    ],
+    [
+        [
+            246, 253, 20, 245, 213, 217, 176, 5, 165, 120, 172, 185, 67, 63, 124, 64, 27, 206, 210,
+            204, 46, 74, 6, 24, 213, 23, 24, 173, 66, 6, 232, 7,
+        ],
+        [
+            186, 109, 215, 209, 176, 2, 5, 129, 174, 195, 12, 193, 252, 117, 125, 60, 202, 235, 90,
+            58, 214, 95, 228, 254, 112, 219, 85, 209, 23, 135, 95, 56,
+        ],
+        [
+            148, 69, 223, 63, 194, 200, 74, 105, 138, 211, 153, 65, 156, 196, 218, 23, 227, 33,
+            197, 145, 61, 189, 254, 92, 219, 252, 232, 247, 238, 135, 155, 25,
+        ],
+        [
+            16, 74, 65, 243, 138, 145, 137, 152, 228, 22, 218, 130, 235, 43, 33, 254, 132, 238,
+            221, 161, 148, 92, 148, 30, 29, 84, 186, 39, 228, 47, 56, 44,
+        ],
+        [
+            114, 111, 3, 54, 230, 233, 73, 242, 188, 183, 225, 49, 201, 217, 39, 206, 215, 138, 72,
+            191, 187, 215, 115, 117, 156, 251, 68, 31, 186, 218, 56, 62,
+        ],
+        [
+            174, 161, 85, 223, 12, 89, 158, 140, 24, 219, 99, 174, 136, 215, 56, 209, 179, 109, 87,
+            118, 194, 55, 18, 230, 34, 87, 235, 151, 247, 40, 15, 9,
+        ],
+        [
+            188, 199, 8, 222, 231, 93, 94, 85, 25, 248, 96, 68, 134, 135, 102, 132, 189, 31, 19,
+            187, 49, 97, 47, 124, 106, 216, 69, 133, 160, 167, 141, 62,
+        ],
+        [
+            158, 55, 224, 15, 244, 146, 13, 184, 185, 172, 203, 161, 20, 202, 230, 1, 78, 165, 72,
+            73, 127, 2, 36, 55, 110, 119, 241, 238, 23, 86, 241, 23,
+        ],
+    ],
+    [
+        [
+            135, 127, 214, 177, 50, 175, 15, 156, 209, 192, 69, 139, 50, 0, 233, 92, 181, 39, 10,
+            69, 65, 8, 254, 137, 208, 22, 174, 245, 220, 39, 224, 49,
+        ],
+        [
+            89, 164, 61, 68, 166, 224, 4, 27, 209, 222, 1, 46, 57, 173, 182, 122, 135, 238, 56,
+            170, 111, 216, 230, 184, 201, 196, 196, 111, 52, 252, 149, 31,
+        ],
+        [
+            44, 67, 177, 56, 207, 234, 197, 117, 53, 180, 148, 180, 138, 63, 54, 133, 255, 80, 171,
+            53, 5, 133, 46, 157, 122, 49, 143, 26, 210, 189, 190, 56,
+        ],
+        [
+            97, 11, 237, 129, 221, 220, 1, 91, 199, 236, 87, 251, 50, 166, 242, 156, 29, 149, 195,
+            211, 215, 89, 109, 129, 216, 39, 165, 199, 238, 33, 118, 18,
+        ],
+        [
+            173, 167, 107, 119, 184, 254, 187, 104, 208, 100, 103, 46, 4, 153, 8, 135, 55, 157, 79,
+            182, 182, 244, 11, 141, 124, 43, 93, 138, 221, 251, 107, 61,
+        ],
+        [
+            35, 15, 241, 4, 169, 175, 97, 122, 64, 8, 38, 135, 20, 128, 36, 135, 7, 241, 86, 36,
+            227, 18, 58, 52, 156, 65, 251, 13, 51, 40, 1, 62,
+        ],
+        [
+            51, 214, 155, 250, 163, 83, 17, 145, 93, 141, 84, 108, 188, 234, 73, 63, 21, 220, 19,
+            70, 34, 254, 118, 13, 101, 146, 8, 159, 246, 201, 62, 9,
+        ],
+        [
+            42, 79, 34, 69, 94, 116, 129, 61, 198, 162, 167, 131, 186, 165, 197, 204, 39, 114, 19,
+            170, 141, 174, 239, 143, 233, 204, 27, 176, 172, 62, 211, 19,
+        ],
+    ],
+    [
+        [
+            11, 146, 12, 170, 203, 61, 124, 253, 186, 30, 3, 132, 3, 164, 20, 218, 152, 38, 222,
+            27, 241, 100, 118, 24, 108, 196, 164, 220, 168, 167, 65, 43,
+        ],
+        [
+            56, 137, 74, 113, 79, 61, 238, 6, 241, 48, 30, 175, 59, 105, 39, 66, 42, 235, 181, 21,
+            93, 90, 98, 121, 104, 211, 8, 30, 95, 51, 143, 17,
+        ],
+        [
+            60, 233, 97, 79, 255, 211, 206, 175, 40, 250, 215, 143, 238, 202, 102, 55, 30, 120, 62,
+            152, 92, 135, 110, 174, 8, 230, 16, 108, 211, 6, 76, 48,
+        ],
+        [
+            150, 98, 90, 96, 10, 194, 174, 119, 245, 44, 32, 222, 185, 134, 169, 110, 150, 234,
+            207, 3, 247, 241, 123, 96, 227, 44, 194, 88, 206, 67, 79, 60,
+        ],
+        [
+            231, 190, 200, 68, 220, 134, 95, 81, 234, 146, 172, 193, 126, 114, 165, 46, 10, 32,
+            188, 216, 92, 197, 110, 121, 224, 230, 85, 185, 195, 221, 182, 43,
+        ],
+        [
+            136, 228, 204, 68, 47, 198, 41, 175, 24, 45, 174, 97, 56, 168, 205, 226, 158, 67, 146,
+            78, 214, 241, 137, 115, 247, 95, 3, 43, 191, 50, 72, 8,
+        ],
+        [
+            252, 139, 167, 182, 91, 54, 101, 249, 218, 222, 216, 145, 121, 148, 42, 239, 125, 253,
+            192, 157, 169, 4, 134, 248, 242, 176, 20, 70, 253, 215, 235, 10,
+        ],
+        [
+            122, 194, 254, 40, 70, 70, 110, 39, 34, 206, 80, 159, 44, 21, 73, 57, 96, 107, 154, 37,
+            162, 44, 188, 179, 64, 145, 122, 9, 170, 208, 180, 42,
+        ],
+    ],
+    [
+        [
+            140, 93, 7, 187, 156, 138, 71, 223, 25, 250, 16, 248, 240, 31, 202, 232, 177, 222, 30,
+            229, 189, 102, 196, 144, 189, 121, 65, 16, 249, 168, 130, 42,
+        ],
+        [
+            111, 180, 120, 71, 245, 37, 82, 193, 217, 93, 132, 203, 59, 47, 30, 247, 231, 188, 194,
+            215, 197, 25, 185, 86, 89, 33, 212, 138, 138, 126, 129, 40,
+        ],
+        [
+            156, 59, 188, 165, 192, 116, 8, 175, 249, 205, 27, 121, 79, 17, 148, 80, 75, 228, 1,
+            107, 20, 121, 226, 166, 82, 171, 242, 115, 149, 163, 96, 60,
+        ],
+        [
+            45, 235, 1, 13, 44, 236, 199, 11, 58, 20, 32, 81, 144, 62, 102, 97, 31, 14, 155, 161,
+            193, 6, 141, 114, 110, 193, 54, 254, 148, 188, 62, 25,
+        ],
+        [
+            121, 92, 222, 72, 218, 89, 183, 106, 4, 64, 223, 224, 171, 98, 19, 105, 146, 15, 179,
+            92, 172, 246, 197, 249, 51, 137, 124, 218, 98, 21, 105, 15,
+        ],
+        [
+            171, 221, 122, 139, 130, 21, 237, 201, 5, 138, 198, 110, 44, 60, 79, 49, 185, 87, 190,
+            128, 122, 241, 184, 31, 77, 60, 167, 95, 209, 122, 194, 49,
+        ],
+        [
+            3, 199, 82, 229, 54, 214, 97, 104, 6, 223, 90, 80, 207, 165, 154, 190, 228, 253, 248,
+            89, 72, 20, 183, 139, 172, 180, 81, 7, 179, 47, 163, 43,
+        ],
+        [
+            23, 206, 138, 108, 6, 214, 33, 144, 242, 253, 75, 234, 133, 244, 122, 168, 41, 181,
+            167, 62, 99, 40, 18, 100, 20, 61, 142, 234, 208, 41, 17, 34,
+        ],
+    ],
+];
+
+pub fn generator() -> pallas::Affine {
+    pallas::Affine::from_xy(
+        pallas::Base::from_bytes(&GENERATOR.0).unwrap(),
+        pallas::Base::from_bytes(&GENERATOR.1).unwrap(),
+    )
+    .unwrap()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::super::{
+        test_lagrange_coeffs, test_zs_and_us, NOTE_COMMITMENT_PERSONALIZATION, NUM_WINDOWS,
+    };
+    use super::*;
+    use group::Curve;
+    use halo2_gadgets::primitives::sinsemilla::CommitDomain;
+    use pasta_curves::{
+        arithmetic::{CurveAffine, FieldExt},
+        pallas,
+    };
+
+    #[test]
+    fn generator() {
+        let domain = CommitDomain::new(NOTE_COMMITMENT_PERSONALIZATION);
+        let point = domain.R();
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(*coords.x(), pallas::Base::from_bytes(&GENERATOR.0).unwrap());
+        assert_eq!(*coords.y(), pallas::Base::from_bytes(&GENERATOR.1).unwrap());
+    }
+
+    #[test]
+    fn lagrange_coeffs() {
+        let base = super::generator();
+        test_lagrange_coeffs(base, NUM_WINDOWS);
+    }
+
+    #[test]
+    fn z() {
+        let base = super::generator();
+        test_zs_and_us(base, &Z, &U, NUM_WINDOWS);
+    }
+}

+ 2963 - 0
src/crypto/constants/fixed_bases/nullifier_k.rs

@@ -0,0 +1,2963 @@
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    pallas,
+};
+
+pub const GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        117, 202, 71, 228, 167, 106, 111, 211, 155, 219, 181, 204, 146, 177, 126, 94, 207, 201,
+        244, 250, 113, 85, 55, 46, 141, 25, 168, 156, 22, 170, 231, 37,
+    ],
+    [
+        204, 1, 224, 26, 226, 220, 184, 45, 51, 180, 193, 193, 158, 164, 224, 95, 117, 255, 8, 32,
+        68, 115, 4, 136, 132, 51, 26, 27, 133, 31, 92, 21,
+    ],
+);
+
+/// Full-width z-values for GENERATOR
+pub const Z: [u64; super::NUM_WINDOWS] = [
+    34374, 173069, 40776, 220066, 45494, 37762, 5245, 11979, 33386, 238556, 128731, 12128, 89982,
+    85351, 9804, 12820, 80455, 100009, 24382, 17854, 26367, 7067, 102106, 64293, 114999, 172304,
+    36687, 11287, 66386, 41470, 182654, 12214, 36528, 16257, 26179, 15660, 106189, 211703, 12936,
+    2506, 149799, 82965, 117810, 98881, 296, 146201, 63200, 31766, 78221, 6587, 27974, 126041,
+    19927, 79339, 210060, 127148, 10109, 19815, 107452, 10296, 642, 11828, 3985, 2984, 30806,
+    12554, 1815, 19894, 16790, 33748, 12879, 1742, 30858, 118563, 26855, 75617, 10167, 17660,
+    33638, 89236, 50234, 30489, 67488, 50229, 29277,
+];
+
+/// Full-width u-values for GENERATOR
+pub const U: [[[u8; 32]; super::H]; super::NUM_WINDOWS] = [
+    [
+        [
+            8, 177, 117, 90, 104, 127, 169, 131, 254, 128, 23, 151, 181, 247, 22, 208, 55, 1, 147,
+            216, 84, 35, 129, 16, 134, 195, 231, 78, 90, 27, 48, 24,
+        ],
+        [
+            85, 52, 30, 137, 203, 92, 107, 164, 157, 0, 160, 220, 77, 151, 245, 43, 236, 219, 6,
+            127, 136, 136, 255, 80, 178, 129, 223, 223, 100, 205, 206, 60,
+        ],
+        [
+            180, 42, 81, 35, 92, 89, 115, 34, 230, 154, 57, 180, 27, 241, 82, 7, 29, 18, 87, 188,
+            15, 115, 37, 92, 226, 71, 117, 25, 58, 188, 84, 2,
+        ],
+        [
+            120, 152, 127, 75, 237, 238, 241, 80, 87, 202, 187, 80, 67, 210, 115, 228, 187, 183,
+            190, 104, 143, 201, 79, 59, 88, 235, 35, 30, 112, 142, 245, 41,
+        ],
+        [
+            137, 203, 204, 3, 111, 36, 152, 243, 202, 11, 171, 157, 74, 86, 136, 224, 134, 228, 83,
+            142, 77, 3, 87, 124, 174, 254, 51, 139, 199, 223, 108, 33,
+        ],
+        [
+            253, 61, 90, 128, 49, 47, 137, 144, 47, 195, 161, 160, 78, 225, 222, 129, 15, 194, 150,
+            16, 41, 55, 82, 238, 34, 87, 98, 170, 213, 158, 15, 50,
+        ],
+        [
+            47, 235, 116, 15, 252, 144, 163, 83, 0, 21, 138, 234, 11, 181, 189, 10, 246, 121, 216,
+            134, 47, 95, 213, 3, 238, 46, 179, 91, 217, 89, 45, 51,
+        ],
+        [
+            14, 37, 210, 28, 30, 181, 151, 46, 9, 92, 16, 9, 143, 179, 209, 165, 243, 236, 31, 73,
+            1, 41, 26, 125, 225, 42, 241, 153, 7, 72, 154, 28,
+        ],
+    ],
+    [
+        [
+            155, 23, 107, 105, 142, 88, 223, 1, 145, 75, 68, 196, 138, 223, 209, 168, 178, 183,
+            154, 186, 235, 94, 192, 81, 170, 238, 26, 126, 159, 204, 87, 18,
+        ],
+        [
+            23, 143, 212, 151, 42, 93, 52, 146, 4, 240, 71, 229, 183, 45, 75, 117, 31, 86, 162,
+            145, 194, 110, 118, 145, 36, 1, 110, 255, 119, 221, 191, 4,
+        ],
+        [
+            43, 199, 119, 40, 42, 43, 118, 185, 214, 192, 11, 20, 35, 124, 64, 65, 126, 39, 23,
+            136, 102, 196, 220, 99, 190, 252, 163, 189, 215, 110, 5, 26,
+        ],
+        [
+            231, 221, 137, 18, 190, 54, 27, 37, 198, 161, 251, 131, 26, 85, 24, 253, 119, 85, 63,
+            73, 4, 205, 90, 160, 68, 17, 124, 250, 142, 144, 165, 7,
+        ],
+        [
+            83, 50, 206, 53, 156, 115, 230, 212, 31, 155, 204, 33, 132, 233, 228, 213, 249, 252,
+            224, 9, 157, 163, 184, 220, 25, 118, 167, 180, 145, 86, 59, 27,
+        ],
+        [
+            245, 214, 106, 201, 143, 76, 98, 94, 184, 16, 72, 167, 42, 124, 18, 182, 124, 0, 122,
+            151, 24, 228, 104, 144, 81, 240, 105, 126, 158, 79, 213, 60,
+        ],
+        [
+            117, 59, 119, 9, 69, 161, 159, 137, 154, 195, 28, 54, 240, 214, 26, 97, 138, 121, 199,
+            4, 28, 17, 159, 186, 52, 216, 186, 6, 65, 17, 155, 53,
+        ],
+        [
+            131, 74, 9, 131, 251, 243, 140, 39, 209, 183, 173, 30, 223, 144, 252, 210, 71, 196,
+            218, 92, 149, 114, 87, 13, 176, 167, 135, 21, 79, 51, 166, 21,
+        ],
+    ],
+    [
+        [
+            106, 53, 57, 143, 70, 101, 179, 227, 157, 251, 249, 89, 23, 241, 33, 172, 138, 109,
+            112, 10, 239, 116, 201, 204, 70, 88, 47, 122, 115, 244, 190, 1,
+        ],
+        [
+            209, 215, 139, 155, 229, 13, 70, 83, 197, 215, 97, 80, 247, 86, 167, 76, 230, 225, 158,
+            160, 192, 121, 46, 212, 197, 12, 107, 161, 225, 174, 226, 6,
+        ],
+        [
+            112, 160, 94, 22, 110, 32, 8, 135, 32, 51, 220, 110, 15, 225, 140, 230, 76, 199, 123,
+            151, 87, 211, 19, 62, 21, 129, 16, 60, 12, 108, 165, 31,
+        ],
+        [
+            204, 30, 64, 88, 48, 86, 118, 103, 250, 219, 102, 20, 56, 126, 52, 226, 0, 61, 113,
+            192, 116, 132, 99, 78, 111, 44, 138, 247, 154, 143, 219, 27,
+        ],
+        [
+            234, 175, 176, 17, 157, 210, 254, 209, 26, 205, 38, 46, 13, 146, 162, 67, 133, 126, 0,
+            137, 173, 137, 151, 97, 177, 226, 59, 43, 155, 198, 51, 45,
+        ],
+        [
+            197, 96, 86, 193, 80, 242, 4, 255, 18, 52, 82, 105, 29, 253, 234, 3, 160, 233, 99, 224,
+            58, 44, 97, 40, 194, 99, 173, 127, 62, 47, 208, 37,
+        ],
+        [
+            22, 149, 249, 163, 1, 218, 101, 70, 94, 230, 144, 57, 241, 33, 6, 232, 196, 115, 108,
+            223, 76, 188, 1, 17, 42, 214, 155, 247, 149, 148, 238, 35,
+        ],
+        [
+            13, 87, 74, 130, 84, 86, 209, 2, 50, 148, 189, 154, 138, 103, 165, 188, 10, 34, 149,
+            21, 75, 83, 63, 88, 162, 137, 118, 232, 60, 157, 137, 53,
+        ],
+    ],
+    [
+        [
+            233, 74, 133, 175, 252, 244, 95, 128, 64, 52, 236, 30, 62, 251, 20, 39, 136, 210, 13,
+            125, 220, 122, 12, 168, 132, 0, 203, 121, 166, 114, 89, 55,
+        ],
+        [
+            23, 16, 81, 254, 130, 74, 96, 191, 239, 107, 112, 232, 193, 231, 115, 168, 222, 76,
+            200, 25, 29, 74, 120, 123, 219, 38, 10, 170, 159, 38, 151, 59,
+        ],
+        [
+            123, 54, 39, 213, 60, 136, 244, 129, 49, 166, 51, 223, 82, 7, 141, 210, 150, 80, 71,
+            91, 48, 195, 52, 32, 17, 149, 25, 63, 179, 211, 116, 44,
+        ],
+        [
+            109, 212, 117, 221, 214, 8, 16, 202, 176, 94, 85, 170, 181, 234, 43, 86, 151, 193, 42,
+            9, 185, 141, 187, 197, 32, 149, 233, 82, 135, 196, 226, 55,
+        ],
+        [
+            167, 160, 99, 140, 33, 119, 82, 182, 166, 50, 48, 229, 46, 170, 178, 22, 52, 2, 60,
+            138, 235, 97, 75, 141, 32, 166, 120, 45, 103, 212, 212, 54,
+        ],
+        [
+            127, 109, 31, 40, 88, 39, 93, 49, 112, 214, 201, 84, 181, 82, 212, 26, 236, 67, 108,
+            50, 59, 188, 242, 182, 163, 230, 153, 128, 207, 86, 214, 18,
+        ],
+        [
+            246, 232, 168, 240, 223, 17, 25, 238, 68, 106, 81, 83, 149, 255, 179, 85, 215, 221,
+            161, 98, 211, 255, 34, 100, 244, 171, 34, 77, 13, 97, 7, 31,
+        ],
+        [
+            203, 28, 143, 74, 174, 27, 47, 59, 154, 247, 128, 8, 70, 108, 73, 167, 25, 171, 132,
+            99, 192, 80, 53, 69, 93, 132, 35, 224, 141, 157, 182, 27,
+        ],
+    ],
+    [
+        [
+            158, 175, 208, 26, 183, 200, 147, 77, 15, 124, 87, 17, 47, 238, 228, 184, 132, 87, 24,
+            159, 255, 90, 200, 42, 118, 110, 207, 49, 100, 156, 40, 17,
+        ],
+        [
+            214, 80, 143, 90, 122, 14, 85, 237, 43, 157, 103, 184, 14, 213, 121, 149, 38, 12, 185,
+            162, 65, 76, 175, 234, 33, 6, 128, 70, 87, 64, 121, 32,
+        ],
+        [
+            239, 204, 8, 172, 229, 121, 210, 167, 213, 113, 34, 212, 58, 196, 246, 231, 235, 249,
+            10, 1, 133, 180, 234, 122, 185, 209, 137, 42, 151, 187, 90, 49,
+        ],
+        [
+            38, 201, 204, 153, 118, 114, 213, 247, 168, 32, 231, 172, 56, 74, 104, 185, 82, 10,
+            189, 39, 0, 120, 76, 60, 187, 40, 207, 49, 112, 7, 226, 13,
+        ],
+        [
+            49, 138, 24, 179, 17, 17, 139, 34, 66, 7, 206, 250, 69, 221, 34, 216, 233, 153, 230,
+            61, 129, 139, 206, 131, 48, 182, 148, 13, 71, 243, 111, 22,
+        ],
+        [
+            196, 88, 22, 46, 64, 213, 113, 115, 213, 31, 243, 86, 240, 86, 2, 152, 250, 26, 105,
+            171, 184, 61, 159, 95, 65, 29, 25, 78, 240, 245, 10, 21,
+        ],
+        [
+            78, 28, 8, 195, 230, 66, 59, 242, 40, 196, 240, 152, 11, 217, 164, 30, 69, 14, 45, 198,
+            239, 214, 233, 45, 101, 211, 98, 235, 100, 118, 55, 4,
+        ],
+        [
+            78, 224, 209, 126, 212, 30, 129, 15, 115, 153, 242, 115, 131, 124, 100, 161, 132, 191,
+            92, 106, 202, 67, 75, 214, 38, 188, 240, 124, 54, 224, 93, 45,
+        ],
+    ],
+    [
+        [
+            217, 244, 110, 79, 182, 134, 95, 114, 224, 131, 47, 250, 120, 210, 60, 25, 170, 192,
+            236, 37, 233, 77, 18, 29, 113, 70, 184, 210, 226, 211, 36, 23,
+        ],
+        [
+            97, 25, 216, 18, 187, 188, 60, 255, 57, 173, 195, 70, 147, 75, 123, 96, 32, 186, 235,
+            203, 168, 246, 177, 206, 183, 164, 219, 209, 70, 100, 221, 31,
+        ],
+        [
+            103, 65, 104, 143, 235, 96, 30, 14, 136, 100, 168, 208, 183, 133, 61, 209, 88, 171,
+            234, 144, 128, 186, 154, 57, 115, 217, 218, 65, 208, 15, 164, 5,
+        ],
+        [
+            129, 17, 125, 139, 223, 114, 198, 101, 118, 190, 54, 211, 209, 193, 119, 254, 191, 151,
+            210, 201, 167, 151, 199, 55, 144, 146, 28, 125, 15, 140, 64, 50,
+        ],
+        [
+            157, 114, 191, 73, 254, 85, 156, 148, 193, 78, 64, 118, 237, 231, 95, 96, 156, 223,
+            251, 161, 108, 104, 68, 68, 208, 108, 52, 36, 193, 20, 209, 39,
+        ],
+        [
+            153, 221, 73, 244, 97, 41, 144, 181, 6, 255, 117, 181, 73, 60, 182, 130, 126, 179, 61,
+            86, 141, 96, 33, 233, 132, 47, 145, 215, 219, 54, 147, 11,
+        ],
+        [
+            94, 107, 185, 219, 70, 23, 205, 149, 216, 21, 53, 23, 98, 243, 185, 235, 221, 198, 49,
+            177, 48, 56, 251, 180, 141, 119, 212, 20, 227, 194, 64, 19,
+        ],
+        [
+            85, 148, 121, 226, 36, 182, 97, 6, 122, 1, 31, 39, 92, 65, 36, 147, 205, 69, 204, 90,
+            204, 166, 179, 223, 5, 125, 68, 63, 64, 128, 63, 21,
+        ],
+    ],
+    [
+        [
+            2, 169, 25, 203, 212, 185, 124, 61, 150, 239, 166, 57, 177, 48, 11, 166, 89, 251, 110,
+            226, 49, 69, 226, 224, 250, 219, 252, 137, 18, 129, 43, 16,
+        ],
+        [
+            232, 38, 209, 98, 87, 176, 166, 69, 137, 12, 213, 116, 97, 229, 25, 53, 64, 231, 213,
+            255, 182, 234, 179, 255, 159, 162, 70, 169, 254, 193, 83, 31,
+        ],
+        [
+            120, 35, 170, 169, 134, 229, 114, 38, 97, 2, 84, 36, 156, 80, 255, 130, 168, 156, 195,
+            7, 97, 120, 214, 215, 145, 152, 211, 201, 5, 36, 62, 32,
+        ],
+        [
+            57, 117, 255, 121, 168, 160, 43, 168, 42, 239, 58, 130, 73, 244, 242, 252, 9, 27, 79,
+            245, 226, 201, 189, 164, 57, 142, 150, 162, 209, 17, 121, 53,
+        ],
+        [
+            36, 52, 2, 158, 240, 153, 97, 93, 33, 133, 153, 174, 3, 23, 116, 181, 157, 223, 70, 59,
+            100, 101, 102, 195, 6, 148, 63, 228, 72, 6, 27, 35,
+        ],
+        [
+            52, 197, 226, 140, 56, 213, 200, 104, 117, 7, 101, 250, 224, 176, 188, 134, 69, 59, 23,
+            121, 181, 197, 236, 229, 24, 199, 79, 243, 120, 143, 120, 4,
+        ],
+        [
+            148, 181, 32, 129, 234, 255, 140, 131, 155, 227, 16, 106, 1, 185, 148, 195, 165, 0,
+            152, 130, 138, 134, 208, 12, 171, 88, 26, 142, 46, 36, 140, 52,
+        ],
+        [
+            184, 10, 44, 43, 76, 195, 89, 67, 120, 15, 19, 199, 96, 229, 109, 115, 237, 50, 51,
+            156, 230, 142, 3, 95, 109, 79, 20, 130, 54, 41, 225, 62,
+        ],
+    ],
+    [
+        [
+            171, 227, 38, 163, 220, 64, 126, 70, 193, 140, 185, 136, 97, 117, 204, 177, 109, 139,
+            25, 38, 25, 5, 27, 31, 169, 30, 18, 188, 243, 99, 125, 29,
+        ],
+        [
+            22, 191, 88, 67, 150, 57, 68, 66, 95, 65, 24, 208, 188, 6, 1, 8, 62, 195, 83, 224, 113,
+            136, 61, 75, 90, 155, 228, 209, 155, 239, 250, 52,
+        ],
+        [
+            64, 110, 241, 54, 230, 252, 13, 172, 5, 83, 159, 231, 249, 166, 47, 196, 203, 230, 82,
+            234, 108, 75, 104, 217, 140, 93, 142, 42, 54, 10, 218, 13,
+        ],
+        [
+            119, 77, 69, 84, 160, 177, 65, 143, 32, 247, 4, 101, 44, 47, 38, 175, 53, 8, 239, 115,
+            177, 68, 166, 173, 245, 168, 188, 129, 49, 220, 136, 0,
+        ],
+        [
+            95, 4, 124, 89, 22, 199, 81, 164, 42, 73, 149, 244, 67, 141, 249, 132, 13, 55, 180, 2,
+            70, 238, 186, 129, 130, 196, 191, 36, 188, 89, 173, 3,
+        ],
+        [
+            185, 209, 66, 253, 215, 62, 233, 72, 67, 105, 81, 154, 41, 127, 66, 152, 203, 206, 232,
+            49, 28, 14, 132, 182, 245, 30, 42, 158, 61, 84, 55, 34,
+        ],
+        [
+            168, 36, 132, 217, 188, 230, 252, 8, 63, 232, 169, 205, 203, 35, 80, 7, 166, 179, 165,
+            178, 34, 108, 179, 252, 12, 77, 183, 64, 21, 134, 195, 58,
+        ],
+        [
+            167, 154, 142, 35, 246, 107, 255, 85, 225, 7, 179, 39, 11, 163, 211, 139, 38, 5, 130,
+            124, 212, 111, 10, 235, 206, 93, 247, 118, 97, 74, 76, 3,
+        ],
+    ],
+    [
+        [
+            17, 35, 231, 232, 187, 165, 56, 74, 129, 69, 48, 249, 182, 107, 89, 163, 51, 84, 170,
+            211, 242, 113, 166, 225, 78, 206, 206, 92, 51, 71, 168, 33,
+        ],
+        [
+            218, 32, 99, 108, 201, 243, 16, 42, 119, 238, 180, 204, 217, 64, 11, 181, 159, 187,
+            222, 68, 31, 23, 215, 14, 135, 43, 60, 234, 199, 136, 209, 56,
+        ],
+        [
+            229, 89, 20, 107, 93, 96, 226, 179, 225, 22, 59, 133, 30, 79, 105, 26, 42, 251, 35, 41,
+            45, 151, 73, 127, 72, 33, 32, 44, 114, 183, 200, 12,
+        ],
+        [
+            0, 214, 119, 87, 158, 203, 58, 209, 100, 45, 242, 75, 5, 118, 29, 75, 239, 159, 30,
+            192, 196, 58, 48, 65, 129, 192, 13, 14, 115, 79, 219, 26,
+        ],
+        [
+            98, 88, 236, 178, 70, 249, 24, 151, 194, 204, 95, 251, 142, 94, 94, 218, 19, 253, 216,
+            155, 109, 25, 166, 168, 213, 209, 169, 135, 244, 2, 153, 63,
+        ],
+        [
+            56, 137, 153, 59, 70, 236, 157, 224, 248, 77, 167, 238, 185, 216, 239, 54, 176, 54,
+            164, 172, 129, 29, 243, 226, 56, 188, 149, 113, 66, 53, 111, 29,
+        ],
+        [
+            175, 39, 133, 206, 20, 108, 5, 54, 187, 154, 174, 144, 23, 193, 58, 173, 223, 19, 181,
+            161, 102, 248, 146, 180, 241, 58, 121, 96, 8, 218, 201, 61,
+        ],
+        [
+            214, 255, 102, 226, 32, 197, 112, 142, 159, 244, 213, 201, 228, 8, 141, 112, 112, 6,
+            182, 31, 68, 215, 126, 66, 131, 203, 253, 206, 102, 155, 100, 9,
+        ],
+    ],
+    [
+        [
+            134, 183, 10, 76, 61, 159, 117, 15, 17, 79, 26, 161, 72, 129, 77, 56, 221, 0, 23, 32,
+            255, 12, 114, 208, 110, 133, 136, 7, 222, 63, 99, 63,
+        ],
+        [
+            144, 188, 53, 201, 167, 105, 34, 93, 26, 15, 121, 27, 37, 68, 230, 134, 119, 6, 76,
+            159, 120, 62, 200, 59, 205, 110, 251, 54, 132, 113, 216, 47,
+        ],
+        [
+            226, 242, 186, 127, 110, 179, 100, 138, 238, 127, 104, 131, 32, 98, 96, 244, 121, 154,
+            129, 71, 34, 157, 103, 53, 124, 131, 128, 159, 113, 77, 226, 52,
+        ],
+        [
+            149, 188, 192, 214, 255, 107, 1, 216, 118, 134, 46, 23, 126, 73, 234, 175, 39, 77, 232,
+            99, 36, 76, 27, 215, 134, 227, 12, 255, 98, 120, 110, 13,
+        ],
+        [
+            55, 19, 111, 30, 3, 196, 248, 249, 103, 123, 237, 222, 156, 152, 143, 182, 93, 209,
+            227, 184, 97, 233, 110, 31, 198, 108, 2, 144, 202, 161, 246, 48,
+        ],
+        [
+            89, 105, 183, 28, 13, 186, 20, 45, 187, 147, 254, 9, 196, 222, 10, 212, 208, 35, 59,
+            168, 234, 91, 53, 115, 119, 28, 240, 140, 226, 217, 16, 13,
+        ],
+        [
+            71, 90, 196, 184, 172, 101, 82, 49, 204, 76, 80, 24, 30, 132, 224, 136, 92, 236, 73,
+            240, 43, 152, 36, 240, 204, 168, 202, 133, 47, 56, 86, 21,
+        ],
+        [
+            137, 123, 99, 242, 15, 214, 23, 223, 103, 70, 184, 82, 212, 43, 109, 198, 1, 146, 88,
+            223, 141, 176, 98, 56, 8, 226, 123, 144, 58, 148, 80, 34,
+        ],
+    ],
+    [
+        [
+            112, 203, 118, 169, 67, 201, 121, 80, 95, 50, 206, 193, 132, 19, 44, 16, 100, 210, 169,
+            174, 43, 239, 197, 42, 153, 77, 189, 127, 134, 228, 51, 1,
+        ],
+        [
+            67, 82, 109, 220, 119, 200, 223, 134, 201, 18, 211, 184, 106, 158, 243, 17, 160, 51,
+            223, 227, 252, 83, 229, 84, 109, 162, 231, 240, 207, 99, 145, 49,
+        ],
+        [
+            127, 38, 205, 72, 71, 81, 43, 26, 72, 50, 220, 151, 66, 66, 41, 27, 99, 47, 96, 142, 1,
+            83, 210, 246, 201, 190, 8, 34, 223, 215, 84, 33,
+        ],
+        [
+            196, 65, 248, 47, 253, 158, 13, 126, 69, 77, 144, 88, 158, 188, 200, 138, 70, 7, 237,
+            81, 207, 18, 52, 77, 131, 187, 61, 208, 53, 15, 87, 28,
+        ],
+        [
+            142, 69, 186, 111, 164, 34, 17, 159, 95, 229, 106, 79, 178, 236, 40, 122, 205, 228, 56,
+            78, 187, 203, 150, 216, 228, 220, 77, 102, 101, 57, 73, 22,
+        ],
+        [
+            34, 97, 52, 100, 250, 150, 39, 93, 193, 188, 241, 25, 57, 178, 210, 228, 116, 102, 120,
+            194, 43, 92, 58, 223, 79, 172, 233, 206, 42, 252, 212, 23,
+        ],
+        [
+            255, 63, 76, 185, 74, 23, 208, 38, 220, 177, 232, 82, 75, 190, 205, 7, 107, 83, 37, 46,
+            184, 118, 15, 69, 3, 148, 140, 160, 31, 107, 64, 19,
+        ],
+        [
+            12, 74, 20, 81, 11, 141, 102, 144, 211, 239, 203, 214, 114, 193, 197, 27, 220, 229,
+            202, 253, 48, 109, 46, 125, 149, 151, 47, 224, 141, 201, 39, 41,
+        ],
+    ],
+    [
+        [
+            48, 45, 200, 86, 94, 46, 69, 245, 90, 200, 213, 189, 150, 174, 57, 226, 248, 5, 169,
+            162, 250, 242, 92, 40, 218, 149, 132, 31, 157, 36, 254, 60,
+        ],
+        [
+            81, 121, 54, 199, 38, 109, 10, 32, 0, 15, 80, 210, 86, 161, 85, 51, 217, 129, 254, 180,
+            183, 108, 178, 137, 49, 248, 205, 212, 55, 77, 123, 17,
+        ],
+        [
+            37, 248, 159, 204, 26, 229, 145, 238, 125, 74, 43, 139, 95, 23, 214, 19, 87, 91, 160,
+            213, 235, 11, 65, 199, 200, 90, 231, 254, 125, 91, 125, 49,
+        ],
+        [
+            178, 12, 107, 228, 177, 201, 160, 30, 244, 72, 143, 232, 142, 179, 253, 92, 117, 50,
+            44, 170, 122, 254, 72, 125, 220, 234, 140, 49, 161, 58, 153, 32,
+        ],
+        [
+            247, 237, 132, 219, 101, 146, 116, 139, 68, 147, 48, 176, 77, 83, 30, 181, 165, 91, 62,
+            137, 228, 23, 138, 14, 88, 132, 111, 111, 140, 123, 228, 58,
+        ],
+        [
+            18, 233, 193, 160, 178, 238, 235, 150, 3, 31, 61, 226, 24, 146, 32, 3, 177, 46, 49, 89,
+            49, 45, 71, 83, 119, 186, 203, 200, 163, 237, 116, 21,
+        ],
+        [
+            115, 144, 78, 114, 159, 231, 131, 65, 180, 121, 24, 139, 139, 29, 182, 131, 218, 81,
+            58, 73, 107, 254, 32, 46, 177, 216, 202, 137, 182, 124, 221, 10,
+        ],
+        [
+            223, 14, 173, 171, 179, 199, 71, 176, 71, 161, 186, 240, 0, 32, 204, 124, 160, 63, 112,
+            86, 71, 213, 245, 55, 138, 233, 228, 28, 149, 8, 9, 41,
+        ],
+    ],
+    [
+        [
+            21, 6, 131, 62, 42, 77, 174, 152, 2, 182, 147, 70, 52, 196, 221, 208, 21, 218, 63, 239,
+            142, 100, 80, 227, 206, 92, 178, 63, 213, 66, 228, 42,
+        ],
+        [
+            234, 98, 104, 233, 255, 69, 42, 117, 242, 174, 71, 237, 128, 208, 210, 92, 215, 80, 68,
+            54, 109, 133, 117, 120, 11, 193, 130, 150, 123, 248, 52, 50,
+        ],
+        [
+            42, 97, 215, 197, 142, 218, 220, 4, 99, 17, 179, 35, 227, 236, 159, 122, 227, 16, 41,
+            191, 142, 113, 7, 118, 168, 0, 200, 69, 87, 232, 203, 18,
+        ],
+        [
+            204, 101, 216, 98, 75, 52, 7, 133, 107, 63, 36, 58, 158, 102, 166, 65, 187, 189, 120,
+            36, 170, 181, 122, 231, 195, 77, 77, 164, 123, 199, 51, 45,
+        ],
+        [
+            69, 211, 219, 4, 90, 40, 61, 238, 40, 23, 38, 242, 82, 66, 124, 186, 78, 178, 158, 75,
+            9, 78, 88, 175, 124, 209, 52, 139, 154, 205, 152, 1,
+        ],
+        [
+            40, 177, 100, 175, 71, 133, 71, 147, 120, 232, 113, 156, 156, 171, 231, 14, 14, 48,
+            254, 27, 109, 239, 11, 41, 141, 122, 231, 120, 162, 61, 172, 53,
+        ],
+        [
+            138, 3, 230, 77, 88, 246, 242, 91, 53, 109, 136, 187, 226, 159, 63, 30, 210, 149, 85,
+            132, 19, 243, 108, 225, 16, 67, 206, 187, 22, 250, 158, 38,
+        ],
+        [
+            54, 230, 61, 20, 21, 69, 248, 130, 44, 13, 179, 216, 126, 95, 167, 29, 128, 81, 136,
+            81, 198, 181, 167, 108, 21, 92, 89, 163, 48, 9, 25, 49,
+        ],
+    ],
+    [
+        [
+            213, 68, 175, 186, 156, 48, 75, 216, 75, 120, 118, 229, 190, 251, 69, 197, 207, 233,
+            255, 33, 12, 44, 176, 102, 172, 203, 246, 139, 9, 148, 188, 21,
+        ],
+        [
+            59, 116, 78, 231, 0, 190, 4, 183, 254, 176, 57, 241, 16, 160, 195, 151, 109, 113, 65,
+            227, 234, 248, 162, 150, 59, 223, 226, 68, 211, 220, 124, 35,
+        ],
+        [
+            157, 241, 116, 218, 111, 20, 63, 220, 180, 253, 193, 124, 53, 174, 146, 115, 25, 21, 4,
+            184, 28, 62, 68, 1, 136, 40, 112, 99, 155, 130, 29, 25,
+        ],
+        [
+            107, 14, 195, 187, 170, 217, 205, 148, 49, 208, 203, 147, 220, 1, 216, 9, 235, 2, 23,
+            137, 226, 242, 113, 173, 119, 193, 192, 240, 96, 34, 203, 27,
+        ],
+        [
+            220, 189, 158, 255, 179, 2, 118, 209, 172, 32, 234, 150, 180, 140, 186, 88, 11, 146,
+            216, 229, 126, 96, 132, 108, 80, 11, 133, 21, 208, 31, 104, 23,
+        ],
+        [
+            34, 104, 190, 51, 173, 94, 133, 55, 100, 80, 120, 221, 114, 236, 129, 217, 2, 20, 117,
+            96, 59, 162, 69, 216, 80, 193, 215, 191, 222, 251, 213, 54,
+        ],
+        [
+            217, 173, 46, 115, 62, 139, 158, 81, 137, 145, 61, 242, 63, 26, 154, 80, 87, 23, 255,
+            158, 21, 151, 39, 16, 176, 188, 206, 50, 91, 132, 244, 48,
+        ],
+        [
+            125, 136, 4, 138, 60, 132, 107, 72, 160, 2, 185, 213, 99, 167, 64, 247, 133, 173, 139,
+            25, 250, 132, 174, 254, 31, 85, 94, 85, 52, 212, 209, 61,
+        ],
+    ],
+    [
+        [
+            220, 160, 48, 26, 85, 79, 138, 23, 139, 157, 143, 9, 40, 55, 28, 86, 243, 144, 211,
+            131, 58, 6, 188, 247, 0, 45, 174, 144, 19, 188, 181, 57,
+        ],
+        [
+            103, 128, 25, 9, 206, 137, 248, 46, 126, 157, 159, 0, 236, 255, 135, 58, 181, 227, 135,
+            176, 113, 94, 237, 66, 47, 151, 18, 229, 19, 72, 170, 8,
+        ],
+        [
+            46, 122, 169, 159, 37, 178, 130, 155, 49, 215, 123, 43, 108, 225, 225, 91, 74, 95, 1,
+            190, 16, 230, 9, 231, 61, 153, 72, 119, 42, 120, 10, 41,
+        ],
+        [
+            189, 179, 165, 203, 192, 23, 235, 85, 2, 155, 19, 118, 235, 123, 65, 219, 126, 163,
+            149, 241, 213, 44, 143, 103, 139, 91, 15, 175, 111, 183, 238, 35,
+        ],
+        [
+            52, 114, 250, 93, 151, 139, 135, 118, 40, 231, 118, 234, 63, 201, 15, 42, 126, 157,
+            136, 113, 54, 209, 76, 78, 136, 13, 28, 3, 57, 119, 28, 32,
+        ],
+        [
+            241, 223, 85, 153, 43, 88, 1, 195, 181, 239, 22, 16, 218, 11, 3, 91, 249, 42, 20, 25,
+            215, 41, 132, 194, 106, 145, 165, 100, 33, 215, 243, 54,
+        ],
+        [
+            185, 84, 49, 216, 187, 52, 40, 181, 184, 77, 168, 77, 5, 229, 36, 180, 82, 129, 99,
+            126, 222, 17, 2, 185, 176, 18, 198, 220, 41, 192, 84, 1,
+        ],
+        [
+            116, 111, 197, 38, 37, 6, 27, 181, 167, 142, 204, 148, 127, 82, 201, 197, 192, 133, 68,
+            126, 57, 93, 146, 225, 67, 223, 187, 252, 131, 16, 136, 46,
+        ],
+    ],
+    [
+        [
+            229, 194, 151, 215, 0, 49, 54, 48, 137, 138, 168, 12, 253, 114, 171, 220, 131, 85, 61,
+            41, 90, 111, 235, 175, 142, 32, 64, 15, 171, 10, 37, 55,
+        ],
+        [
+            179, 30, 248, 30, 85, 253, 191, 10, 66, 20, 9, 239, 72, 78, 126, 155, 5, 22, 16, 55,
+            236, 155, 48, 104, 120, 209, 179, 94, 72, 144, 136, 36,
+        ],
+        [
+            5, 85, 228, 82, 72, 151, 179, 40, 184, 104, 86, 64, 251, 178, 255, 222, 120, 33, 172,
+            13, 70, 48, 74, 179, 143, 139, 203, 101, 242, 164, 233, 11,
+        ],
+        [
+            155, 215, 194, 45, 223, 134, 9, 251, 102, 98, 255, 26, 99, 131, 158, 41, 28, 241, 244,
+            3, 14, 14, 150, 5, 198, 23, 195, 55, 67, 107, 145, 50,
+        ],
+        [
+            242, 66, 220, 115, 24, 115, 105, 247, 185, 102, 202, 149, 182, 74, 79, 71, 118, 46, 12,
+            174, 168, 154, 12, 49, 8, 175, 173, 107, 106, 231, 34, 46,
+        ],
+        [
+            218, 10, 168, 153, 218, 247, 27, 186, 177, 229, 129, 137, 17, 34, 173, 65, 77, 164,
+            106, 206, 109, 156, 174, 78, 141, 110, 2, 177, 136, 189, 222, 27,
+        ],
+        [
+            63, 206, 227, 252, 14, 115, 85, 145, 147, 2, 233, 37, 99, 52, 187, 61, 160, 216, 254,
+            113, 47, 202, 231, 30, 8, 95, 186, 3, 95, 93, 92, 46,
+        ],
+        [
+            194, 115, 177, 48, 84, 53, 255, 14, 255, 104, 86, 24, 225, 135, 136, 207, 223, 82, 248,
+            120, 107, 19, 233, 239, 239, 174, 182, 203, 11, 70, 33, 29,
+        ],
+    ],
+    [
+        [
+            255, 67, 169, 212, 128, 117, 218, 146, 73, 118, 113, 48, 51, 232, 221, 22, 69, 49, 118,
+            127, 159, 164, 25, 203, 45, 231, 32, 76, 20, 3, 182, 35,
+        ],
+        [
+            128, 192, 45, 222, 4, 111, 75, 67, 105, 135, 179, 9, 231, 6, 181, 241, 43, 60, 145,
+            129, 101, 107, 239, 197, 249, 142, 15, 73, 190, 55, 8, 32,
+        ],
+        [
+            75, 171, 221, 252, 200, 45, 18, 225, 108, 75, 63, 243, 49, 199, 160, 123, 50, 138, 70,
+            237, 85, 182, 107, 126, 116, 200, 23, 254, 122, 68, 35, 39,
+        ],
+        [
+            220, 204, 97, 165, 14, 201, 153, 93, 114, 166, 64, 88, 30, 193, 77, 84, 243, 228, 14,
+            33, 240, 75, 108, 168, 10, 68, 170, 110, 117, 133, 17, 14,
+        ],
+        [
+            7, 8, 119, 58, 124, 100, 81, 248, 160, 28, 127, 136, 223, 190, 172, 109, 44, 130, 189,
+            200, 120, 37, 118, 199, 93, 174, 13, 227, 228, 109, 77, 24,
+        ],
+        [
+            117, 48, 90, 251, 34, 191, 185, 106, 156, 198, 3, 244, 147, 116, 106, 125, 9, 98, 103,
+            25, 67, 247, 161, 20, 215, 143, 98, 56, 111, 192, 80, 12,
+        ],
+        [
+            75, 150, 146, 192, 192, 73, 4, 222, 31, 115, 161, 55, 189, 28, 254, 27, 140, 18, 245,
+            197, 156, 136, 196, 80, 24, 215, 69, 183, 144, 198, 218, 25,
+        ],
+        [
+            4, 59, 137, 5, 85, 187, 155, 254, 174, 111, 148, 55, 146, 77, 162, 139, 54, 133, 46,
+            24, 60, 78, 15, 39, 58, 21, 189, 95, 85, 66, 75, 11,
+        ],
+    ],
+    [
+        [
+            38, 12, 159, 91, 61, 126, 7, 197, 252, 179, 45, 40, 117, 226, 17, 100, 55, 150, 227,
+            217, 209, 62, 51, 50, 221, 205, 172, 219, 49, 51, 83, 32,
+        ],
+        [
+            57, 122, 44, 109, 85, 120, 81, 245, 24, 47, 86, 189, 244, 231, 243, 83, 100, 219, 109,
+            83, 65, 99, 251, 105, 85, 7, 198, 149, 255, 76, 29, 29,
+        ],
+        [
+            83, 248, 191, 219, 235, 44, 62, 170, 200, 75, 122, 207, 106, 115, 35, 184, 127, 201,
+            143, 180, 11, 25, 135, 78, 235, 106, 174, 203, 163, 11, 14, 1,
+        ],
+        [
+            3, 65, 229, 5, 70, 240, 200, 34, 11, 204, 14, 118, 49, 109, 108, 179, 116, 175, 211,
+            123, 3, 227, 30, 105, 244, 63, 147, 137, 174, 6, 58, 49,
+        ],
+        [
+            255, 44, 184, 49, 125, 73, 101, 79, 205, 191, 13, 181, 32, 246, 234, 221, 236, 168,
+            174, 34, 80, 203, 242, 216, 243, 28, 146, 97, 71, 119, 33, 37,
+        ],
+        [
+            66, 233, 66, 56, 132, 114, 180, 163, 103, 56, 133, 98, 139, 1, 125, 189, 147, 192, 40,
+            64, 96, 55, 15, 157, 50, 250, 230, 167, 42, 104, 5, 31,
+        ],
+        [
+            6, 183, 137, 208, 244, 75, 158, 179, 218, 29, 142, 60, 229, 162, 211, 232, 18, 152, 34,
+            85, 133, 122, 3, 251, 178, 144, 51, 171, 190, 238, 27, 3,
+        ],
+        [
+            129, 246, 203, 236, 115, 97, 172, 103, 209, 116, 141, 209, 172, 34, 244, 120, 19, 127,
+            229, 88, 113, 135, 129, 213, 94, 46, 29, 66, 93, 142, 188, 36,
+        ],
+    ],
+    [
+        [
+            194, 202, 86, 162, 6, 28, 7, 93, 217, 68, 231, 140, 53, 182, 117, 79, 205, 232, 162,
+            118, 84, 16, 245, 15, 199, 85, 234, 133, 4, 11, 210, 35,
+        ],
+        [
+            157, 145, 197, 39, 234, 104, 156, 193, 122, 16, 169, 90, 174, 93, 243, 193, 116, 187,
+            240, 105, 166, 97, 121, 195, 247, 81, 101, 251, 216, 51, 21, 54,
+        ],
+        [
+            61, 143, 204, 33, 38, 137, 156, 7, 19, 73, 71, 241, 59, 229, 100, 52, 53, 38, 189, 124,
+            89, 219, 37, 80, 179, 34, 169, 198, 3, 223, 233, 10,
+        ],
+        [
+            204, 47, 178, 44, 209, 241, 91, 185, 131, 159, 137, 31, 191, 153, 83, 229, 11, 23, 175,
+            81, 72, 20, 30, 65, 99, 191, 42, 182, 180, 250, 108, 44,
+        ],
+        [
+            223, 219, 203, 230, 21, 177, 178, 244, 62, 182, 248, 215, 254, 41, 219, 104, 64, 104,
+            105, 86, 234, 81, 171, 153, 179, 116, 16, 103, 192, 250, 50, 38,
+        ],
+        [
+            179, 15, 111, 91, 124, 136, 230, 38, 62, 52, 144, 140, 164, 57, 139, 56, 98, 70, 189,
+            251, 255, 55, 115, 97, 196, 57, 221, 165, 145, 80, 26, 46,
+        ],
+        [
+            21, 103, 9, 56, 143, 106, 41, 164, 169, 198, 100, 253, 71, 31, 238, 128, 240, 35, 71,
+            86, 44, 61, 61, 237, 182, 110, 207, 53, 238, 201, 246, 40,
+        ],
+        [
+            204, 177, 216, 11, 64, 47, 94, 27, 176, 61, 203, 218, 169, 142, 37, 95, 21, 172, 57, 9,
+            223, 126, 135, 241, 193, 203, 213, 144, 92, 248, 186, 35,
+        ],
+    ],
+    [
+        [
+            228, 75, 109, 106, 255, 254, 130, 13, 9, 11, 211, 140, 45, 161, 63, 69, 215, 182, 22,
+            59, 74, 170, 177, 7, 2, 115, 14, 109, 242, 13, 68, 25,
+        ],
+        [
+            6, 222, 179, 66, 171, 58, 140, 170, 192, 130, 16, 180, 206, 179, 253, 194, 92, 54, 196,
+            149, 116, 69, 233, 218, 100, 13, 63, 9, 144, 54, 85, 33,
+        ],
+        [
+            95, 33, 20, 56, 49, 62, 85, 56, 154, 215, 173, 198, 73, 95, 232, 119, 212, 167, 148,
+            120, 147, 204, 164, 27, 136, 69, 78, 130, 7, 206, 240, 36,
+        ],
+        [
+            109, 38, 215, 164, 103, 152, 172, 47, 244, 227, 72, 242, 229, 117, 198, 228, 89, 185,
+            207, 83, 21, 173, 187, 111, 41, 54, 183, 144, 61, 53, 193, 59,
+        ],
+        [
+            67, 218, 51, 136, 12, 221, 238, 123, 201, 104, 185, 13, 178, 54, 4, 239, 242, 103, 151,
+            232, 203, 231, 207, 63, 60, 240, 41, 187, 153, 2, 249, 22,
+        ],
+        [
+            175, 206, 167, 190, 93, 40, 120, 180, 117, 248, 121, 191, 230, 16, 16, 194, 194, 12,
+            146, 20, 128, 18, 44, 31, 48, 232, 16, 11, 84, 110, 68, 8,
+        ],
+        [
+            136, 156, 120, 102, 134, 205, 174, 55, 52, 71, 4, 165, 3, 97, 61, 249, 52, 110, 212,
+            234, 83, 197, 244, 93, 107, 88, 47, 120, 63, 80, 100, 28,
+        ],
+        [
+            237, 132, 106, 72, 25, 163, 185, 172, 196, 20, 116, 129, 247, 220, 212, 128, 76, 154,
+            10, 50, 26, 220, 50, 179, 252, 180, 239, 44, 147, 71, 71, 38,
+        ],
+    ],
+    [
+        [
+            195, 126, 226, 101, 232, 151, 83, 172, 247, 79, 222, 218, 214, 224, 68, 44, 234, 50,
+            156, 252, 136, 137, 56, 174, 225, 55, 8, 111, 153, 167, 160, 43,
+        ],
+        [
+            241, 114, 11, 165, 35, 58, 224, 96, 147, 243, 117, 49, 124, 82, 194, 138, 217, 81, 168,
+            235, 194, 7, 11, 112, 218, 164, 244, 225, 127, 222, 190, 7,
+        ],
+        [
+            210, 109, 146, 106, 46, 44, 15, 251, 15, 32, 213, 72, 138, 6, 104, 145, 147, 59, 192,
+            77, 53, 213, 36, 69, 191, 247, 20, 79, 43, 242, 181, 47,
+        ],
+        [
+            204, 85, 163, 37, 144, 235, 182, 50, 84, 214, 30, 210, 246, 198, 20, 48, 217, 247, 117,
+            180, 207, 150, 47, 224, 35, 81, 66, 231, 203, 126, 250, 7,
+        ],
+        [
+            251, 235, 48, 197, 117, 61, 99, 74, 158, 107, 9, 243, 137, 155, 185, 232, 53, 14, 195,
+            20, 2, 83, 162, 104, 55, 30, 229, 35, 167, 108, 91, 63,
+        ],
+        [
+            230, 107, 185, 57, 172, 171, 223, 240, 186, 182, 106, 85, 77, 252, 75, 255, 117, 50,
+            88, 60, 41, 76, 188, 39, 194, 16, 46, 117, 220, 130, 64, 10,
+        ],
+        [
+            228, 156, 144, 195, 138, 103, 97, 79, 225, 101, 43, 50, 232, 2, 152, 215, 232, 116,
+            177, 254, 13, 17, 224, 87, 217, 149, 255, 187, 18, 241, 16, 15,
+        ],
+        [
+            83, 173, 113, 34, 69, 81, 9, 148, 205, 79, 152, 7, 254, 207, 74, 31, 247, 197, 139, 66,
+            18, 219, 218, 37, 222, 252, 172, 80, 184, 147, 51, 41,
+        ],
+    ],
+    [
+        [
+            0, 89, 55, 87, 138, 18, 8, 243, 120, 2, 157, 224, 104, 227, 73, 235, 249, 187, 159,
+            136, 40, 1, 155, 200, 193, 125, 4, 81, 219, 169, 8, 56,
+        ],
+        [
+            116, 29, 157, 39, 107, 56, 158, 126, 218, 221, 193, 170, 23, 95, 163, 26, 206, 168,
+            133, 96, 36, 195, 59, 152, 44, 66, 146, 48, 61, 175, 172, 43,
+        ],
+        [
+            213, 48, 102, 181, 10, 10, 192, 234, 79, 4, 153, 169, 240, 170, 155, 171, 56, 254, 3,
+            110, 104, 41, 167, 162, 135, 231, 107, 109, 118, 222, 146, 3,
+        ],
+        [
+            165, 81, 105, 154, 149, 116, 129, 132, 226, 15, 34, 154, 113, 82, 142, 224, 187, 254,
+            157, 40, 127, 53, 13, 50, 6, 116, 44, 28, 171, 25, 57, 11,
+        ],
+        [
+            137, 173, 137, 148, 183, 45, 212, 173, 208, 103, 238, 190, 209, 217, 109, 115, 131,
+            170, 167, 157, 48, 105, 2, 225, 33, 144, 56, 104, 74, 90, 101, 45,
+        ],
+        [
+            37, 210, 32, 187, 166, 239, 15, 248, 101, 84, 62, 170, 65, 179, 205, 5, 155, 124, 68,
+            191, 56, 128, 71, 92, 106, 68, 1, 162, 177, 208, 131, 32,
+        ],
+        [
+            20, 40, 151, 188, 73, 233, 86, 220, 88, 77, 88, 18, 101, 114, 204, 242, 37, 68, 158,
+            216, 166, 213, 147, 74, 136, 177, 146, 127, 183, 9, 51, 51,
+        ],
+        [
+            35, 250, 252, 114, 37, 150, 90, 62, 182, 153, 4, 114, 89, 207, 137, 211, 221, 60, 38,
+            181, 33, 54, 11, 251, 225, 50, 39, 247, 36, 64, 59, 60,
+        ],
+    ],
+    [
+        [
+            3, 44, 176, 61, 155, 104, 167, 47, 197, 180, 112, 16, 213, 166, 109, 139, 47, 145, 213,
+            181, 28, 249, 251, 77, 66, 197, 100, 68, 46, 151, 197, 40,
+        ],
+        [
+            229, 35, 247, 127, 1, 20, 236, 233, 188, 17, 88, 74, 87, 15, 3, 29, 133, 223, 178, 245,
+            50, 63, 172, 25, 149, 238, 2, 154, 212, 51, 108, 23,
+        ],
+        [
+            186, 13, 97, 147, 88, 88, 217, 127, 47, 123, 233, 132, 148, 151, 181, 146, 56, 81, 20,
+            162, 72, 61, 131, 202, 209, 20, 131, 189, 7, 97, 130, 13,
+        ],
+        [
+            139, 153, 27, 151, 116, 240, 246, 218, 212, 68, 91, 52, 237, 242, 111, 7, 137, 76, 231,
+            210, 148, 216, 28, 108, 27, 231, 141, 34, 80, 138, 59, 56,
+        ],
+        [
+            253, 100, 45, 165, 2, 73, 249, 202, 254, 16, 147, 135, 31, 124, 231, 212, 212, 0, 79,
+            103, 51, 195, 6, 238, 158, 204, 61, 69, 129, 149, 202, 11,
+        ],
+        [
+            103, 190, 49, 80, 44, 51, 242, 50, 73, 31, 21, 63, 205, 25, 99, 107, 172, 204, 132, 57,
+            220, 222, 181, 200, 245, 232, 39, 33, 20, 227, 78, 40,
+        ],
+        [
+            85, 212, 71, 43, 217, 39, 72, 56, 143, 82, 141, 13, 180, 31, 10, 76, 187, 243, 38, 201,
+            119, 39, 155, 236, 217, 54, 223, 154, 194, 164, 134, 62,
+        ],
+        [
+            77, 5, 128, 184, 241, 69, 158, 253, 102, 134, 157, 97, 98, 242, 100, 188, 115, 143,
+            210, 202, 43, 167, 1, 228, 159, 25, 90, 97, 135, 29, 156, 31,
+        ],
+    ],
+    [
+        [
+            36, 72, 161, 85, 169, 138, 112, 236, 110, 59, 12, 214, 194, 22, 221, 138, 62, 109, 108,
+            237, 74, 210, 136, 75, 62, 166, 199, 109, 221, 86, 136, 29,
+        ],
+        [
+            140, 2, 200, 184, 189, 53, 142, 10, 137, 117, 249, 87, 40, 107, 43, 120, 46, 109, 193,
+            103, 206, 125, 50, 217, 13, 183, 23, 93, 30, 254, 235, 19,
+        ],
+        [
+            135, 255, 108, 83, 58, 92, 159, 201, 196, 233, 222, 140, 225, 114, 46, 196, 1, 113,
+            133, 89, 242, 84, 195, 115, 216, 206, 91, 136, 138, 11, 182, 40,
+        ],
+        [
+            43, 56, 228, 25, 206, 194, 106, 233, 211, 143, 222, 188, 69, 112, 67, 95, 44, 35, 141,
+            217, 190, 181, 140, 62, 217, 117, 135, 249, 33, 200, 62, 24,
+        ],
+        [
+            27, 86, 219, 191, 131, 228, 7, 155, 210, 136, 213, 240, 244, 130, 179, 191, 182, 222,
+            17, 154, 6, 97, 15, 123, 71, 182, 172, 41, 208, 234, 109, 21,
+        ],
+        [
+            223, 22, 81, 97, 125, 169, 6, 44, 41, 71, 184, 66, 241, 108, 28, 88, 120, 93, 200, 86,
+            150, 164, 255, 54, 241, 182, 103, 35, 29, 246, 255, 23,
+        ],
+        [
+            210, 52, 232, 184, 171, 196, 52, 49, 91, 18, 72, 164, 48, 119, 62, 14, 82, 171, 43, 64,
+            136, 163, 208, 132, 255, 220, 172, 227, 37, 160, 4, 13,
+        ],
+        [
+            158, 181, 213, 223, 176, 57, 134, 98, 137, 31, 26, 52, 93, 80, 212, 202, 96, 189, 24,
+            72, 94, 211, 23, 8, 135, 87, 25, 138, 244, 103, 178, 10,
+        ],
+    ],
+    [
+        [
+            240, 216, 75, 131, 74, 33, 115, 241, 209, 7, 112, 77, 251, 35, 7, 247, 247, 86, 143,
+            130, 144, 13, 181, 122, 153, 89, 125, 105, 99, 213, 33, 55,
+        ],
+        [
+            145, 235, 201, 158, 59, 22, 0, 15, 228, 200, 174, 78, 89, 87, 26, 249, 11, 155, 71, 79,
+            3, 34, 190, 254, 234, 73, 46, 92, 61, 216, 41, 17,
+        ],
+        [
+            43, 56, 20, 48, 194, 81, 86, 213, 164, 121, 220, 75, 76, 201, 36, 142, 56, 70, 75, 194,
+            140, 87, 136, 174, 210, 127, 214, 65, 193, 41, 107, 63,
+        ],
+        [
+            213, 92, 219, 226, 204, 5, 20, 13, 110, 238, 153, 209, 70, 249, 219, 212, 107, 56, 7,
+            179, 87, 36, 234, 35, 89, 18, 114, 25, 230, 192, 242, 11,
+        ],
+        [
+            226, 223, 162, 191, 16, 10, 133, 242, 11, 71, 12, 55, 220, 63, 111, 23, 30, 154, 90,
+            151, 140, 23, 118, 109, 212, 51, 99, 222, 98, 158, 237, 48,
+        ],
+        [
+            20, 38, 109, 230, 153, 122, 68, 236, 179, 59, 137, 231, 25, 246, 164, 211, 103, 164,
+            113, 21, 139, 125, 13, 45, 47, 207, 173, 18, 205, 128, 112, 16,
+        ],
+        [
+            133, 0, 26, 33, 217, 221, 37, 96, 168, 164, 192, 185, 154, 124, 126, 12, 113, 167, 105,
+            37, 99, 38, 76, 76, 244, 244, 98, 94, 185, 223, 178, 50,
+        ],
+        [
+            120, 250, 66, 188, 11, 58, 177, 140, 133, 4, 35, 210, 16, 107, 110, 139, 177, 78, 164,
+            108, 156, 193, 85, 154, 42, 199, 216, 70, 150, 47, 234, 38,
+        ],
+    ],
+    [
+        [
+            91, 250, 197, 122, 129, 9, 102, 216, 154, 110, 193, 132, 68, 224, 180, 95, 240, 62,
+            136, 1, 176, 233, 188, 19, 194, 229, 140, 112, 44, 133, 125, 24,
+        ],
+        [
+            249, 15, 38, 45, 54, 238, 216, 27, 31, 126, 65, 99, 176, 76, 76, 214, 121, 5, 114, 71,
+            130, 26, 237, 49, 235, 91, 254, 1, 144, 4, 163, 45,
+        ],
+        [
+            255, 229, 192, 133, 154, 196, 136, 105, 117, 96, 229, 23, 193, 198, 227, 47, 103, 66,
+            232, 204, 152, 70, 129, 24, 164, 199, 122, 63, 191, 92, 135, 20,
+        ],
+        [
+            145, 44, 90, 2, 241, 40, 255, 122, 79, 26, 250, 253, 187, 122, 164, 178, 138, 125, 75,
+            226, 146, 177, 191, 224, 93, 101, 229, 157, 138, 155, 12, 16,
+        ],
+        [
+            139, 122, 121, 78, 6, 21, 126, 230, 160, 18, 97, 42, 15, 118, 106, 37, 136, 251, 240,
+            227, 57, 51, 233, 199, 158, 70, 127, 104, 78, 185, 127, 8,
+        ],
+        [
+            200, 199, 55, 107, 21, 71, 88, 106, 158, 74, 81, 41, 158, 199, 169, 181, 24, 9, 235,
+            60, 232, 189, 129, 3, 44, 218, 123, 77, 232, 208, 128, 9,
+        ],
+        [
+            87, 199, 112, 222, 83, 57, 76, 182, 157, 113, 119, 150, 108, 143, 237, 75, 56, 50, 38,
+            66, 172, 194, 17, 165, 112, 37, 228, 185, 86, 2, 145, 62,
+        ],
+        [
+            140, 36, 76, 105, 203, 131, 114, 245, 40, 53, 57, 156, 212, 119, 252, 184, 23, 242, 29,
+            102, 122, 221, 83, 101, 87, 196, 251, 116, 162, 218, 192, 1,
+        ],
+    ],
+    [
+        [
+            97, 64, 127, 237, 110, 192, 220, 140, 59, 142, 248, 62, 234, 132, 188, 82, 67, 201,
+            217, 7, 201, 173, 228, 72, 105, 116, 5, 79, 175, 99, 110, 47,
+        ],
+        [
+            150, 89, 171, 150, 182, 170, 198, 17, 165, 5, 128, 18, 226, 2, 104, 242, 43, 208, 9,
+            148, 202, 37, 98, 172, 180, 251, 0, 83, 175, 210, 66, 58,
+        ],
+        [
+            17, 173, 81, 22, 153, 10, 186, 31, 241, 216, 106, 49, 89, 190, 84, 172, 253, 183, 24,
+            143, 238, 231, 209, 108, 168, 173, 98, 162, 198, 181, 254, 51,
+        ],
+        [
+            137, 210, 105, 132, 29, 175, 97, 107, 112, 74, 210, 47, 145, 197, 47, 143, 80, 208,
+            204, 127, 23, 42, 5, 235, 125, 56, 241, 210, 114, 164, 16, 20,
+        ],
+        [
+            132, 20, 239, 85, 238, 127, 107, 177, 97, 117, 240, 180, 115, 92, 140, 47, 146, 146,
+            209, 250, 105, 68, 254, 108, 179, 193, 247, 12, 193, 30, 102, 43,
+        ],
+        [
+            145, 126, 226, 38, 179, 157, 78, 13, 224, 130, 207, 125, 26, 174, 162, 43, 138, 2, 152,
+            36, 231, 146, 204, 225, 233, 239, 158, 247, 28, 56, 142, 26,
+        ],
+        [
+            91, 164, 60, 87, 26, 175, 68, 99, 255, 62, 87, 54, 247, 40, 87, 155, 223, 249, 133, 28,
+            117, 204, 149, 227, 61, 21, 58, 52, 75, 149, 250, 10,
+        ],
+        [
+            237, 191, 63, 71, 77, 84, 26, 130, 131, 163, 245, 220, 12, 111, 61, 79, 234, 238, 214,
+            176, 160, 20, 135, 93, 135, 186, 136, 38, 105, 93, 100, 15,
+        ],
+    ],
+    [
+        [
+            223, 170, 66, 190, 77, 208, 106, 211, 248, 2, 37, 34, 99, 11, 115, 188, 248, 104, 129,
+            217, 110, 246, 30, 138, 250, 119, 187, 198, 184, 231, 12, 7,
+        ],
+        [
+            120, 133, 72, 207, 98, 167, 236, 27, 52, 201, 169, 82, 14, 47, 143, 2, 249, 62, 196,
+            64, 24, 11, 206, 173, 64, 91, 37, 228, 197, 230, 184, 38,
+        ],
+        [
+            213, 11, 163, 125, 42, 99, 72, 223, 58, 183, 0, 153, 96, 92, 125, 212, 108, 65, 112,
+            252, 99, 25, 113, 161, 55, 130, 32, 116, 104, 18, 188, 46,
+        ],
+        [
+            142, 172, 196, 64, 209, 79, 68, 196, 33, 58, 63, 86, 184, 182, 233, 48, 38, 46, 86,
+            198, 52, 81, 36, 136, 62, 49, 52, 132, 26, 44, 174, 8,
+        ],
+        [
+            79, 79, 157, 236, 132, 179, 39, 72, 58, 22, 193, 191, 5, 165, 177, 232, 113, 76, 196,
+            135, 205, 206, 127, 137, 17, 121, 184, 142, 66, 50, 42, 30,
+        ],
+        [
+            140, 147, 23, 191, 59, 161, 110, 195, 158, 68, 129, 248, 198, 61, 3, 54, 198, 151, 148,
+            60, 165, 221, 201, 66, 76, 191, 167, 108, 16, 122, 2, 60,
+        ],
+        [
+            230, 31, 126, 106, 18, 212, 227, 114, 225, 54, 2, 184, 55, 2, 36, 148, 145, 243, 68,
+            157, 10, 231, 99, 227, 102, 179, 220, 245, 187, 202, 90, 3,
+        ],
+        [
+            131, 100, 10, 199, 130, 82, 185, 106, 12, 181, 129, 230, 230, 197, 136, 203, 147, 216,
+            212, 52, 200, 130, 43, 61, 218, 76, 160, 84, 61, 47, 4, 9,
+        ],
+    ],
+    [
+        [
+            55, 204, 232, 108, 99, 18, 152, 227, 32, 80, 114, 26, 128, 128, 125, 191, 206, 224,
+            241, 115, 26, 136, 84, 154, 148, 210, 33, 18, 177, 227, 22, 13,
+        ],
+        [
+            144, 114, 124, 2, 51, 175, 130, 107, 154, 122, 141, 251, 83, 165, 109, 160, 140, 155,
+            37, 33, 174, 241, 100, 50, 181, 99, 106, 235, 13, 20, 231, 49,
+        ],
+        [
+            216, 224, 156, 16, 159, 31, 195, 82, 159, 97, 74, 220, 80, 110, 13, 143, 225, 137, 212,
+            157, 20, 130, 117, 243, 6, 194, 113, 149, 109, 157, 117, 48,
+        ],
+        [
+            203, 152, 160, 212, 237, 116, 129, 128, 172, 159, 96, 132, 111, 87, 224, 76, 161, 186,
+            43, 113, 253, 239, 239, 247, 147, 215, 35, 210, 24, 189, 172, 42,
+        ],
+        [
+            127, 6, 186, 229, 204, 141, 254, 171, 184, 224, 28, 52, 14, 248, 229, 15, 103, 100,
+            189, 80, 135, 173, 32, 47, 15, 100, 230, 42, 42, 133, 116, 62,
+        ],
+        [
+            98, 43, 219, 88, 207, 92, 180, 93, 183, 130, 209, 52, 218, 197, 222, 121, 202, 82, 89,
+            163, 146, 136, 199, 138, 92, 229, 97, 45, 202, 14, 107, 3,
+        ],
+        [
+            240, 123, 106, 60, 50, 212, 31, 248, 89, 162, 207, 92, 59, 93, 219, 186, 97, 70, 183,
+            76, 226, 50, 124, 180, 170, 240, 86, 206, 208, 73, 143, 58,
+        ],
+        [
+            68, 34, 149, 125, 18, 250, 72, 119, 93, 236, 204, 129, 252, 238, 125, 83, 69, 110, 14,
+            140, 202, 10, 54, 156, 156, 245, 188, 186, 65, 147, 214, 58,
+        ],
+    ],
+    [
+        [
+            100, 148, 161, 249, 209, 68, 164, 245, 215, 120, 36, 73, 193, 207, 199, 211, 164, 112,
+            198, 111, 27, 1, 28, 72, 43, 84, 188, 15, 250, 159, 188, 26,
+        ],
+        [
+            253, 232, 39, 91, 86, 20, 213, 250, 200, 253, 181, 117, 94, 30, 220, 129, 132, 201,
+            156, 56, 249, 165, 70, 192, 24, 61, 24, 145, 187, 24, 7, 13,
+        ],
+        [
+            235, 160, 136, 133, 75, 13, 222, 161, 238, 179, 2, 106, 74, 63, 0, 248, 96, 26, 138,
+            196, 53, 150, 8, 73, 124, 157, 77, 23, 208, 245, 181, 10,
+        ],
+        [
+            224, 180, 160, 165, 136, 230, 75, 44, 173, 23, 88, 47, 214, 41, 208, 76, 49, 85, 171,
+            140, 128, 17, 207, 88, 157, 169, 101, 251, 90, 52, 114, 26,
+        ],
+        [
+            251, 247, 129, 11, 189, 220, 160, 126, 110, 241, 216, 126, 145, 176, 90, 92, 255, 164,
+            67, 155, 143, 105, 231, 221, 19, 4, 209, 247, 129, 79, 58, 49,
+        ],
+        [
+            55, 58, 1, 79, 198, 128, 28, 83, 10, 33, 83, 28, 178, 155, 41, 216, 238, 187, 174, 61,
+            201, 86, 87, 236, 92, 163, 208, 44, 86, 114, 54, 54,
+        ],
+        [
+            57, 169, 95, 175, 193, 90, 221, 121, 48, 104, 22, 110, 222, 88, 201, 207, 154, 16, 36,
+            26, 255, 141, 57, 222, 7, 189, 115, 238, 20, 167, 80, 40,
+        ],
+        [
+            47, 181, 105, 56, 58, 145, 115, 74, 79, 83, 212, 58, 126, 171, 44, 110, 219, 142, 60,
+            180, 182, 14, 17, 229, 248, 82, 81, 14, 170, 126, 147, 54,
+        ],
+    ],
+    [
+        [
+            128, 20, 45, 17, 172, 230, 162, 59, 42, 143, 8, 76, 33, 186, 248, 116, 42, 73, 85, 228,
+            40, 39, 54, 88, 181, 90, 54, 87, 55, 177, 229, 48,
+        ],
+        [
+            102, 173, 199, 114, 55, 226, 31, 35, 68, 39, 12, 40, 107, 135, 27, 73, 112, 191, 44,
+            71, 245, 185, 21, 25, 255, 200, 88, 114, 110, 229, 161, 22,
+        ],
+        [
+            242, 13, 62, 36, 95, 118, 193, 245, 50, 127, 84, 98, 54, 154, 247, 225, 103, 249, 157,
+            187, 31, 199, 119, 56, 69, 142, 166, 156, 124, 182, 243, 30,
+        ],
+        [
+            169, 44, 97, 74, 69, 161, 72, 96, 128, 26, 55, 131, 150, 94, 84, 17, 234, 77, 2, 152,
+            17, 35, 18, 95, 191, 22, 140, 116, 110, 72, 104, 40,
+        ],
+        [
+            23, 99, 66, 21, 11, 139, 224, 24, 118, 30, 242, 229, 10, 83, 69, 203, 47, 187, 184,
+            170, 182, 204, 151, 96, 55, 203, 201, 45, 173, 76, 21, 62,
+        ],
+        [
+            174, 56, 175, 37, 18, 168, 92, 220, 126, 59, 122, 128, 188, 14, 11, 76, 224, 185, 52,
+            56, 171, 1, 76, 94, 170, 201, 52, 223, 143, 143, 65, 0,
+        ],
+        [
+            105, 252, 232, 233, 233, 184, 240, 251, 105, 190, 199, 191, 40, 128, 70, 127, 50, 153,
+            218, 78, 159, 152, 131, 91, 144, 74, 196, 12, 72, 3, 98, 60,
+        ],
+        [
+            86, 118, 204, 12, 44, 119, 238, 58, 14, 159, 108, 2, 205, 230, 12, 174, 118, 229, 14,
+            199, 87, 166, 74, 165, 221, 17, 87, 56, 146, 78, 20, 38,
+        ],
+    ],
+    [
+        [
+            17, 210, 205, 128, 203, 153, 80, 160, 236, 118, 114, 81, 57, 77, 237, 168, 120, 203,
+            243, 6, 165, 10, 37, 16, 19, 82, 193, 5, 125, 101, 1, 1,
+        ],
+        [
+            52, 57, 24, 226, 28, 210, 52, 197, 135, 76, 224, 159, 200, 11, 210, 84, 143, 91, 58,
+            149, 199, 147, 56, 115, 35, 77, 56, 29, 112, 225, 160, 21,
+        ],
+        [
+            103, 157, 74, 50, 168, 153, 10, 113, 111, 250, 147, 120, 97, 105, 30, 162, 84, 110,
+            181, 117, 25, 90, 57, 255, 1, 241, 61, 16, 55, 61, 65, 52,
+        ],
+        [
+            241, 161, 9, 88, 151, 232, 118, 42, 51, 245, 132, 81, 90, 123, 243, 30, 223, 21, 254,
+            64, 128, 203, 22, 56, 162, 74, 101, 8, 215, 253, 75, 7,
+        ],
+        [
+            168, 52, 111, 97, 141, 41, 127, 84, 216, 177, 7, 162, 249, 219, 97, 204, 187, 22, 8,
+            167, 81, 147, 177, 55, 76, 215, 129, 233, 167, 122, 131, 60,
+        ],
+        [
+            148, 157, 151, 154, 244, 40, 17, 161, 198, 20, 105, 212, 156, 158, 39, 23, 231, 137,
+            222, 84, 68, 27, 3, 207, 199, 230, 18, 44, 157, 202, 81, 52,
+        ],
+        [
+            77, 77, 79, 101, 89, 159, 81, 121, 236, 91, 174, 188, 38, 33, 130, 156, 128, 26, 22,
+            145, 39, 255, 241, 196, 151, 255, 82, 91, 148, 232, 71, 18,
+        ],
+        [
+            194, 196, 111, 238, 57, 75, 10, 99, 212, 187, 129, 199, 119, 92, 1, 108, 241, 170, 157,
+            183, 229, 228, 101, 27, 52, 174, 69, 134, 147, 83, 58, 54,
+        ],
+    ],
+    [
+        [
+            241, 63, 197, 8, 100, 206, 130, 195, 128, 98, 20, 252, 192, 60, 31, 154, 23, 124, 103,
+            182, 200, 154, 206, 243, 229, 5, 113, 213, 164, 112, 185, 55,
+        ],
+        [
+            105, 242, 123, 46, 87, 11, 173, 139, 0, 221, 84, 124, 26, 7, 229, 104, 187, 91, 104,
+            81, 219, 204, 240, 1, 1, 235, 27, 29, 117, 155, 29, 38,
+        ],
+        [
+            225, 247, 40, 180, 114, 90, 146, 118, 40, 231, 57, 24, 23, 219, 32, 253, 2, 110, 91,
+            34, 56, 181, 2, 115, 172, 228, 119, 92, 167, 155, 176, 58,
+        ],
+        [
+            249, 104, 21, 229, 236, 207, 33, 6, 53, 166, 64, 148, 104, 232, 112, 223, 106, 6, 118,
+            70, 13, 100, 73, 127, 195, 76, 19, 138, 175, 115, 228, 1,
+        ],
+        [
+            195, 144, 80, 114, 29, 145, 101, 51, 84, 237, 157, 117, 160, 225, 241, 235, 114, 170,
+            30, 122, 200, 158, 177, 41, 229, 85, 234, 198, 76, 168, 52, 24,
+        ],
+        [
+            120, 210, 255, 49, 191, 96, 63, 157, 96, 72, 69, 219, 183, 118, 127, 68, 51, 117, 157,
+            15, 174, 235, 120, 43, 212, 104, 132, 191, 34, 171, 203, 33,
+        ],
+        [
+            44, 169, 60, 45, 196, 253, 165, 116, 12, 163, 75, 217, 85, 188, 185, 137, 45, 249, 112,
+            151, 138, 217, 14, 129, 30, 158, 215, 254, 84, 42, 228, 42,
+        ],
+        [
+            203, 168, 249, 62, 65, 9, 40, 183, 128, 84, 88, 173, 178, 248, 224, 77, 145, 33, 193,
+            92, 50, 207, 141, 24, 15, 52, 252, 243, 246, 98, 19, 49,
+        ],
+    ],
+    [
+        [
+            237, 54, 165, 102, 136, 30, 200, 45, 73, 254, 49, 68, 66, 86, 185, 7, 241, 116, 123,
+            60, 28, 190, 126, 70, 234, 142, 64, 228, 224, 138, 208, 27,
+        ],
+        [
+            99, 57, 207, 132, 197, 103, 87, 84, 55, 138, 63, 103, 194, 83, 185, 46, 158, 91, 214,
+            20, 95, 59, 228, 214, 143, 132, 0, 23, 253, 230, 26, 48,
+        ],
+        [
+            123, 239, 222, 226, 21, 242, 243, 197, 129, 206, 152, 129, 16, 20, 211, 42, 176, 65,
+            242, 192, 66, 69, 81, 3, 131, 15, 216, 202, 2, 243, 218, 7,
+        ],
+        [
+            31, 26, 204, 209, 239, 190, 83, 225, 196, 75, 45, 121, 3, 102, 101, 131, 44, 31, 218,
+            48, 73, 17, 134, 242, 247, 29, 221, 207, 227, 5, 52, 25,
+        ],
+        [
+            202, 14, 80, 192, 246, 207, 239, 108, 96, 56, 18, 233, 77, 173, 33, 8, 59, 253, 229,
+            142, 225, 80, 41, 255, 246, 3, 81, 26, 35, 44, 231, 16,
+        ],
+        [
+            121, 74, 250, 232, 223, 85, 200, 144, 168, 194, 169, 93, 4, 215, 101, 243, 38, 138, 47,
+            65, 199, 166, 45, 18, 118, 239, 185, 189, 156, 25, 107, 24,
+        ],
+        [
+            78, 176, 119, 91, 128, 226, 57, 17, 143, 199, 58, 244, 198, 201, 19, 241, 221, 217,
+            241, 225, 34, 210, 174, 2, 205, 104, 225, 0, 230, 178, 142, 57,
+        ],
+        [
+            148, 105, 249, 45, 180, 221, 60, 123, 112, 195, 248, 88, 13, 52, 126, 194, 131, 236,
+            52, 91, 170, 222, 209, 94, 201, 73, 253, 213, 21, 196, 23, 26,
+        ],
+    ],
+    [
+        [
+            182, 212, 91, 5, 64, 193, 110, 29, 140, 166, 154, 43, 144, 226, 204, 76, 157, 57, 210,
+            77, 119, 255, 110, 232, 205, 123, 162, 24, 193, 148, 79, 12,
+        ],
+        [
+            36, 238, 108, 197, 169, 69, 71, 57, 159, 134, 64, 215, 134, 142, 123, 7, 230, 54, 52,
+            211, 182, 48, 157, 191, 50, 219, 222, 147, 205, 0, 190, 11,
+        ],
+        [
+            35, 5, 133, 217, 180, 43, 56, 102, 117, 79, 198, 160, 251, 151, 49, 167, 97, 168, 236,
+            153, 46, 53, 97, 136, 177, 22, 144, 248, 209, 112, 2, 22,
+        ],
+        [
+            189, 185, 158, 102, 165, 81, 53, 43, 92, 59, 187, 63, 53, 181, 50, 254, 28, 27, 251,
+            184, 213, 163, 78, 124, 194, 6, 198, 11, 104, 110, 190, 58,
+        ],
+        [
+            116, 193, 244, 154, 127, 157, 31, 127, 143, 165, 156, 200, 172, 124, 18, 75, 72, 222,
+            71, 165, 110, 23, 37, 39, 40, 221, 208, 104, 143, 242, 10, 48,
+        ],
+        [
+            183, 141, 193, 42, 36, 65, 222, 109, 178, 190, 244, 230, 12, 133, 148, 135, 165, 30,
+            186, 27, 85, 88, 243, 247, 39, 160, 74, 215, 156, 107, 27, 18,
+        ],
+        [
+            178, 132, 174, 93, 169, 172, 0, 113, 42, 161, 34, 61, 153, 62, 171, 231, 99, 205, 151,
+            136, 195, 41, 104, 69, 129, 94, 118, 232, 230, 30, 41, 17,
+        ],
+        [
+            168, 254, 122, 49, 132, 197, 175, 154, 5, 26, 244, 178, 204, 59, 101, 158, 244, 142,
+            21, 29, 108, 129, 119, 165, 179, 98, 124, 213, 19, 29, 89, 20,
+        ],
+    ],
+    [
+        [
+            58, 113, 74, 241, 171, 205, 88, 69, 237, 115, 76, 207, 136, 236, 87, 123, 162, 139,
+            106, 6, 32, 222, 117, 231, 41, 193, 154, 129, 90, 25, 140, 32,
+        ],
+        [
+            230, 114, 111, 31, 111, 230, 200, 253, 222, 93, 21, 215, 146, 39, 154, 45, 176, 255,
+            252, 145, 47, 232, 32, 241, 128, 121, 239, 189, 41, 31, 178, 36,
+        ],
+        [
+            174, 68, 205, 209, 74, 239, 125, 252, 66, 216, 148, 150, 245, 194, 226, 111, 75, 204,
+            15, 141, 251, 66, 147, 233, 225, 226, 32, 128, 223, 237, 242, 59,
+        ],
+        [
+            3, 121, 18, 77, 255, 155, 204, 130, 228, 64, 12, 91, 2, 202, 55, 137, 126, 167, 237,
+            179, 121, 95, 97, 237, 79, 161, 223, 249, 20, 104, 224, 38,
+        ],
+        [
+            200, 199, 195, 205, 182, 178, 120, 64, 102, 134, 15, 97, 173, 148, 179, 163, 187, 169,
+            183, 49, 254, 95, 207, 243, 104, 207, 129, 137, 204, 95, 68, 40,
+        ],
+        [
+            205, 24, 7, 183, 41, 150, 50, 243, 52, 134, 179, 221, 154, 3, 50, 15, 125, 141, 44,
+            229, 174, 113, 51, 207, 142, 158, 157, 165, 171, 33, 167, 38,
+        ],
+        [
+            93, 0, 212, 151, 114, 45, 134, 198, 142, 228, 90, 196, 237, 19, 187, 131, 51, 19, 28,
+            175, 104, 227, 105, 196, 131, 167, 79, 38, 138, 196, 51, 2,
+        ],
+        [
+            59, 126, 116, 119, 162, 37, 37, 83, 6, 89, 187, 30, 31, 41, 207, 146, 78, 210, 47, 181,
+            12, 196, 180, 125, 230, 122, 253, 44, 241, 73, 220, 41,
+        ],
+    ],
+    [
+        [
+            93, 227, 53, 151, 63, 84, 124, 154, 237, 167, 104, 227, 134, 9, 69, 169, 213, 20, 129,
+            164, 5, 139, 107, 214, 219, 181, 245, 2, 133, 23, 167, 51,
+        ],
+        [
+            52, 208, 36, 128, 213, 207, 33, 248, 5, 208, 172, 141, 116, 118, 32, 61, 70, 206, 220,
+            2, 177, 33, 220, 229, 217, 39, 243, 191, 204, 59, 103, 13,
+        ],
+        [
+            137, 0, 31, 220, 219, 195, 242, 66, 222, 9, 30, 49, 67, 147, 242, 237, 184, 155, 92,
+            127, 0, 138, 163, 239, 31, 52, 29, 248, 179, 142, 178, 51,
+        ],
+        [
+            9, 247, 72, 70, 229, 95, 189, 205, 92, 112, 59, 237, 203, 45, 169, 254, 130, 56, 222,
+            97, 91, 53, 5, 79, 254, 144, 144, 139, 249, 44, 112, 10,
+        ],
+        [
+            142, 182, 137, 135, 132, 12, 193, 117, 33, 4, 3, 131, 45, 71, 220, 57, 220, 109, 192,
+            168, 19, 114, 226, 245, 71, 204, 104, 87, 86, 129, 252, 48,
+        ],
+        [
+            155, 212, 212, 132, 134, 186, 221, 90, 141, 120, 16, 198, 25, 43, 18, 134, 198, 62,
+            173, 11, 168, 215, 104, 237, 241, 111, 108, 112, 148, 121, 90, 25,
+        ],
+        [
+            237, 57, 126, 105, 21, 13, 14, 166, 233, 74, 163, 1, 182, 44, 234, 186, 213, 219, 38,
+            5, 226, 108, 110, 255, 36, 207, 85, 60, 152, 169, 241, 14,
+        ],
+        [
+            219, 43, 21, 203, 72, 178, 62, 213, 60, 192, 3, 20, 90, 10, 186, 134, 181, 154, 0, 53,
+            75, 214, 211, 194, 227, 32, 13, 159, 93, 183, 134, 29,
+        ],
+    ],
+    [
+        [
+            49, 16, 184, 146, 99, 19, 153, 194, 123, 41, 24, 235, 243, 73, 9, 215, 195, 186, 58,
+            253, 33, 124, 76, 111, 151, 179, 252, 251, 103, 1, 100, 19,
+        ],
+        [
+            15, 173, 71, 88, 104, 55, 212, 113, 228, 43, 4, 246, 137, 5, 251, 183, 137, 34, 16,
+            234, 130, 208, 240, 188, 128, 118, 175, 127, 198, 150, 228, 54,
+        ],
+        [
+            19, 194, 219, 217, 24, 146, 37, 223, 241, 118, 130, 17, 106, 48, 243, 74, 75, 45, 249,
+            82, 100, 196, 236, 235, 144, 119, 189, 233, 209, 224, 89, 37,
+        ],
+        [
+            5, 204, 210, 20, 79, 207, 213, 247, 252, 195, 1, 101, 247, 54, 70, 221, 19, 126, 205,
+            230, 224, 154, 57, 24, 251, 138, 104, 107, 145, 143, 240, 22,
+        ],
+        [
+            178, 233, 194, 212, 193, 74, 25, 74, 15, 201, 106, 114, 6, 248, 134, 168, 129, 110,
+            148, 125, 208, 42, 9, 90, 43, 255, 71, 206, 153, 173, 12, 42,
+        ],
+        [
+            119, 68, 2, 6, 31, 24, 160, 117, 87, 143, 120, 3, 215, 255, 247, 207, 125, 158, 23, 39,
+            73, 106, 15, 240, 170, 155, 168, 142, 89, 225, 234, 63,
+        ],
+        [
+            2, 252, 41, 89, 60, 106, 201, 142, 88, 102, 71, 228, 123, 206, 24, 191, 1, 253, 100,
+            123, 184, 7, 217, 120, 110, 91, 223, 31, 201, 144, 243, 15,
+        ],
+        [
+            93, 40, 93, 41, 170, 15, 155, 192, 244, 60, 25, 163, 9, 222, 26, 176, 200, 141, 148,
+            145, 57, 182, 188, 135, 57, 156, 54, 242, 130, 162, 218, 45,
+        ],
+    ],
+    [
+        [
+            214, 69, 246, 81, 233, 237, 251, 120, 2, 67, 240, 114, 30, 75, 200, 44, 1, 53, 148,
+            130, 104, 10, 26, 136, 234, 145, 255, 246, 127, 216, 194, 32,
+        ],
+        [
+            8, 65, 67, 164, 14, 155, 196, 111, 151, 196, 74, 150, 62, 189, 131, 110, 205, 122, 128,
+            186, 236, 28, 51, 10, 206, 109, 134, 57, 87, 101, 93, 63,
+        ],
+        [
+            68, 251, 222, 27, 177, 128, 75, 246, 128, 26, 58, 21, 141, 73, 219, 42, 229, 3, 99, 79,
+            130, 94, 144, 140, 141, 29, 53, 13, 199, 208, 48, 59,
+        ],
+        [
+            121, 169, 146, 165, 201, 195, 186, 28, 83, 140, 53, 245, 69, 22, 126, 233, 44, 39, 159,
+            191, 14, 124, 20, 39, 211, 99, 13, 89, 204, 83, 245, 48,
+        ],
+        [
+            241, 91, 55, 71, 30, 143, 172, 30, 17, 71, 66, 49, 156, 12, 144, 152, 162, 58, 65, 31,
+            79, 2, 122, 225, 125, 125, 153, 221, 22, 197, 140, 37,
+        ],
+        [
+            124, 252, 189, 185, 58, 35, 47, 92, 69, 63, 199, 229, 172, 244, 39, 99, 171, 41, 82,
+            29, 253, 54, 46, 8, 131, 43, 68, 128, 109, 196, 72, 49,
+        ],
+        [
+            151, 169, 183, 67, 74, 131, 44, 160, 250, 82, 177, 35, 52, 186, 12, 2, 39, 80, 220,
+            239, 222, 107, 96, 203, 129, 128, 190, 117, 141, 234, 237, 7,
+        ],
+        [
+            251, 84, 120, 50, 59, 6, 204, 109, 171, 19, 119, 102, 17, 119, 90, 250, 186, 203, 7,
+            226, 58, 117, 211, 98, 120, 62, 139, 222, 92, 87, 237, 59,
+        ],
+    ],
+    [
+        [
+            191, 132, 136, 12, 31, 227, 14, 77, 18, 230, 96, 126, 159, 194, 114, 113, 28, 229, 95,
+            102, 160, 121, 135, 222, 1, 204, 166, 147, 27, 78, 94, 63,
+        ],
+        [
+            41, 189, 153, 118, 73, 216, 74, 136, 32, 117, 103, 71, 64, 171, 143, 4, 185, 64, 223,
+            191, 207, 225, 91, 3, 220, 58, 84, 161, 4, 186, 255, 61,
+        ],
+        [
+            220, 110, 238, 123, 194, 162, 87, 36, 98, 216, 59, 236, 84, 52, 113, 46, 60, 29, 97,
+            191, 141, 77, 148, 189, 79, 189, 144, 241, 49, 163, 107, 17,
+        ],
+        [
+            12, 58, 75, 102, 5, 119, 46, 98, 201, 99, 246, 5, 148, 216, 73, 204, 226, 111, 142, 35,
+            12, 56, 248, 38, 114, 250, 183, 85, 199, 74, 219, 21,
+        ],
+        [
+            84, 181, 225, 125, 40, 19, 155, 140, 118, 241, 20, 21, 158, 167, 93, 244, 2, 17, 21,
+            91, 2, 83, 1, 94, 22, 55, 135, 167, 223, 24, 32, 42,
+        ],
+        [
+            6, 100, 231, 118, 1, 253, 62, 137, 179, 245, 83, 61, 171, 224, 96, 238, 76, 134, 31,
+            107, 133, 47, 160, 13, 10, 43, 78, 93, 177, 12, 195, 17,
+        ],
+        [
+            81, 34, 138, 58, 81, 179, 240, 49, 216, 93, 153, 221, 161, 206, 140, 17, 40, 75, 244,
+            16, 220, 69, 242, 179, 209, 48, 169, 69, 163, 216, 79, 19,
+        ],
+        [
+            60, 205, 53, 247, 139, 167, 157, 115, 224, 197, 206, 220, 238, 82, 218, 253, 74, 237,
+            137, 50, 31, 151, 177, 175, 197, 44, 58, 147, 109, 119, 51, 1,
+        ],
+    ],
+    [
+        [
+            27, 15, 21, 190, 82, 194, 14, 56, 128, 44, 111, 155, 238, 130, 188, 19, 119, 238, 0, 4,
+            91, 86, 254, 61, 166, 67, 119, 22, 106, 244, 56, 47,
+        ],
+        [
+            23, 52, 161, 183, 10, 194, 104, 78, 22, 66, 219, 166, 215, 76, 71, 106, 108, 153, 245,
+            170, 105, 53, 197, 234, 219, 226, 234, 184, 86, 189, 222, 10,
+        ],
+        [
+            231, 5, 115, 95, 58, 66, 208, 135, 209, 47, 123, 58, 134, 156, 88, 202, 13, 79, 225, 8,
+            164, 39, 127, 246, 43, 136, 188, 177, 254, 151, 70, 23,
+        ],
+        [
+            86, 248, 109, 23, 128, 55, 179, 214, 159, 18, 33, 106, 34, 109, 190, 0, 110, 224, 62,
+            210, 87, 190, 246, 206, 196, 141, 133, 226, 167, 133, 19, 47,
+        ],
+        [
+            70, 58, 113, 121, 237, 219, 30, 160, 229, 88, 95, 214, 8, 232, 108, 98, 14, 233, 43,
+            189, 225, 16, 247, 36, 111, 122, 199, 25, 205, 44, 112, 42,
+        ],
+        [
+            184, 97, 40, 59, 116, 147, 139, 60, 30, 250, 67, 11, 242, 111, 104, 150, 15, 215, 245,
+            99, 31, 128, 240, 115, 18, 249, 99, 114, 186, 65, 76, 26,
+        ],
+        [
+            183, 90, 33, 10, 78, 210, 54, 79, 156, 8, 176, 24, 54, 209, 203, 157, 151, 134, 88,
+            104, 211, 62, 38, 197, 117, 122, 207, 15, 163, 5, 59, 8,
+        ],
+        [
+            41, 14, 171, 211, 125, 45, 149, 132, 101, 32, 35, 142, 108, 194, 13, 37, 122, 27, 219,
+            223, 32, 41, 153, 199, 167, 246, 214, 240, 222, 131, 85, 9,
+        ],
+    ],
+    [
+        [
+            146, 73, 118, 250, 189, 115, 96, 188, 162, 168, 121, 1, 55, 221, 181, 187, 145, 13,
+            213, 160, 250, 117, 252, 42, 161, 41, 42, 60, 45, 193, 25, 30,
+        ],
+        [
+            38, 126, 2, 131, 102, 66, 220, 138, 83, 239, 80, 46, 245, 63, 94, 233, 192, 15, 173,
+            155, 6, 154, 124, 236, 99, 151, 106, 21, 10, 55, 175, 45,
+        ],
+        [
+            147, 163, 56, 143, 203, 206, 180, 175, 15, 39, 185, 183, 254, 241, 235, 182, 62, 116,
+            27, 66, 73, 66, 55, 190, 19, 68, 189, 214, 46, 89, 13, 49,
+        ],
+        [
+            121, 248, 233, 93, 196, 140, 233, 226, 177, 11, 177, 78, 181, 222, 38, 101, 216, 68,
+            10, 26, 212, 185, 105, 39, 89, 190, 15, 184, 32, 157, 147, 35,
+        ],
+        [
+            67, 108, 70, 93, 37, 202, 52, 114, 7, 214, 41, 246, 220, 152, 65, 195, 75, 216, 193,
+            159, 110, 113, 85, 105, 182, 55, 126, 48, 92, 74, 41, 13,
+        ],
+        [
+            66, 55, 15, 17, 96, 43, 142, 225, 55, 202, 242, 132, 16, 128, 198, 64, 57, 51, 173,
+            153, 18, 21, 74, 117, 208, 85, 87, 200, 8, 25, 30, 53,
+        ],
+        [
+            142, 173, 137, 206, 188, 2, 155, 106, 110, 80, 138, 211, 142, 216, 9, 126, 115, 161,
+            60, 119, 251, 199, 29, 163, 69, 166, 106, 200, 115, 12, 27, 42,
+        ],
+        [
+            5, 28, 251, 152, 246, 99, 74, 222, 86, 91, 4, 141, 212, 14, 200, 222, 129, 133, 91,
+            117, 4, 233, 235, 254, 214, 85, 56, 28, 211, 167, 164, 7,
+        ],
+    ],
+    [
+        [
+            199, 248, 56, 7, 116, 43, 199, 175, 73, 62, 19, 67, 250, 144, 43, 227, 245, 85, 242,
+            25, 74, 33, 89, 208, 243, 137, 220, 136, 0, 79, 235, 17,
+        ],
+        [
+            141, 87, 177, 94, 249, 243, 42, 2, 191, 181, 12, 101, 121, 76, 243, 215, 5, 157, 170,
+            98, 185, 102, 238, 161, 179, 91, 225, 102, 17, 243, 151, 18,
+        ],
+        [
+            5, 165, 124, 37, 121, 192, 201, 221, 50, 34, 204, 74, 249, 97, 138, 157, 183, 155, 191,
+            222, 146, 82, 129, 195, 236, 32, 110, 47, 32, 32, 212, 59,
+        ],
+        [
+            9, 21, 25, 227, 120, 92, 35, 43, 121, 43, 234, 147, 157, 23, 218, 121, 248, 28, 137,
+            152, 121, 231, 163, 87, 212, 168, 222, 177, 182, 50, 19, 26,
+        ],
+        [
+            214, 240, 41, 113, 104, 195, 60, 163, 221, 18, 241, 139, 35, 166, 231, 241, 137, 56,
+            217, 182, 177, 214, 146, 157, 176, 171, 13, 41, 204, 80, 94, 53,
+        ],
+        [
+            5, 160, 27, 29, 63, 102, 96, 140, 192, 60, 193, 95, 114, 182, 5, 102, 115, 144, 60, 92,
+            83, 249, 85, 161, 172, 2, 96, 118, 95, 245, 201, 58,
+        ],
+        [
+            35, 161, 31, 237, 123, 141, 123, 90, 233, 91, 250, 0, 189, 31, 19, 179, 134, 219, 230,
+            7, 54, 236, 238, 251, 183, 245, 255, 172, 233, 240, 4, 27,
+        ],
+        [
+            2, 165, 109, 76, 190, 46, 187, 163, 33, 215, 48, 19, 0, 240, 15, 120, 7, 191, 169, 213,
+            118, 162, 0, 79, 58, 146, 185, 165, 77, 215, 43, 16,
+        ],
+    ],
+    [
+        [
+            139, 175, 132, 197, 168, 169, 208, 139, 136, 29, 122, 201, 243, 76, 13, 159, 57, 180,
+            235, 124, 157, 231, 66, 8, 233, 163, 50, 145, 44, 186, 159, 39,
+        ],
+        [
+            18, 215, 223, 109, 50, 114, 37, 123, 232, 3, 220, 242, 61, 30, 200, 62, 103, 11, 171,
+            156, 78, 117, 46, 234, 174, 247, 58, 238, 51, 180, 32, 19,
+        ],
+        [
+            101, 233, 249, 129, 23, 236, 206, 133, 169, 247, 127, 5, 25, 115, 137, 232, 198, 119,
+            126, 232, 19, 27, 53, 153, 229, 149, 149, 92, 202, 120, 23, 34,
+        ],
+        [
+            195, 226, 216, 96, 174, 47, 198, 78, 76, 136, 67, 64, 61, 50, 64, 28, 70, 131, 105, 96,
+            54, 197, 98, 18, 197, 130, 92, 155, 116, 104, 213, 28,
+        ],
+        [
+            4, 165, 219, 75, 186, 168, 40, 93, 124, 34, 52, 233, 148, 177, 130, 40, 113, 173, 207,
+            243, 123, 185, 251, 0, 111, 209, 114, 114, 0, 165, 47, 21,
+        ],
+        [
+            15, 211, 38, 24, 236, 47, 246, 65, 238, 204, 84, 203, 250, 41, 211, 141, 195, 16, 196,
+            184, 251, 47, 229, 78, 183, 45, 82, 65, 59, 228, 223, 38,
+        ],
+        [
+            226, 208, 172, 170, 113, 92, 148, 103, 53, 253, 157, 15, 1, 15, 188, 215, 214, 21, 122,
+            252, 33, 72, 164, 8, 8, 129, 2, 81, 175, 88, 16, 42,
+        ],
+        [
+            120, 112, 122, 188, 218, 169, 97, 108, 132, 61, 177, 126, 146, 248, 48, 72, 231, 104,
+            58, 58, 245, 127, 126, 68, 82, 142, 8, 42, 111, 149, 188, 32,
+        ],
+    ],
+    [
+        [
+            95, 8, 182, 234, 116, 76, 223, 240, 103, 146, 57, 57, 56, 106, 176, 215, 49, 209, 32,
+            158, 35, 28, 130, 7, 201, 178, 230, 212, 200, 223, 206, 62,
+        ],
+        [
+            239, 66, 31, 68, 227, 197, 138, 254, 87, 118, 79, 186, 88, 181, 83, 240, 159, 11, 15,
+            255, 84, 228, 69, 3, 205, 39, 11, 178, 223, 249, 193, 56,
+        ],
+        [
+            159, 153, 62, 236, 201, 9, 233, 213, 145, 93, 104, 128, 1, 156, 105, 1, 141, 33, 122,
+            15, 197, 68, 57, 25, 48, 67, 17, 219, 227, 252, 72, 62,
+        ],
+        [
+            73, 22, 127, 172, 163, 146, 170, 68, 75, 175, 220, 162, 160, 27, 99, 36, 24, 11, 219,
+            20, 38, 174, 178, 85, 133, 51, 30, 87, 210, 46, 109, 49,
+        ],
+        [
+            37, 59, 243, 109, 246, 173, 114, 98, 148, 92, 118, 145, 45, 46, 163, 208, 44, 248, 6,
+            192, 35, 46, 20, 0, 78, 120, 119, 214, 200, 148, 11, 45,
+        ],
+        [
+            142, 201, 84, 209, 45, 193, 134, 251, 249, 3, 16, 208, 69, 91, 69, 255, 76, 221, 82,
+            169, 30, 218, 46, 183, 12, 35, 214, 84, 23, 245, 74, 34,
+        ],
+        [
+            169, 46, 120, 5, 117, 166, 109, 155, 218, 69, 132, 230, 139, 49, 118, 147, 121, 143,
+            14, 200, 114, 128, 170, 214, 123, 83, 79, 227, 170, 87, 149, 60,
+        ],
+        [
+            63, 140, 50, 114, 17, 41, 117, 40, 247, 224, 249, 168, 254, 222, 74, 122, 134, 252, 35,
+            27, 213, 180, 92, 240, 255, 145, 13, 103, 152, 170, 236, 50,
+        ],
+    ],
+    [
+        [
+            215, 154, 109, 148, 179, 184, 4, 246, 126, 31, 67, 190, 52, 170, 95, 63, 21, 74, 205,
+            159, 226, 106, 95, 251, 151, 33, 95, 9, 8, 51, 54, 16,
+        ],
+        [
+            125, 211, 129, 224, 62, 115, 145, 137, 123, 63, 37, 176, 121, 83, 200, 198, 200, 63,
+            199, 7, 111, 61, 16, 189, 147, 128, 57, 111, 140, 117, 192, 13,
+        ],
+        [
+            62, 162, 174, 44, 90, 198, 105, 23, 32, 95, 170, 43, 95, 202, 41, 143, 5, 120, 103,
+            243, 69, 109, 70, 226, 206, 144, 32, 187, 168, 156, 74, 2,
+        ],
+        [
+            74, 155, 142, 102, 116, 7, 191, 222, 129, 124, 146, 194, 182, 170, 38, 29, 14, 163,
+            145, 158, 214, 61, 192, 123, 190, 109, 174, 52, 88, 52, 154, 21,
+        ],
+        [
+            210, 110, 65, 168, 192, 245, 112, 81, 43, 66, 225, 107, 42, 112, 186, 67, 146, 66, 69,
+            141, 69, 125, 61, 226, 103, 26, 102, 60, 12, 207, 245, 34,
+        ],
+        [
+            0, 109, 234, 239, 154, 137, 77, 134, 209, 28, 113, 244, 198, 228, 214, 139, 52, 33, 86,
+            69, 51, 218, 213, 211, 31, 28, 195, 77, 222, 90, 231, 0,
+        ],
+        [
+            62, 169, 126, 192, 19, 148, 244, 128, 245, 147, 155, 85, 225, 132, 157, 156, 111, 26,
+            103, 87, 100, 195, 177, 53, 58, 124, 93, 38, 187, 56, 176, 59,
+        ],
+        [
+            224, 216, 241, 35, 55, 36, 233, 159, 110, 128, 30, 204, 91, 50, 227, 153, 76, 84, 209,
+            62, 140, 19, 74, 222, 67, 215, 86, 219, 28, 6, 127, 26,
+        ],
+    ],
+    [
+        [
+            196, 239, 163, 163, 226, 62, 34, 86, 120, 237, 194, 94, 87, 123, 11, 194, 71, 232, 84,
+            212, 162, 54, 89, 87, 229, 244, 147, 80, 81, 231, 144, 59,
+        ],
+        [
+            3, 183, 214, 69, 55, 0, 243, 100, 210, 173, 147, 22, 164, 222, 22, 236, 41, 16, 23,
+            212, 64, 207, 16, 104, 62, 156, 117, 194, 143, 252, 114, 30,
+        ],
+        [
+            83, 242, 71, 100, 1, 160, 144, 96, 22, 203, 210, 122, 123, 222, 221, 58, 212, 89, 96,
+            210, 172, 144, 144, 217, 3, 21, 57, 248, 252, 36, 168, 45,
+        ],
+        [
+            162, 85, 218, 40, 224, 40, 96, 145, 190, 124, 73, 217, 211, 89, 160, 248, 157, 203,
+            174, 61, 201, 102, 43, 232, 246, 173, 125, 249, 96, 147, 84, 28,
+        ],
+        [
+            127, 164, 182, 128, 219, 61, 29, 77, 246, 20, 106, 153, 148, 217, 135, 214, 48, 10,
+            100, 82, 166, 117, 154, 82, 30, 129, 66, 224, 97, 15, 108, 42,
+        ],
+        [
+            44, 25, 145, 64, 165, 137, 106, 115, 213, 161, 96, 217, 45, 60, 88, 226, 124, 219, 43,
+            200, 254, 197, 37, 111, 72, 159, 204, 121, 132, 253, 215, 63,
+        ],
+        [
+            130, 113, 153, 54, 123, 127, 228, 89, 131, 168, 79, 57, 6, 226, 59, 134, 92, 149, 83,
+            208, 71, 194, 150, 140, 231, 16, 60, 214, 214, 93, 159, 34,
+        ],
+        [
+            198, 56, 77, 220, 125, 205, 170, 180, 213, 78, 72, 22, 51, 57, 27, 7, 9, 212, 232, 210,
+            105, 136, 110, 193, 162, 159, 52, 143, 41, 167, 211, 29,
+        ],
+    ],
+    [
+        [
+            160, 165, 254, 36, 87, 6, 88, 21, 72, 216, 230, 247, 2, 55, 242, 73, 36, 213, 230, 8,
+            90, 80, 77, 158, 60, 59, 121, 94, 59, 96, 94, 21,
+        ],
+        [
+            45, 176, 13, 86, 112, 155, 195, 206, 252, 211, 160, 213, 218, 77, 219, 237, 222, 47,
+            75, 7, 27, 201, 208, 42, 78, 5, 247, 152, 111, 163, 28, 19,
+        ],
+        [
+            199, 71, 216, 75, 50, 105, 91, 201, 53, 124, 235, 0, 108, 165, 181, 70, 42, 153, 163,
+            201, 11, 54, 41, 233, 146, 38, 184, 139, 125, 91, 209, 10,
+        ],
+        [
+            86, 137, 234, 158, 219, 91, 233, 65, 189, 187, 15, 107, 19, 111, 12, 249, 160, 129,
+            246, 146, 62, 110, 87, 239, 99, 96, 143, 149, 115, 75, 64, 52,
+        ],
+        [
+            98, 114, 143, 6, 251, 147, 133, 224, 83, 35, 220, 23, 118, 87, 253, 157, 125, 207, 180,
+            57, 5, 127, 14, 24, 191, 18, 189, 133, 24, 63, 98, 21,
+        ],
+        [
+            7, 253, 227, 108, 211, 101, 224, 147, 234, 204, 96, 88, 155, 213, 73, 12, 78, 63, 195,
+            95, 231, 53, 32, 242, 35, 185, 9, 226, 163, 182, 106, 3,
+        ],
+        [
+            25, 246, 155, 59, 73, 164, 80, 198, 181, 76, 138, 14, 37, 122, 78, 226, 38, 183, 227,
+            225, 221, 67, 143, 190, 95, 113, 73, 57, 112, 85, 221, 21,
+        ],
+        [
+            149, 94, 77, 90, 128, 207, 67, 153, 17, 196, 236, 238, 199, 44, 10, 245, 147, 164, 221,
+            226, 230, 123, 118, 33, 85, 34, 246, 225, 65, 251, 160, 26,
+        ],
+    ],
+    [
+        [
+            198, 30, 82, 10, 148, 182, 240, 154, 54, 243, 247, 229, 181, 129, 228, 22, 161, 215,
+            77, 251, 121, 190, 107, 85, 56, 41, 194, 91, 243, 88, 14, 58,
+        ],
+        [
+            202, 246, 182, 231, 195, 153, 88, 238, 60, 84, 67, 178, 248, 59, 105, 49, 195, 130,
+            228, 104, 204, 136, 202, 84, 168, 146, 5, 208, 62, 85, 25, 17,
+        ],
+        [
+            119, 64, 199, 157, 4, 43, 91, 198, 55, 245, 237, 178, 21, 83, 35, 100, 246, 74, 152,
+            132, 234, 245, 211, 248, 224, 198, 126, 176, 196, 121, 100, 50,
+        ],
+        [
+            101, 85, 104, 70, 109, 112, 93, 153, 253, 233, 162, 249, 142, 220, 208, 19, 165, 218,
+            66, 255, 125, 124, 227, 42, 223, 153, 75, 69, 155, 156, 31, 57,
+        ],
+        [
+            63, 55, 139, 112, 194, 107, 121, 53, 129, 202, 204, 46, 248, 109, 34, 241, 53, 227,
+            206, 243, 178, 228, 215, 86, 153, 195, 47, 114, 97, 169, 5, 27,
+        ],
+        [
+            53, 75, 214, 129, 18, 225, 191, 83, 159, 41, 109, 40, 176, 57, 43, 164, 161, 185, 225,
+            136, 251, 243, 193, 42, 95, 115, 32, 171, 12, 213, 167, 3,
+        ],
+        [
+            235, 36, 235, 197, 64, 34, 134, 89, 21, 195, 40, 218, 162, 235, 91, 98, 189, 163, 189,
+            186, 29, 184, 247, 93, 83, 134, 190, 214, 231, 255, 49, 5,
+        ],
+        [
+            36, 53, 226, 5, 178, 106, 251, 156, 151, 206, 13, 255, 45, 147, 244, 47, 145, 220, 199,
+            136, 195, 250, 170, 26, 117, 196, 227, 93, 178, 18, 178, 54,
+        ],
+    ],
+    [
+        [
+            91, 68, 35, 111, 130, 120, 151, 184, 175, 224, 185, 116, 137, 151, 158, 155, 189, 79,
+            221, 201, 73, 145, 154, 99, 84, 54, 37, 92, 60, 129, 214, 44,
+        ],
+        [
+            231, 28, 49, 225, 237, 154, 194, 248, 14, 192, 101, 134, 78, 32, 217, 133, 35, 203,
+            126, 217, 65, 210, 226, 254, 67, 48, 218, 213, 163, 219, 160, 50,
+        ],
+        [
+            195, 124, 201, 154, 77, 19, 27, 255, 51, 178, 233, 32, 112, 70, 138, 116, 23, 99, 22,
+            170, 23, 205, 137, 213, 91, 207, 198, 118, 66, 21, 222, 50,
+        ],
+        [
+            149, 89, 237, 156, 70, 100, 84, 58, 87, 158, 41, 169, 249, 94, 134, 84, 109, 110, 191,
+            60, 29, 237, 6, 215, 116, 124, 158, 30, 58, 205, 244, 17,
+        ],
+        [
+            80, 179, 104, 84, 95, 131, 131, 215, 129, 166, 153, 81, 167, 251, 66, 242, 254, 45,
+            100, 1, 161, 77, 234, 73, 72, 85, 152, 84, 251, 23, 114, 26,
+        ],
+        [
+            122, 218, 71, 58, 4, 142, 173, 59, 70, 145, 210, 95, 79, 43, 69, 197, 200, 23, 165,
+            251, 43, 41, 216, 32, 187, 240, 177, 81, 137, 144, 198, 61,
+        ],
+        [
+            40, 250, 126, 111, 65, 53, 57, 76, 207, 56, 219, 216, 128, 31, 63, 72, 34, 174, 157,
+            129, 159, 143, 16, 42, 162, 60, 231, 208, 218, 112, 16, 63,
+        ],
+        [
+            203, 16, 248, 1, 77, 5, 210, 197, 69, 134, 121, 102, 244, 42, 182, 244, 143, 71, 179,
+            152, 34, 139, 52, 89, 180, 232, 152, 56, 149, 0, 97, 37,
+        ],
+    ],
+    [
+        [
+            5, 89, 207, 4, 33, 94, 36, 209, 180, 97, 214, 235, 236, 90, 149, 192, 144, 15, 127,
+            233, 150, 20, 79, 10, 72, 207, 61, 43, 159, 78, 107, 53,
+        ],
+        [
+            79, 186, 12, 1, 247, 170, 13, 98, 141, 222, 29, 5, 91, 198, 14, 85, 242, 207, 252, 151,
+            191, 37, 3, 221, 27, 83, 31, 250, 45, 99, 122, 16,
+        ],
+        [
+            137, 124, 62, 217, 230, 197, 251, 81, 224, 75, 111, 172, 69, 51, 172, 138, 87, 147, 33,
+            128, 200, 169, 159, 176, 204, 10, 225, 2, 139, 30, 160, 49,
+        ],
+        [
+            102, 7, 138, 62, 135, 48, 100, 156, 184, 139, 98, 191, 161, 89, 48, 104, 32, 241, 60,
+            135, 3, 71, 117, 99, 5, 215, 250, 18, 212, 34, 64, 20,
+        ],
+        [
+            197, 161, 228, 116, 31, 179, 142, 77, 140, 217, 94, 108, 137, 35, 39, 126, 84, 201, 71,
+            58, 10, 52, 7, 184, 156, 65, 185, 188, 182, 98, 65, 43,
+        ],
+        [
+            207, 153, 115, 73, 75, 200, 35, 16, 32, 82, 68, 212, 14, 206, 254, 63, 56, 140, 59,
+            185, 68, 204, 73, 67, 27, 95, 207, 228, 74, 72, 18, 2,
+        ],
+        [
+            185, 232, 177, 216, 67, 26, 72, 76, 157, 100, 17, 181, 161, 81, 150, 245, 177, 250, 28,
+            58, 130, 154, 25, 212, 136, 67, 140, 88, 161, 41, 232, 7,
+        ],
+        [
+            81, 249, 170, 40, 188, 151, 82, 232, 199, 203, 11, 66, 67, 143, 120, 54, 251, 4, 180,
+            183, 125, 142, 17, 249, 162, 6, 177, 157, 59, 88, 176, 60,
+        ],
+    ],
+    [
+        [
+            5, 39, 116, 70, 87, 101, 17, 78, 253, 249, 241, 133, 179, 20, 136, 35, 91, 141, 137,
+            92, 41, 59, 37, 107, 234, 106, 220, 49, 41, 20, 228, 50,
+        ],
+        [
+            239, 224, 34, 219, 49, 32, 61, 153, 160, 42, 234, 0, 74, 179, 81, 112, 224, 236, 181,
+            23, 23, 195, 36, 114, 166, 23, 23, 86, 131, 165, 107, 5,
+        ],
+        [
+            157, 92, 182, 140, 251, 56, 162, 62, 72, 102, 59, 203, 169, 127, 177, 139, 173, 223,
+            193, 220, 173, 108, 133, 146, 220, 50, 125, 176, 182, 249, 232, 4,
+        ],
+        [
+            63, 192, 18, 230, 178, 221, 22, 4, 11, 89, 10, 235, 5, 15, 142, 128, 116, 213, 251, 13,
+            33, 120, 164, 251, 113, 177, 195, 141, 146, 137, 224, 10,
+        ],
+        [
+            146, 171, 247, 18, 200, 10, 47, 184, 29, 129, 50, 237, 55, 8, 93, 157, 184, 118, 158,
+            97, 116, 202, 135, 240, 162, 226, 131, 135, 146, 30, 31, 55,
+        ],
+        [
+            240, 233, 41, 237, 47, 32, 136, 122, 213, 32, 160, 3, 47, 216, 193, 98, 240, 97, 202,
+            50, 205, 150, 40, 36, 87, 8, 132, 22, 53, 105, 118, 49,
+        ],
+        [
+            58, 230, 109, 52, 109, 115, 162, 116, 80, 181, 12, 159, 59, 246, 184, 98, 98, 100, 163,
+            231, 95, 152, 12, 195, 216, 26, 110, 75, 162, 52, 155, 36,
+        ],
+        [
+            1, 160, 91, 80, 221, 176, 161, 223, 120, 239, 80, 39, 92, 193, 131, 72, 216, 141, 107,
+            157, 188, 163, 246, 59, 97, 109, 38, 108, 175, 125, 229, 25,
+        ],
+    ],
+    [
+        [
+            46, 149, 1, 150, 69, 179, 76, 218, 4, 111, 196, 93, 98, 116, 217, 54, 62, 78, 228, 34,
+            223, 95, 111, 200, 16, 142, 189, 142, 54, 126, 218, 4,
+        ],
+        [
+            251, 202, 109, 62, 44, 11, 142, 106, 121, 128, 123, 3, 9, 30, 36, 167, 102, 117, 14,
+            76, 11, 184, 80, 177, 118, 164, 162, 108, 33, 215, 19, 25,
+        ],
+        [
+            198, 206, 168, 7, 85, 212, 232, 75, 69, 188, 47, 243, 205, 196, 159, 134, 115, 51, 173,
+            117, 92, 119, 112, 120, 247, 137, 248, 56, 24, 89, 164, 58,
+        ],
+        [
+            10, 143, 238, 110, 161, 146, 112, 53, 117, 115, 105, 110, 154, 126, 142, 110, 236, 6,
+            24, 240, 220, 69, 251, 167, 134, 148, 63, 30, 137, 42, 107, 5,
+        ],
+        [
+            143, 210, 102, 57, 97, 48, 92, 46, 119, 14, 133, 224, 196, 245, 141, 4, 132, 34, 58, 8,
+            68, 179, 49, 1, 109, 89, 134, 116, 7, 181, 84, 44,
+        ],
+        [
+            154, 170, 62, 94, 138, 234, 199, 118, 107, 57, 142, 126, 220, 120, 9, 134, 2, 37, 17,
+            163, 72, 232, 113, 113, 29, 210, 2, 39, 104, 121, 17, 22,
+        ],
+        [
+            50, 131, 237, 169, 131, 43, 30, 246, 70, 95, 0, 147, 100, 233, 236, 114, 161, 10, 83,
+            70, 68, 14, 36, 144, 2, 37, 135, 16, 147, 70, 231, 2,
+        ],
+        [
+            141, 174, 115, 187, 181, 226, 19, 76, 147, 156, 204, 125, 181, 255, 94, 24, 99, 152,
+            170, 194, 18, 9, 52, 211, 183, 62, 3, 121, 150, 15, 160, 26,
+        ],
+    ],
+    [
+        [
+            10, 39, 254, 165, 143, 140, 105, 76, 102, 131, 235, 58, 71, 161, 130, 71, 222, 115, 68,
+            185, 196, 102, 223, 155, 199, 84, 188, 119, 208, 10, 24, 3,
+        ],
+        [
+            251, 47, 0, 26, 188, 43, 51, 170, 4, 147, 19, 172, 125, 166, 44, 76, 174, 27, 174, 68,
+            192, 97, 20, 120, 89, 203, 21, 165, 193, 221, 112, 19,
+        ],
+        [
+            103, 90, 73, 145, 111, 139, 91, 135, 197, 12, 29, 183, 228, 247, 237, 160, 61, 197,
+            123, 235, 42, 8, 238, 111, 114, 33, 99, 55, 90, 181, 9, 59,
+        ],
+        [
+            136, 249, 201, 5, 56, 155, 117, 156, 164, 153, 151, 157, 204, 1, 122, 15, 169, 219,
+            108, 95, 137, 140, 225, 50, 8, 254, 128, 176, 245, 148, 231, 47,
+        ],
+        [
+            185, 227, 120, 188, 133, 61, 3, 169, 174, 45, 248, 48, 52, 20, 250, 157, 124, 212, 209,
+            192, 13, 22, 22, 102, 11, 236, 194, 236, 0, 22, 55, 44,
+        ],
+        [
+            172, 216, 57, 7, 93, 154, 231, 155, 201, 255, 159, 145, 116, 135, 127, 173, 185, 188,
+            237, 178, 10, 184, 107, 170, 165, 137, 247, 107, 147, 237, 232, 3,
+        ],
+        [
+            94, 197, 39, 16, 162, 134, 70, 119, 155, 56, 251, 82, 45, 190, 106, 99, 114, 38, 217,
+            242, 188, 178, 248, 123, 15, 14, 239, 147, 109, 15, 127, 16,
+        ],
+        [
+            152, 158, 191, 195, 22, 237, 186, 168, 85, 70, 228, 13, 111, 109, 5, 52, 154, 109, 80,
+            252, 147, 178, 64, 196, 184, 138, 225, 26, 247, 183, 189, 9,
+        ],
+    ],
+    [
+        [
+            153, 70, 167, 177, 229, 151, 123, 186, 51, 190, 231, 196, 226, 132, 37, 12, 27, 171,
+            67, 175, 188, 253, 127, 246, 196, 250, 200, 188, 89, 51, 90, 35,
+        ],
+        [
+            7, 47, 63, 135, 76, 144, 203, 18, 252, 212, 29, 27, 170, 100, 14, 233, 90, 100, 182,
+            36, 77, 55, 117, 100, 149, 210, 106, 18, 54, 194, 40, 45,
+        ],
+        [
+            145, 138, 183, 17, 90, 5, 158, 103, 234, 188, 115, 38, 10, 195, 12, 19, 111, 232, 36,
+            96, 216, 151, 218, 196, 23, 234, 114, 63, 112, 245, 52, 17,
+        ],
+        [
+            188, 191, 226, 36, 30, 19, 172, 66, 73, 35, 237, 184, 220, 146, 166, 50, 67, 252, 228,
+            206, 137, 25, 124, 209, 115, 233, 176, 38, 97, 194, 168, 55,
+        ],
+        [
+            156, 84, 233, 11, 139, 39, 117, 26, 180, 77, 208, 247, 156, 213, 39, 71, 105, 47, 14,
+            93, 84, 220, 66, 221, 67, 31, 239, 193, 137, 75, 98, 4,
+        ],
+        [
+            19, 1, 39, 184, 88, 13, 233, 13, 98, 92, 56, 181, 205, 181, 92, 50, 63, 164, 56, 233,
+            101, 251, 60, 126, 212, 238, 191, 231, 248, 115, 174, 31,
+        ],
+        [
+            45, 142, 9, 191, 151, 248, 78, 181, 181, 4, 226, 246, 186, 243, 96, 205, 28, 234, 235,
+            103, 49, 205, 114, 132, 136, 106, 50, 51, 220, 56, 185, 54,
+        ],
+        [
+            230, 1, 231, 54, 221, 188, 3, 230, 233, 72, 235, 37, 100, 117, 179, 200, 146, 196, 117,
+            150, 221, 59, 169, 110, 142, 254, 169, 129, 192, 210, 124, 2,
+        ],
+    ],
+    [
+        [
+            113, 127, 193, 36, 33, 98, 37, 229, 172, 76, 71, 176, 107, 47, 84, 130, 144, 108, 249,
+            204, 247, 50, 143, 242, 185, 160, 207, 41, 83, 184, 30, 1,
+        ],
+        [
+            60, 188, 219, 67, 6, 66, 64, 62, 105, 32, 121, 184, 30, 137, 100, 255, 176, 188, 74,
+            132, 73, 99, 168, 95, 30, 231, 55, 219, 80, 28, 236, 57,
+        ],
+        [
+            162, 221, 96, 144, 26, 59, 193, 103, 61, 148, 12, 148, 65, 41, 57, 22, 198, 112, 0, 25,
+            116, 202, 173, 254, 225, 89, 14, 113, 132, 126, 173, 25,
+        ],
+        [
+            211, 146, 138, 171, 246, 25, 51, 48, 83, 26, 132, 149, 160, 115, 242, 27, 161, 12, 76,
+            130, 46, 16, 213, 54, 134, 95, 115, 43, 91, 197, 223, 46,
+        ],
+        [
+            164, 147, 245, 58, 228, 119, 37, 72, 47, 194, 171, 113, 130, 106, 53, 214, 61, 56, 100,
+            200, 159, 224, 18, 246, 94, 215, 48, 69, 190, 169, 51, 42,
+        ],
+        [
+            132, 253, 120, 207, 143, 101, 57, 58, 167, 185, 23, 252, 157, 221, 248, 157, 46, 68,
+            122, 151, 192, 184, 194, 142, 98, 70, 189, 107, 61, 76, 149, 61,
+        ],
+        [
+            227, 38, 171, 227, 71, 147, 6, 219, 173, 77, 149, 187, 130, 150, 56, 156, 189, 132, 44,
+            201, 189, 2, 133, 21, 174, 175, 141, 89, 76, 98, 35, 39,
+        ],
+        [
+            112, 33, 226, 167, 129, 192, 243, 199, 106, 110, 29, 184, 195, 62, 72, 51, 203, 147,
+            66, 200, 234, 235, 45, 248, 118, 78, 37, 131, 2, 115, 240, 35,
+        ],
+    ],
+    [
+        [
+            29, 94, 98, 16, 75, 79, 201, 48, 252, 129, 82, 87, 55, 155, 214, 178, 0, 13, 80, 120,
+            252, 26, 199, 98, 112, 117, 251, 132, 9, 222, 88, 1,
+        ],
+        [
+            183, 159, 59, 28, 80, 19, 246, 226, 204, 42, 87, 98, 227, 225, 239, 180, 98, 43, 241,
+            205, 139, 238, 215, 120, 185, 226, 163, 198, 184, 182, 245, 34,
+        ],
+        [
+            197, 11, 112, 174, 119, 138, 42, 144, 151, 132, 47, 51, 241, 212, 173, 241, 153, 176,
+            171, 224, 252, 197, 125, 153, 40, 30, 3, 243, 250, 146, 89, 33,
+        ],
+        [
+            229, 206, 81, 251, 52, 183, 144, 121, 141, 120, 80, 108, 133, 246, 20, 114, 51, 177,
+            66, 218, 113, 1, 198, 68, 86, 224, 175, 59, 85, 237, 146, 25,
+        ],
+        [
+            199, 176, 127, 191, 59, 34, 251, 44, 251, 172, 34, 15, 151, 54, 230, 62, 38, 208, 221,
+            40, 244, 213, 69, 138, 161, 105, 65, 136, 129, 153, 158, 14,
+        ],
+        [
+            82, 194, 114, 87, 225, 102, 24, 119, 238, 85, 93, 21, 89, 149, 104, 144, 151, 19, 52,
+            96, 84, 71, 69, 160, 87, 245, 239, 208, 59, 88, 92, 19,
+        ],
+        [
+            182, 89, 228, 186, 60, 45, 23, 77, 190, 131, 89, 134, 109, 200, 222, 153, 254, 217,
+            191, 37, 100, 96, 85, 165, 64, 182, 141, 244, 208, 85, 89, 42,
+        ],
+        [
+            193, 216, 142, 50, 41, 162, 188, 146, 206, 33, 83, 35, 144, 127, 148, 243, 129, 98,
+            209, 161, 59, 180, 96, 133, 225, 53, 12, 187, 177, 207, 80, 34,
+        ],
+    ],
+    [
+        [
+            147, 41, 219, 169, 88, 177, 67, 111, 1, 56, 197, 17, 47, 232, 125, 5, 29, 159, 89, 40,
+            154, 98, 87, 141, 85, 150, 231, 16, 222, 124, 173, 37,
+        ],
+        [
+            202, 211, 119, 159, 104, 213, 253, 76, 62, 219, 254, 66, 220, 221, 192, 56, 122, 124,
+            42, 139, 242, 215, 178, 229, 246, 79, 21, 121, 31, 183, 27, 48,
+        ],
+        [
+            126, 218, 96, 65, 191, 72, 25, 144, 186, 197, 91, 220, 79, 245, 85, 156, 37, 197, 30,
+            94, 10, 170, 200, 6, 38, 97, 135, 84, 253, 214, 251, 14,
+        ],
+        [
+            48, 6, 251, 73, 216, 94, 185, 113, 9, 130, 250, 198, 78, 214, 160, 76, 245, 192, 171,
+            66, 30, 225, 79, 58, 153, 29, 135, 234, 76, 130, 57, 3,
+        ],
+        [
+            178, 120, 202, 176, 134, 4, 205, 224, 149, 195, 40, 140, 155, 181, 194, 86, 200, 34,
+            38, 203, 133, 233, 248, 87, 190, 214, 183, 33, 226, 170, 80, 35,
+        ],
+        [
+            19, 135, 66, 237, 59, 74, 11, 20, 115, 128, 39, 102, 218, 68, 225, 172, 232, 233, 63,
+            231, 110, 210, 108, 51, 25, 43, 231, 125, 230, 47, 145, 32,
+        ],
+        [
+            236, 165, 166, 249, 54, 207, 68, 121, 176, 134, 177, 143, 7, 104, 156, 1, 57, 62, 158,
+            204, 51, 205, 187, 225, 56, 95, 255, 145, 207, 19, 137, 25,
+        ],
+        [
+            193, 100, 46, 208, 77, 17, 64, 1, 103, 156, 154, 222, 122, 153, 178, 11, 101, 138, 156,
+            74, 247, 158, 1, 74, 139, 90, 207, 2, 47, 131, 87, 29,
+        ],
+    ],
+    [
+        [
+            9, 151, 216, 97, 151, 239, 26, 211, 241, 12, 192, 250, 40, 134, 192, 184, 76, 241, 13,
+            93, 189, 139, 9, 63, 165, 232, 209, 97, 134, 128, 47, 25,
+        ],
+        [
+            6, 215, 38, 225, 140, 33, 72, 85, 69, 32, 15, 206, 114, 187, 55, 198, 11, 4, 119, 45,
+            48, 105, 157, 118, 14, 168, 134, 79, 202, 86, 107, 54,
+        ],
+        [
+            155, 143, 59, 197, 19, 114, 1, 51, 150, 66, 32, 45, 71, 46, 23, 139, 173, 182, 83, 56,
+            51, 209, 56, 207, 199, 111, 208, 234, 115, 93, 56, 6,
+        ],
+        [
+            69, 81, 31, 176, 185, 244, 148, 134, 139, 89, 254, 245, 123, 72, 132, 8, 143, 17, 136,
+            40, 232, 236, 23, 16, 49, 201, 214, 155, 143, 214, 68, 46,
+        ],
+        [
+            103, 7, 147, 218, 180, 175, 110, 155, 209, 66, 81, 13, 47, 84, 202, 205, 59, 40, 230,
+            40, 60, 237, 124, 116, 178, 122, 45, 76, 26, 168, 166, 4,
+        ],
+        [
+            252, 98, 53, 28, 192, 10, 195, 191, 117, 188, 21, 45, 1, 14, 222, 141, 58, 57, 250,
+            153, 163, 4, 227, 41, 61, 128, 72, 245, 187, 192, 246, 59,
+        ],
+        [
+            226, 85, 143, 113, 156, 101, 10, 58, 234, 10, 73, 60, 40, 247, 222, 193, 27, 221, 7,
+            61, 57, 100, 158, 132, 84, 101, 53, 162, 83, 170, 215, 49,
+        ],
+        [
+            129, 32, 252, 254, 63, 237, 242, 129, 12, 162, 24, 70, 1, 58, 54, 56, 170, 225, 83,
+            125, 77, 125, 105, 162, 239, 120, 30, 118, 26, 46, 45, 21,
+        ],
+    ],
+    [
+        [
+            83, 141, 231, 4, 150, 71, 0, 103, 215, 244, 1, 244, 23, 161, 130, 12, 169, 207, 32, 79,
+            56, 140, 75, 104, 119, 157, 228, 240, 79, 73, 51, 59,
+        ],
+        [
+            234, 101, 136, 42, 80, 209, 52, 16, 174, 200, 12, 76, 182, 75, 79, 226, 173, 229, 58,
+            57, 151, 88, 7, 252, 145, 51, 6, 142, 162, 20, 130, 29,
+        ],
+        [
+            129, 10, 76, 145, 229, 149, 209, 78, 93, 209, 163, 248, 222, 215, 207, 48, 177, 196,
+            136, 196, 57, 240, 145, 134, 0, 59, 120, 123, 58, 72, 103, 34,
+        ],
+        [
+            159, 127, 28, 87, 113, 72, 104, 203, 67, 58, 211, 169, 138, 254, 31, 168, 1, 12, 221,
+            178, 227, 218, 109, 93, 161, 116, 98, 24, 54, 136, 33, 11,
+        ],
+        [
+            173, 29, 146, 100, 140, 178, 50, 51, 128, 61, 123, 161, 60, 75, 103, 218, 56, 121, 24,
+            43, 147, 99, 210, 193, 172, 188, 106, 182, 135, 222, 57, 20,
+        ],
+        [
+            166, 29, 73, 107, 24, 198, 36, 111, 3, 25, 183, 183, 143, 82, 96, 98, 203, 35, 146, 82,
+            49, 121, 135, 63, 191, 33, 165, 223, 230, 26, 71, 51,
+        ],
+        [
+            140, 119, 109, 157, 12, 201, 64, 255, 148, 64, 154, 55, 156, 173, 187, 3, 77, 206, 106,
+            33, 181, 22, 193, 88, 126, 68, 56, 236, 204, 241, 206, 59,
+        ],
+        [
+            223, 213, 234, 5, 113, 245, 89, 108, 98, 154, 67, 165, 131, 55, 1, 68, 214, 224, 106,
+            243, 170, 193, 222, 162, 232, 153, 246, 35, 149, 43, 120, 5,
+        ],
+    ],
+    [
+        [
+            90, 122, 239, 39, 194, 205, 160, 37, 139, 132, 43, 234, 78, 48, 93, 144, 182, 51, 6,
+            196, 190, 232, 79, 172, 38, 94, 38, 172, 54, 233, 92, 49,
+        ],
+        [
+            158, 106, 252, 23, 153, 30, 201, 88, 50, 108, 217, 90, 33, 91, 67, 52, 33, 27, 134, 67,
+            250, 80, 151, 7, 119, 5, 89, 110, 23, 214, 67, 17,
+        ],
+        [
+            223, 251, 16, 98, 252, 239, 182, 12, 255, 242, 67, 31, 99, 169, 10, 148, 70, 186, 236,
+            158, 230, 79, 2, 61, 166, 121, 72, 159, 81, 207, 43, 10,
+        ],
+        [
+            88, 65, 196, 114, 188, 103, 151, 218, 161, 219, 137, 9, 51, 81, 215, 64, 102, 55, 235,
+            96, 48, 54, 52, 217, 192, 125, 147, 89, 141, 194, 69, 14,
+        ],
+        [
+            146, 75, 25, 162, 47, 21, 77, 168, 14, 191, 35, 24, 27, 59, 14, 51, 198, 52, 130, 41,
+            223, 79, 45, 216, 248, 178, 250, 45, 220, 124, 24, 56,
+        ],
+        [
+            141, 246, 176, 10, 226, 240, 16, 2, 3, 42, 222, 107, 203, 96, 22, 128, 170, 251, 19,
+            224, 63, 228, 160, 116, 247, 60, 194, 164, 213, 90, 228, 41,
+        ],
+        [
+            193, 89, 149, 53, 35, 2, 173, 192, 228, 106, 131, 55, 10, 216, 235, 148, 81, 38, 218,
+            206, 47, 201, 1, 76, 165, 237, 8, 181, 51, 182, 179, 44,
+        ],
+        [
+            208, 110, 172, 179, 135, 41, 146, 198, 71, 234, 170, 157, 98, 177, 254, 237, 235, 236,
+            170, 248, 184, 158, 182, 109, 20, 53, 20, 230, 235, 161, 47, 58,
+        ],
+    ],
+    [
+        [
+            173, 212, 202, 158, 121, 32, 179, 110, 216, 160, 75, 127, 248, 141, 186, 129, 102, 227,
+            204, 97, 88, 186, 60, 229, 229, 253, 167, 213, 175, 226, 127, 47,
+        ],
+        [
+            150, 23, 120, 218, 29, 242, 9, 232, 28, 28, 210, 109, 85, 108, 243, 26, 30, 119, 124,
+            117, 125, 222, 224, 22, 235, 55, 57, 228, 153, 209, 124, 48,
+        ],
+        [
+            167, 39, 173, 99, 186, 157, 146, 31, 20, 26, 63, 62, 185, 254, 57, 13, 117, 96, 73, 25,
+            182, 97, 42, 160, 92, 242, 26, 54, 145, 29, 31, 29,
+        ],
+        [
+            27, 117, 138, 76, 21, 193, 135, 154, 46, 130, 187, 36, 2, 196, 200, 196, 114, 110, 210,
+            92, 51, 12, 40, 19, 62, 34, 201, 44, 159, 3, 144, 4,
+        ],
+        [
+            210, 235, 204, 146, 85, 169, 236, 3, 193, 188, 201, 172, 79, 164, 148, 207, 40, 103,
+            56, 206, 91, 104, 249, 17, 75, 159, 27, 103, 101, 72, 100, 37,
+        ],
+        [
+            129, 52, 24, 42, 26, 131, 207, 198, 211, 136, 212, 66, 40, 68, 181, 251, 95, 157, 84,
+            218, 27, 199, 150, 194, 62, 78, 46, 197, 253, 50, 6, 16,
+        ],
+        [
+            218, 196, 228, 200, 220, 170, 106, 13, 0, 28, 246, 133, 25, 240, 21, 184, 58, 238, 128,
+            219, 223, 224, 8, 226, 193, 129, 230, 131, 177, 116, 189, 3,
+        ],
+        [
+            184, 75, 112, 127, 251, 197, 87, 114, 3, 208, 126, 142, 219, 226, 17, 61, 237, 126,
+            201, 155, 23, 146, 209, 142, 168, 108, 160, 39, 43, 57, 93, 40,
+        ],
+    ],
+    [
+        [
+            95, 161, 42, 151, 11, 124, 239, 193, 114, 247, 72, 186, 128, 141, 47, 108, 197, 47,
+            226, 180, 118, 22, 163, 147, 103, 103, 121, 44, 149, 7, 225, 52,
+        ],
+        [
+            197, 245, 125, 151, 243, 170, 39, 79, 128, 110, 215, 131, 244, 219, 188, 110, 33, 84,
+            142, 213, 174, 251, 94, 60, 6, 133, 32, 235, 44, 57, 127, 13,
+        ],
+        [
+            252, 8, 154, 162, 113, 63, 242, 246, 220, 245, 78, 4, 239, 88, 232, 208, 96, 142, 94,
+            85, 216, 210, 72, 102, 140, 127, 171, 225, 68, 126, 75, 24,
+        ],
+        [
+            86, 231, 20, 187, 67, 55, 132, 4, 133, 210, 120, 101, 238, 222, 7, 144, 48, 63, 42,
+            118, 223, 206, 56, 246, 33, 231, 203, 252, 190, 167, 135, 6,
+        ],
+        [
+            94, 214, 184, 9, 110, 119, 88, 199, 41, 223, 151, 204, 14, 1, 22, 72, 205, 44, 201,
+            199, 49, 104, 118, 205, 219, 194, 27, 249, 202, 206, 11, 38,
+        ],
+        [
+            238, 189, 11, 100, 86, 83, 110, 193, 217, 127, 43, 219, 33, 236, 60, 155, 46, 210, 95,
+            165, 211, 55, 114, 120, 151, 4, 84, 199, 188, 80, 111, 24,
+        ],
+        [
+            75, 132, 96, 67, 196, 109, 201, 195, 202, 133, 205, 157, 180, 194, 218, 28, 161, 176,
+            208, 36, 13, 53, 120, 238, 165, 67, 123, 43, 49, 230, 118, 16,
+        ],
+        [
+            216, 53, 14, 231, 149, 30, 238, 198, 91, 0, 75, 182, 248, 127, 51, 15, 249, 81, 128,
+            49, 85, 26, 247, 233, 71, 61, 204, 240, 198, 44, 253, 4,
+        ],
+    ],
+    [
+        [
+            117, 79, 104, 186, 22, 240, 96, 245, 133, 124, 14, 208, 175, 92, 38, 203, 96, 167, 168,
+            74, 132, 255, 239, 51, 230, 9, 37, 100, 77, 221, 86, 56,
+        ],
+        [
+            124, 56, 154, 244, 207, 39, 218, 208, 77, 128, 167, 52, 127, 189, 228, 183, 179, 179,
+            19, 142, 235, 99, 1, 109, 232, 184, 146, 75, 251, 180, 168, 34,
+        ],
+        [
+            38, 81, 241, 77, 207, 198, 52, 63, 104, 175, 182, 68, 16, 186, 231, 19, 112, 112, 137,
+            169, 174, 109, 153, 170, 164, 156, 204, 14, 86, 138, 183, 10,
+        ],
+        [
+            224, 100, 144, 95, 68, 53, 51, 69, 233, 19, 14, 192, 229, 240, 1, 145, 122, 174, 244,
+            98, 18, 76, 248, 132, 254, 161, 221, 175, 254, 139, 28, 44,
+        ],
+        [
+            106, 24, 183, 172, 72, 180, 89, 112, 169, 107, 39, 253, 193, 177, 132, 118, 27, 212,
+            94, 108, 143, 97, 7, 222, 16, 135, 55, 59, 108, 184, 225, 39,
+        ],
+        [
+            185, 92, 139, 189, 50, 105, 41, 186, 189, 124, 23, 212, 220, 255, 191, 28, 156, 70,
+            224, 206, 235, 149, 177, 221, 61, 166, 2, 189, 157, 71, 9, 10,
+        ],
+        [
+            46, 205, 220, 212, 230, 14, 222, 10, 86, 30, 250, 186, 42, 16, 214, 159, 31, 106, 154,
+            168, 68, 126, 110, 221, 254, 185, 231, 235, 185, 145, 232, 50,
+        ],
+        [
+            158, 96, 218, 239, 191, 119, 59, 99, 248, 159, 160, 48, 59, 14, 160, 80, 7, 149, 110,
+            144, 96, 78, 250, 254, 213, 73, 119, 133, 151, 128, 130, 57,
+        ],
+    ],
+    [
+        [
+            55, 146, 3, 40, 40, 129, 157, 149, 185, 250, 175, 142, 28, 65, 11, 98, 180, 41, 163,
+            240, 126, 177, 8, 171, 37, 81, 46, 151, 115, 201, 64, 4,
+        ],
+        [
+            33, 171, 216, 52, 120, 12, 136, 183, 174, 39, 212, 234, 107, 120, 254, 152, 217, 105,
+            17, 158, 47, 221, 66, 80, 173, 143, 0, 245, 2, 54, 105, 20,
+        ],
+        [
+            165, 77, 224, 22, 86, 173, 23, 3, 158, 217, 230, 209, 104, 123, 51, 124, 229, 70, 86,
+            113, 69, 124, 202, 89, 130, 165, 9, 143, 13, 117, 251, 41,
+        ],
+        [
+            150, 0, 141, 72, 1, 45, 247, 44, 239, 25, 127, 126, 167, 217, 60, 19, 87, 40, 41, 53,
+            154, 65, 36, 62, 224, 245, 133, 23, 62, 113, 68, 10,
+        ],
+        [
+            240, 173, 98, 79, 231, 216, 199, 13, 115, 239, 49, 44, 70, 131, 132, 17, 181, 178, 255,
+            187, 26, 212, 140, 247, 181, 66, 131, 122, 34, 232, 212, 51,
+        ],
+        [
+            128, 97, 150, 86, 107, 88, 9, 39, 221, 108, 40, 17, 141, 189, 176, 112, 245, 115, 102,
+            222, 41, 103, 116, 83, 45, 41, 79, 189, 123, 128, 221, 28,
+        ],
+        [
+            124, 71, 144, 26, 166, 147, 228, 121, 160, 123, 202, 119, 231, 221, 98, 239, 232, 206,
+            68, 253, 178, 155, 183, 151, 255, 14, 63, 178, 233, 48, 7, 45,
+        ],
+        [
+            247, 149, 217, 167, 89, 183, 230, 75, 8, 65, 241, 170, 95, 83, 4, 74, 30, 184, 105,
+            224, 114, 65, 153, 101, 169, 46, 55, 94, 151, 150, 156, 62,
+        ],
+    ],
+    [
+        [
+            224, 154, 142, 251, 230, 202, 38, 207, 234, 62, 53, 21, 186, 231, 57, 92, 134, 174, 48,
+            226, 161, 198, 9, 186, 167, 197, 249, 112, 127, 236, 188, 40,
+        ],
+        [
+            71, 140, 229, 89, 155, 109, 149, 82, 250, 226, 71, 125, 62, 174, 128, 67, 205, 8, 237,
+            7, 131, 223, 182, 207, 162, 132, 28, 3, 34, 239, 115, 1,
+        ],
+        [
+            2, 52, 130, 240, 234, 192, 5, 100, 224, 251, 234, 21, 75, 255, 150, 249, 123, 6, 111,
+            69, 38, 123, 57, 240, 142, 106, 115, 11, 208, 182, 76, 1,
+        ],
+        [
+            195, 55, 130, 187, 251, 59, 51, 201, 72, 12, 61, 186, 107, 186, 8, 121, 240, 11, 205,
+            41, 41, 96, 48, 97, 225, 55, 86, 127, 182, 47, 73, 26,
+        ],
+        [
+            252, 85, 10, 142, 41, 197, 192, 149, 233, 59, 135, 90, 245, 1, 2, 82, 149, 230, 105,
+            50, 180, 40, 246, 255, 235, 38, 246, 220, 26, 71, 108, 58,
+        ],
+        [
+            45, 234, 112, 242, 241, 115, 242, 151, 74, 199, 165, 59, 232, 121, 140, 143, 72, 21,
+            222, 198, 250, 27, 82, 71, 136, 229, 46, 114, 215, 58, 80, 59,
+        ],
+        [
+            76, 30, 114, 108, 66, 237, 123, 62, 251, 89, 191, 57, 10, 24, 103, 125, 62, 176, 243,
+            156, 26, 71, 128, 100, 216, 96, 134, 238, 25, 255, 52, 18,
+        ],
+        [
+            121, 9, 205, 213, 115, 82, 104, 88, 4, 94, 64, 39, 52, 23, 184, 59, 249, 173, 51, 174,
+            29, 29, 93, 209, 180, 25, 30, 248, 200, 217, 8, 57,
+        ],
+    ],
+    [
+        [
+            29, 243, 202, 191, 232, 38, 147, 197, 36, 165, 153, 225, 248, 25, 108, 49, 193, 125,
+            147, 152, 224, 204, 29, 99, 149, 18, 80, 202, 126, 240, 240, 44,
+        ],
+        [
+            251, 175, 93, 27, 1, 223, 152, 144, 40, 199, 0, 117, 26, 185, 199, 115, 43, 5, 28, 50,
+            87, 195, 19, 177, 129, 150, 12, 27, 27, 106, 104, 1,
+        ],
+        [
+            229, 107, 241, 196, 196, 75, 154, 193, 28, 194, 91, 92, 211, 30, 203, 193, 132, 50,
+            220, 88, 9, 89, 31, 83, 156, 14, 131, 253, 144, 77, 180, 21,
+        ],
+        [
+            254, 86, 225, 99, 239, 66, 104, 173, 130, 44, 9, 3, 102, 150, 131, 27, 222, 8, 11, 91,
+            248, 133, 165, 168, 173, 243, 131, 231, 0, 73, 179, 7,
+        ],
+        [
+            188, 14, 111, 31, 108, 93, 253, 223, 11, 168, 85, 111, 196, 44, 54, 85, 185, 179, 22,
+            134, 219, 228, 190, 119, 109, 175, 172, 63, 43, 197, 129, 28,
+        ],
+        [
+            100, 77, 224, 123, 66, 253, 55, 225, 81, 92, 1, 112, 220, 61, 123, 40, 141, 117, 186,
+            45, 66, 37, 141, 226, 222, 227, 252, 18, 235, 1, 150, 55,
+        ],
+        [
+            21, 60, 39, 162, 247, 118, 245, 247, 37, 78, 193, 16, 37, 78, 38, 239, 102, 205, 145,
+            92, 94, 149, 21, 90, 29, 2, 226, 14, 63, 94, 18, 55,
+        ],
+        [
+            32, 30, 94, 116, 13, 47, 190, 17, 138, 146, 169, 220, 7, 166, 141, 201, 122, 50, 211,
+            216, 192, 170, 170, 171, 30, 44, 106, 143, 15, 47, 230, 25,
+        ],
+    ],
+    [
+        [
+            77, 240, 65, 69, 55, 114, 61, 35, 5, 23, 224, 54, 74, 102, 26, 45, 204, 151, 93, 176,
+            44, 214, 39, 238, 92, 55, 135, 235, 175, 159, 199, 5,
+        ],
+        [
+            122, 13, 98, 228, 133, 218, 65, 35, 16, 73, 59, 73, 0, 127, 167, 126, 175, 104, 228,
+            96, 221, 56, 145, 137, 246, 33, 195, 5, 77, 54, 190, 9,
+        ],
+        [
+            174, 226, 237, 252, 72, 86, 217, 57, 42, 131, 198, 224, 42, 59, 77, 64, 103, 3, 231,
+            53, 203, 219, 45, 142, 33, 249, 24, 163, 139, 52, 71, 22,
+        ],
+        [
+            165, 193, 99, 157, 238, 70, 47, 182, 129, 207, 77, 193, 167, 206, 41, 170, 8, 91, 51,
+            163, 137, 67, 22, 73, 127, 207, 133, 240, 97, 233, 40, 62,
+        ],
+        [
+            68, 84, 199, 125, 172, 196, 145, 144, 127, 29, 232, 25, 215, 220, 132, 99, 86, 52, 46,
+            227, 101, 72, 70, 193, 3, 12, 225, 172, 53, 10, 55, 1,
+        ],
+        [
+            3, 230, 66, 237, 23, 28, 118, 88, 23, 25, 96, 176, 203, 97, 140, 92, 216, 153, 34, 166,
+            23, 137, 59, 172, 172, 144, 164, 12, 90, 33, 51, 50,
+        ],
+        [
+            208, 145, 77, 172, 10, 38, 208, 225, 138, 7, 140, 175, 49, 114, 231, 203, 45, 54, 2,
+            248, 110, 69, 166, 65, 113, 253, 131, 119, 63, 153, 168, 8,
+        ],
+        [
+            64, 27, 162, 156, 179, 22, 43, 27, 133, 222, 33, 161, 107, 141, 133, 53, 253, 214, 128,
+            156, 65, 14, 138, 233, 169, 145, 68, 139, 139, 152, 17, 21,
+        ],
+    ],
+    [
+        [
+            60, 31, 22, 89, 116, 180, 216, 149, 0, 129, 148, 46, 128, 169, 173, 130, 198, 155, 20,
+            77, 15, 33, 67, 126, 183, 233, 15, 232, 67, 208, 104, 2,
+        ],
+        [
+            155, 169, 114, 191, 1, 9, 32, 205, 125, 117, 59, 132, 211, 82, 6, 93, 8, 189, 13, 64,
+            142, 81, 52, 199, 215, 64, 188, 226, 85, 66, 199, 4,
+        ],
+        [
+            135, 136, 62, 242, 84, 7, 79, 221, 122, 126, 6, 216, 66, 57, 49, 81, 215, 223, 105,
+            207, 3, 255, 74, 17, 23, 227, 139, 51, 56, 70, 173, 59,
+        ],
+        [
+            180, 159, 125, 70, 170, 143, 19, 162, 132, 18, 31, 117, 102, 35, 244, 188, 51, 218,
+            241, 248, 199, 96, 59, 221, 138, 234, 184, 20, 66, 172, 108, 63,
+        ],
+        [
+            64, 182, 108, 185, 163, 65, 242, 40, 229, 179, 230, 48, 115, 253, 64, 30, 243, 239,
+            110, 178, 250, 53, 51, 179, 73, 51, 100, 19, 25, 117, 241, 22,
+        ],
+        [
+            231, 35, 183, 229, 255, 134, 248, 75, 161, 139, 166, 135, 137, 49, 205, 77, 3, 250,
+            194, 31, 188, 120, 169, 46, 149, 249, 55, 90, 229, 74, 4, 49,
+        ],
+        [
+            24, 229, 105, 198, 193, 222, 104, 210, 123, 28, 79, 249, 84, 41, 18, 53, 10, 226, 217,
+            78, 205, 25, 72, 174, 239, 206, 106, 238, 80, 64, 200, 22,
+        ],
+        [
+            222, 176, 15, 182, 226, 196, 43, 186, 234, 151, 194, 218, 55, 176, 128, 110, 23, 3,
+            111, 85, 205, 226, 16, 195, 224, 5, 52, 202, 233, 194, 144, 32,
+        ],
+    ],
+    [
+        [
+            65, 188, 25, 218, 142, 199, 65, 90, 223, 99, 127, 135, 228, 118, 83, 193, 167, 156,
+            245, 70, 139, 254, 210, 121, 117, 108, 221, 63, 29, 183, 68, 23,
+        ],
+        [
+            45, 246, 56, 33, 68, 250, 251, 144, 133, 241, 149, 206, 109, 107, 232, 244, 134, 26,
+            11, 23, 246, 208, 237, 5, 5, 70, 130, 91, 33, 64, 201, 53,
+        ],
+        [
+            202, 192, 115, 229, 84, 103, 107, 253, 178, 17, 39, 9, 36, 148, 157, 247, 239, 229, 28,
+            93, 207, 6, 42, 165, 6, 122, 151, 176, 77, 47, 252, 7,
+        ],
+        [
+            207, 85, 81, 110, 169, 61, 244, 254, 205, 23, 156, 177, 253, 223, 114, 177, 39, 174,
+            107, 106, 136, 3, 157, 197, 104, 218, 228, 151, 68, 138, 26, 52,
+        ],
+        [
+            50, 91, 21, 55, 91, 236, 143, 193, 156, 32, 162, 37, 68, 242, 34, 132, 56, 188, 117,
+            252, 205, 61, 217, 205, 22, 224, 120, 2, 142, 91, 239, 7,
+        ],
+        [
+            98, 217, 244, 140, 150, 75, 199, 231, 239, 148, 141, 95, 83, 68, 152, 85, 142, 239,
+            212, 124, 160, 95, 115, 128, 194, 250, 115, 140, 161, 21, 111, 40,
+        ],
+        [
+            103, 19, 40, 8, 83, 195, 218, 97, 78, 185, 136, 249, 38, 37, 51, 245, 34, 59, 230, 66,
+            108, 128, 156, 149, 116, 19, 215, 251, 124, 252, 120, 31,
+        ],
+        [
+            220, 0, 174, 242, 25, 60, 52, 199, 2, 18, 234, 211, 205, 186, 197, 58, 213, 209, 37,
+            91, 68, 41, 212, 206, 113, 9, 4, 54, 157, 125, 222, 22,
+        ],
+    ],
+    [
+        [
+            60, 95, 106, 48, 229, 64, 114, 62, 218, 8, 178, 224, 211, 189, 87, 226, 33, 44, 116,
+            179, 48, 119, 6, 223, 75, 208, 59, 198, 250, 3, 96, 17,
+        ],
+        [
+            95, 180, 11, 184, 37, 224, 28, 70, 179, 135, 225, 145, 85, 105, 148, 132, 31, 49, 15,
+            181, 204, 100, 143, 221, 64, 231, 81, 201, 255, 93, 18, 46,
+        ],
+        [
+            163, 206, 214, 36, 248, 250, 138, 215, 102, 145, 187, 127, 207, 228, 179, 30, 237, 175,
+            69, 58, 117, 224, 107, 128, 0, 10, 199, 204, 144, 221, 111, 21,
+        ],
+        [
+            65, 194, 195, 213, 229, 186, 100, 176, 8, 52, 52, 67, 60, 46, 97, 32, 154, 236, 10, 44,
+            194, 188, 140, 207, 58, 214, 36, 231, 249, 44, 20, 55,
+        ],
+        [
+            21, 231, 150, 194, 145, 213, 144, 44, 76, 189, 202, 14, 62, 107, 105, 136, 153, 154,
+            16, 176, 139, 115, 87, 62, 16, 249, 72, 237, 131, 75, 114, 59,
+        ],
+        [
+            221, 180, 148, 120, 116, 48, 217, 169, 177, 254, 80, 199, 131, 151, 79, 41, 76, 181,
+            126, 86, 146, 180, 54, 66, 34, 169, 24, 95, 230, 127, 206, 42,
+        ],
+        [
+            153, 198, 204, 12, 57, 10, 116, 176, 197, 116, 227, 193, 115, 216, 137, 230, 206, 161,
+            169, 203, 53, 115, 126, 94, 225, 40, 47, 121, 180, 193, 191, 14,
+        ],
+        [
+            132, 55, 75, 201, 131, 204, 219, 8, 118, 98, 65, 32, 145, 169, 179, 73, 224, 100, 168,
+            94, 47, 22, 227, 203, 68, 128, 36, 32, 112, 241, 126, 41,
+        ],
+    ],
+    [
+        [
+            185, 130, 202, 63, 39, 212, 225, 220, 185, 162, 38, 43, 70, 142, 46, 167, 158, 231,
+            248, 162, 242, 228, 11, 205, 122, 190, 138, 146, 68, 200, 133, 25,
+        ],
+        [
+            213, 163, 16, 131, 225, 53, 231, 167, 142, 135, 65, 194, 29, 18, 178, 96, 58, 186, 75,
+            238, 6, 177, 23, 109, 14, 47, 134, 55, 211, 252, 146, 24,
+        ],
+        [
+            9, 164, 244, 123, 78, 17, 135, 83, 123, 116, 140, 84, 200, 32, 129, 123, 112, 125, 127,
+            102, 9, 77, 120, 106, 205, 83, 139, 201, 178, 212, 206, 52,
+        ],
+        [
+            2, 154, 191, 181, 97, 225, 10, 225, 173, 78, 34, 92, 171, 14, 150, 110, 158, 229, 90,
+            223, 81, 134, 2, 162, 176, 233, 223, 254, 63, 229, 137, 6,
+        ],
+        [
+            58, 166, 77, 108, 142, 242, 100, 146, 162, 37, 77, 174, 129, 3, 223, 75, 28, 158, 118,
+            86, 133, 195, 136, 246, 117, 173, 109, 37, 117, 87, 8, 48,
+        ],
+        [
+            89, 201, 176, 246, 163, 171, 140, 250, 101, 230, 141, 183, 75, 25, 28, 67, 247, 45,
+            213, 84, 241, 33, 235, 165, 130, 125, 107, 163, 46, 28, 74, 13,
+        ],
+        [
+            102, 44, 233, 80, 122, 63, 170, 158, 150, 164, 86, 224, 152, 129, 198, 100, 247, 121,
+            85, 67, 184, 35, 97, 152, 12, 86, 232, 241, 177, 38, 19, 16,
+        ],
+        [
+            128, 70, 1, 11, 18, 206, 21, 3, 196, 188, 66, 134, 153, 133, 140, 52, 70, 114, 252, 17,
+            143, 212, 210, 62, 45, 114, 178, 57, 254, 119, 152, 62,
+        ],
+    ],
+    [
+        [
+            86, 29, 41, 210, 20, 163, 246, 97, 255, 42, 82, 153, 58, 80, 69, 223, 114, 218, 207,
+            112, 216, 174, 191, 209, 200, 188, 254, 134, 214, 30, 232, 13,
+        ],
+        [
+            146, 74, 34, 8, 35, 218, 132, 100, 104, 27, 60, 156, 232, 162, 104, 71, 255, 94, 4,
+            125, 63, 59, 17, 91, 86, 65, 207, 33, 111, 195, 21, 61,
+        ],
+        [
+            83, 90, 45, 62, 199, 173, 172, 28, 233, 71, 22, 4, 87, 56, 218, 182, 125, 246, 86, 201,
+            211, 184, 158, 40, 99, 41, 70, 52, 68, 70, 33, 11,
+        ],
+        [
+            160, 62, 174, 112, 183, 78, 236, 128, 32, 30, 87, 94, 5, 220, 26, 132, 201, 247, 134,
+            39, 177, 19, 78, 198, 18, 118, 167, 237, 23, 1, 25, 47,
+        ],
+        [
+            181, 137, 97, 42, 173, 195, 208, 246, 200, 53, 2, 111, 52, 198, 106, 192, 198, 223,
+            132, 39, 226, 208, 93, 252, 43, 174, 146, 151, 35, 70, 71, 17,
+        ],
+        [
+            185, 213, 47, 92, 58, 84, 148, 151, 165, 115, 236, 139, 63, 3, 108, 13, 100, 13, 73,
+            104, 142, 21, 241, 166, 37, 188, 69, 96, 115, 201, 132, 37,
+        ],
+        [
+            227, 170, 112, 80, 230, 140, 124, 73, 86, 12, 122, 47, 236, 177, 87, 54, 38, 180, 198,
+            34, 36, 211, 183, 241, 169, 23, 98, 119, 106, 231, 182, 46,
+        ],
+        [
+            211, 204, 104, 127, 81, 137, 162, 175, 132, 17, 114, 150, 104, 121, 23, 138, 87, 2,
+            118, 223, 47, 149, 65, 61, 225, 158, 188, 62, 132, 24, 89, 1,
+        ],
+    ],
+    [
+        [
+            61, 236, 235, 15, 173, 143, 20, 200, 109, 66, 144, 52, 144, 222, 213, 48, 46, 246, 142,
+            179, 144, 182, 34, 247, 30, 74, 122, 105, 62, 148, 121, 55,
+        ],
+        [
+            138, 247, 228, 197, 108, 167, 21, 234, 145, 197, 219, 29, 69, 246, 61, 188, 46, 76,
+            255, 106, 41, 192, 16, 159, 198, 14, 32, 15, 185, 106, 162, 61,
+        ],
+        [
+            221, 232, 255, 202, 222, 138, 118, 47, 195, 220, 232, 160, 178, 195, 18, 192, 134, 252,
+            39, 157, 86, 11, 116, 44, 110, 103, 166, 191, 244, 217, 176, 62,
+        ],
+        [
+            103, 49, 138, 113, 133, 245, 37, 35, 191, 47, 54, 201, 112, 220, 191, 103, 254, 100,
+            32, 246, 92, 171, 179, 209, 2, 98, 151, 243, 9, 160, 7, 17,
+        ],
+        [
+            194, 218, 101, 98, 161, 81, 251, 151, 95, 207, 172, 101, 69, 59, 19, 129, 145, 90, 58,
+            131, 112, 62, 201, 181, 12, 218, 118, 57, 128, 243, 18, 61,
+        ],
+        [
+            136, 114, 9, 162, 245, 108, 250, 167, 107, 12, 53, 121, 162, 86, 72, 82, 193, 173, 193,
+            3, 112, 153, 247, 130, 215, 3, 83, 160, 130, 183, 171, 36,
+        ],
+        [
+            72, 255, 40, 62, 196, 43, 119, 217, 123, 93, 7, 133, 137, 86, 165, 234, 226, 235, 82,
+            36, 205, 38, 94, 234, 141, 70, 115, 139, 150, 35, 3, 15,
+        ],
+        [
+            137, 194, 240, 168, 61, 140, 100, 71, 151, 99, 232, 226, 1, 177, 155, 111, 105, 172,
+            167, 186, 232, 216, 142, 252, 199, 238, 27, 190, 112, 115, 218, 15,
+        ],
+    ],
+    [
+        [
+            210, 180, 82, 123, 75, 247, 236, 159, 89, 130, 67, 24, 48, 93, 251, 167, 49, 138, 99,
+            231, 31, 23, 106, 47, 29, 153, 248, 255, 6, 64, 114, 37,
+        ],
+        [
+            213, 231, 86, 118, 67, 132, 251, 112, 123, 171, 149, 118, 232, 231, 88, 39, 110, 109,
+            67, 159, 116, 246, 137, 172, 209, 103, 210, 207, 92, 19, 65, 11,
+        ],
+        [
+            159, 0, 20, 44, 28, 39, 141, 233, 233, 7, 150, 247, 77, 58, 84, 79, 162, 237, 150, 180,
+            146, 15, 95, 110, 111, 147, 65, 35, 109, 145, 56, 3,
+        ],
+        [
+            8, 60, 212, 124, 61, 67, 66, 57, 221, 27, 31, 245, 118, 82, 175, 250, 190, 11, 19, 136,
+            111, 10, 148, 232, 184, 161, 35, 134, 69, 73, 154, 17,
+        ],
+        [
+            145, 127, 187, 184, 48, 200, 18, 166, 176, 76, 149, 227, 216, 148, 148, 30, 55, 241,
+            93, 246, 183, 184, 74, 100, 56, 253, 80, 102, 120, 224, 96, 52,
+        ],
+        [
+            198, 162, 119, 153, 73, 75, 95, 48, 9, 209, 11, 141, 127, 201, 187, 106, 244, 206, 122,
+            104, 124, 120, 171, 12, 234, 209, 27, 130, 143, 214, 21, 55,
+        ],
+        [
+            187, 102, 233, 179, 50, 210, 197, 38, 215, 193, 25, 172, 131, 167, 24, 42, 181, 204,
+            231, 27, 240, 186, 96, 154, 187, 91, 0, 202, 139, 153, 89, 22,
+        ],
+        [
+            139, 6, 212, 90, 73, 253, 231, 41, 155, 82, 25, 222, 118, 132, 114, 172, 73, 33, 16,
+            106, 255, 202, 122, 2, 32, 23, 219, 145, 34, 3, 127, 17,
+        ],
+    ],
+    [
+        [
+            15, 218, 1, 4, 47, 88, 165, 70, 251, 169, 133, 238, 213, 60, 36, 16, 38, 25, 239, 203,
+            119, 241, 177, 190, 214, 205, 67, 143, 237, 93, 65, 12,
+        ],
+        [
+            139, 246, 38, 149, 143, 160, 39, 39, 68, 154, 125, 174, 15, 68, 25, 53, 134, 207, 82,
+            209, 173, 211, 1, 232, 108, 205, 236, 153, 156, 188, 123, 49,
+        ],
+        [
+            166, 203, 125, 197, 10, 162, 54, 101, 73, 138, 132, 192, 94, 134, 184, 43, 163, 125,
+            62, 136, 192, 111, 81, 244, 96, 91, 107, 230, 39, 174, 221, 50,
+        ],
+        [
+            203, 17, 199, 92, 248, 138, 46, 153, 243, 134, 224, 231, 126, 165, 12, 83, 132, 100,
+            210, 177, 219, 175, 207, 80, 243, 78, 207, 168, 26, 150, 59, 16,
+        ],
+        [
+            210, 115, 149, 113, 141, 81, 10, 215, 232, 146, 149, 148, 242, 200, 224, 251, 2, 113,
+            208, 123, 121, 60, 91, 36, 120, 173, 36, 166, 222, 85, 146, 17,
+        ],
+        [
+            15, 39, 251, 185, 192, 28, 201, 215, 69, 23, 154, 118, 71, 80, 71, 200, 44, 28, 159,
+            144, 72, 122, 131, 183, 155, 235, 245, 162, 246, 224, 195, 30,
+        ],
+        [
+            192, 99, 56, 232, 172, 239, 89, 241, 68, 215, 74, 219, 17, 83, 149, 196, 212, 141, 89,
+            77, 176, 112, 208, 14, 102, 155, 163, 223, 19, 237, 240, 11,
+        ],
+        [
+            11, 134, 188, 142, 141, 48, 24, 249, 107, 250, 136, 137, 50, 137, 122, 132, 89, 184,
+            91, 134, 18, 58, 197, 81, 29, 107, 53, 52, 51, 190, 47, 41,
+        ],
+    ],
+    [
+        [
+            216, 96, 15, 16, 34, 37, 7, 137, 147, 242, 29, 102, 222, 190, 103, 228, 196, 43, 184,
+            68, 207, 200, 152, 23, 166, 13, 103, 72, 250, 77, 223, 19,
+        ],
+        [
+            17, 5, 52, 91, 113, 213, 231, 173, 71, 80, 14, 50, 250, 23, 255, 204, 19, 119, 18, 63,
+            0, 183, 109, 238, 188, 128, 216, 227, 125, 77, 56, 39,
+        ],
+        [
+            137, 69, 254, 160, 111, 117, 176, 50, 113, 241, 185, 88, 252, 132, 100, 222, 204, 231,
+            208, 220, 80, 201, 73, 143, 0, 36, 187, 40, 29, 227, 128, 15,
+        ],
+        [
+            85, 19, 126, 169, 120, 52, 94, 181, 83, 59, 160, 181, 85, 188, 159, 229, 226, 209, 209,
+            144, 162, 129, 42, 221, 116, 26, 39, 226, 41, 116, 138, 37,
+        ],
+        [
+            136, 39, 38, 138, 243, 149, 227, 50, 119, 42, 102, 230, 95, 128, 172, 244, 44, 121, 53,
+            67, 27, 74, 67, 37, 254, 30, 37, 122, 3, 93, 83, 5,
+        ],
+        [
+            18, 180, 139, 65, 80, 118, 148, 154, 67, 83, 242, 248, 63, 17, 141, 98, 105, 98, 77,
+            39, 125, 125, 132, 187, 192, 110, 216, 193, 129, 161, 141, 26,
+        ],
+        [
+            12, 175, 122, 170, 199, 194, 225, 179, 142, 228, 183, 160, 252, 228, 14, 93, 28, 232,
+            62, 123, 252, 13, 7, 73, 178, 111, 126, 69, 82, 83, 167, 56,
+        ],
+        [
+            34, 98, 50, 126, 175, 145, 47, 127, 51, 121, 100, 251, 5, 193, 176, 185, 129, 28, 77,
+            14, 239, 31, 114, 104, 157, 135, 243, 15, 194, 186, 247, 47,
+        ],
+    ],
+    [
+        [
+            234, 212, 198, 174, 82, 170, 174, 229, 248, 183, 186, 230, 189, 253, 193, 136, 113,
+            147, 209, 239, 130, 31, 109, 6, 2, 116, 245, 23, 87, 89, 104, 63,
+        ],
+        [
+            254, 234, 202, 192, 38, 123, 22, 81, 79, 136, 11, 185, 106, 85, 172, 180, 130, 174,
+            183, 251, 175, 203, 79, 183, 69, 186, 217, 218, 118, 131, 45, 36,
+        ],
+        [
+            156, 17, 73, 41, 203, 16, 153, 119, 186, 222, 153, 124, 230, 146, 87, 29, 7, 191, 190,
+            168, 102, 105, 238, 126, 148, 93, 158, 1, 200, 176, 0, 61,
+        ],
+        [
+            28, 160, 75, 140, 67, 66, 166, 123, 64, 37, 80, 129, 123, 96, 55, 239, 245, 242, 176,
+            30, 43, 167, 123, 30, 176, 235, 103, 119, 245, 43, 21, 44,
+        ],
+        [
+            163, 35, 23, 88, 71, 238, 67, 76, 77, 179, 194, 119, 140, 158, 137, 93, 247, 67, 243,
+            45, 252, 94, 13, 74, 38, 133, 49, 175, 68, 253, 135, 60,
+        ],
+        [
+            82, 94, 126, 254, 52, 64, 115, 123, 76, 161, 251, 209, 137, 97, 118, 74, 81, 1, 125,
+            193, 173, 11, 246, 66, 249, 206, 159, 206, 86, 37, 57, 17,
+        ],
+        [
+            51, 57, 178, 131, 146, 150, 143, 91, 101, 103, 151, 109, 209, 27, 102, 100, 179, 202,
+            11, 153, 116, 142, 71, 129, 40, 20, 255, 203, 12, 76, 77, 53,
+        ],
+        [
+            242, 188, 216, 208, 193, 32, 161, 163, 164, 220, 120, 103, 93, 135, 13, 181, 119, 237,
+            107, 48, 156, 126, 194, 143, 116, 254, 41, 3, 168, 47, 144, 52,
+        ],
+    ],
+    [
+        [
+            11, 17, 2, 160, 102, 157, 163, 62, 254, 29, 138, 65, 230, 250, 58, 107, 50, 68, 184,
+            225, 156, 103, 209, 236, 196, 36, 246, 79, 147, 27, 42, 53,
+        ],
+        [
+            33, 33, 59, 118, 107, 125, 175, 118, 27, 201, 46, 161, 241, 95, 54, 7, 100, 3, 105,
+            194, 176, 145, 178, 241, 147, 26, 225, 149, 225, 48, 203, 10,
+        ],
+        [
+            66, 12, 165, 163, 5, 18, 193, 183, 234, 11, 228, 173, 190, 240, 194, 125, 104, 253,
+            185, 96, 65, 0, 33, 143, 94, 152, 3, 80, 191, 234, 246, 41,
+        ],
+        [
+            106, 111, 228, 171, 155, 251, 129, 82, 97, 39, 36, 150, 52, 230, 2, 162, 124, 1, 114,
+            127, 6, 185, 190, 77, 105, 246, 148, 200, 181, 122, 152, 31,
+        ],
+        [
+            76, 128, 201, 228, 223, 71, 179, 217, 129, 188, 155, 222, 98, 245, 140, 135, 197, 35,
+            131, 14, 99, 164, 68, 80, 61, 181, 56, 111, 34, 113, 62, 28,
+        ],
+        [
+            161, 162, 61, 111, 161, 188, 162, 168, 143, 68, 187, 26, 105, 142, 203, 40, 131, 84,
+            161, 4, 23, 197, 49, 163, 197, 175, 44, 66, 178, 49, 34, 44,
+        ],
+        [
+            11, 182, 20, 161, 20, 121, 201, 228, 240, 159, 79, 73, 227, 220, 151, 16, 152, 49, 190,
+            6, 54, 180, 221, 163, 21, 37, 241, 190, 21, 124, 22, 12,
+        ],
+        [
+            30, 201, 178, 243, 23, 101, 121, 64, 115, 58, 150, 24, 168, 137, 3, 5, 21, 6, 45, 177,
+            142, 173, 190, 90, 208, 48, 226, 34, 43, 38, 248, 22,
+        ],
+    ],
+    [
+        [
+            157, 196, 42, 177, 43, 61, 107, 82, 52, 60, 246, 13, 114, 134, 5, 254, 222, 212, 147,
+            7, 79, 65, 89, 206, 136, 72, 110, 59, 237, 163, 232, 55,
+        ],
+        [
+            128, 212, 62, 148, 105, 186, 184, 3, 0, 157, 76, 76, 177, 17, 197, 42, 170, 97, 125,
+            102, 222, 54, 95, 255, 85, 220, 105, 248, 152, 208, 45, 8,
+        ],
+        [
+            227, 105, 171, 85, 47, 42, 190, 109, 30, 44, 51, 6, 165, 123, 172, 160, 211, 16, 230,
+            26, 236, 178, 84, 233, 75, 144, 170, 176, 212, 45, 8, 49,
+        ],
+        [
+            71, 24, 160, 130, 125, 205, 239, 123, 250, 248, 212, 253, 150, 47, 54, 228, 246, 98,
+            93, 10, 67, 26, 177, 163, 16, 162, 188, 21, 125, 105, 201, 0,
+        ],
+        [
+            196, 159, 136, 205, 253, 178, 38, 61, 249, 18, 42, 38, 104, 83, 32, 105, 105, 218, 166,
+            88, 116, 188, 68, 103, 186, 14, 155, 32, 90, 204, 134, 19,
+        ],
+        [
+            220, 208, 84, 205, 93, 246, 24, 240, 195, 19, 108, 146, 148, 239, 196, 44, 229, 2, 201,
+            158, 233, 172, 117, 23, 108, 146, 186, 58, 130, 170, 197, 47,
+        ],
+        [
+            48, 27, 108, 232, 165, 0, 125, 145, 138, 3, 23, 211, 187, 17, 166, 226, 107, 197, 242,
+            35, 26, 41, 1, 72, 51, 128, 184, 217, 227, 132, 211, 35,
+        ],
+        [
+            92, 66, 232, 101, 143, 36, 76, 151, 59, 49, 148, 158, 200, 199, 162, 104, 255, 186,
+            143, 97, 68, 243, 94, 86, 178, 221, 95, 134, 100, 235, 198, 22,
+        ],
+    ],
+    [
+        [
+            38, 139, 223, 198, 218, 129, 87, 92, 118, 134, 243, 198, 64, 44, 189, 253, 40, 56, 192,
+            128, 135, 20, 106, 32, 231, 124, 210, 0, 196, 153, 140, 43,
+        ],
+        [
+            184, 194, 151, 179, 50, 163, 11, 229, 169, 173, 159, 39, 249, 174, 118, 91, 223, 168,
+            50, 101, 209, 0, 165, 156, 165, 7, 122, 158, 112, 227, 29, 27,
+        ],
+        [
+            64, 156, 174, 42, 252, 153, 144, 240, 138, 152, 130, 113, 25, 91, 2, 73, 78, 22, 219,
+            226, 9, 62, 212, 218, 201, 191, 178, 186, 43, 11, 237, 28,
+        ],
+        [
+            233, 131, 26, 245, 82, 167, 210, 217, 33, 231, 113, 122, 73, 198, 60, 177, 210, 216,
+            218, 1, 171, 161, 181, 219, 224, 166, 231, 9, 144, 173, 215, 55,
+        ],
+        [
+            1, 121, 8, 158, 236, 71, 214, 244, 87, 104, 58, 32, 244, 25, 55, 245, 102, 235, 161,
+            181, 162, 41, 179, 252, 157, 112, 182, 24, 11, 162, 12, 3,
+        ],
+        [
+            135, 220, 222, 191, 198, 97, 139, 12, 21, 185, 161, 58, 235, 130, 145, 103, 216, 73,
+            24, 149, 54, 221, 204, 44, 29, 105, 75, 241, 59, 92, 14, 1,
+        ],
+        [
+            113, 99, 3, 22, 170, 61, 230, 135, 157, 116, 193, 60, 246, 113, 193, 150, 160, 211, 86,
+            48, 135, 216, 226, 81, 111, 68, 71, 29, 111, 78, 39, 7,
+        ],
+        [
+            76, 15, 116, 174, 6, 23, 26, 143, 29, 83, 201, 35, 202, 41, 125, 55, 43, 33, 17, 230,
+            142, 183, 55, 241, 144, 102, 49, 101, 206, 238, 122, 52,
+        ],
+    ],
+    [
+        [
+            117, 135, 48, 149, 94, 206, 192, 251, 95, 172, 33, 214, 122, 5, 176, 120, 216, 116, 99,
+            41, 31, 203, 126, 237, 42, 244, 207, 224, 245, 150, 117, 23,
+        ],
+        [
+            215, 141, 63, 69, 188, 158, 241, 182, 219, 150, 206, 78, 163, 60, 134, 169, 32, 124,
+            131, 192, 65, 85, 99, 147, 172, 71, 89, 31, 146, 237, 99, 6,
+        ],
+        [
+            112, 236, 159, 17, 39, 131, 26, 30, 73, 94, 167, 165, 101, 55, 30, 223, 226, 53, 245,
+            230, 110, 29, 243, 20, 140, 0, 239, 202, 7, 190, 74, 27,
+        ],
+        [
+            43, 45, 16, 196, 170, 112, 210, 218, 217, 27, 243, 24, 116, 156, 168, 216, 232, 51,
+            233, 255, 29, 133, 105, 96, 40, 72, 39, 238, 122, 241, 20, 62,
+        ],
+        [
+            112, 97, 10, 55, 63, 180, 243, 106, 97, 140, 110, 206, 228, 135, 105, 109, 12, 145,
+            104, 189, 222, 92, 227, 145, 83, 23, 123, 58, 80, 63, 119, 49,
+        ],
+        [
+            222, 111, 84, 201, 220, 211, 85, 66, 2, 80, 166, 99, 203, 7, 253, 212, 8, 120, 179,
+            163, 48, 117, 246, 142, 242, 83, 91, 35, 65, 145, 20, 43,
+        ],
+        [
+            13, 98, 129, 119, 108, 221, 125, 217, 152, 161, 126, 199, 233, 58, 76, 137, 123, 187,
+            202, 234, 56, 36, 240, 90, 181, 55, 176, 89, 27, 84, 134, 12,
+        ],
+        [
+            196, 96, 10, 230, 5, 3, 194, 234, 175, 221, 145, 93, 40, 98, 252, 129, 107, 230, 72, 7,
+            205, 13, 181, 56, 107, 83, 102, 7, 241, 38, 44, 28,
+        ],
+    ],
+    [
+        [
+            49, 255, 63, 55, 167, 241, 86, 34, 231, 35, 195, 153, 186, 81, 209, 131, 82, 204, 179,
+            49, 181, 172, 52, 196, 139, 145, 206, 177, 48, 174, 77, 6,
+        ],
+        [
+            173, 191, 127, 104, 192, 251, 10, 96, 24, 209, 39, 36, 112, 169, 200, 142, 24, 169, 11,
+            184, 106, 152, 170, 237, 234, 8, 49, 65, 20, 150, 61, 59,
+        ],
+        [
+            205, 20, 22, 50, 121, 235, 201, 249, 50, 21, 200, 211, 220, 198, 103, 170, 248, 76,
+            117, 126, 81, 201, 134, 212, 205, 162, 229, 180, 51, 19, 237, 5,
+        ],
+        [
+            169, 152, 197, 220, 162, 201, 73, 12, 53, 71, 243, 206, 218, 32, 232, 63, 161, 163, 81,
+            59, 103, 25, 235, 175, 156, 58, 131, 72, 120, 135, 220, 40,
+        ],
+        [
+            174, 157, 241, 32, 126, 124, 61, 18, 85, 161, 222, 239, 104, 112, 181, 58, 17, 10, 192,
+            128, 159, 167, 150, 102, 32, 158, 191, 58, 196, 214, 211, 36,
+        ],
+        [
+            212, 189, 202, 43, 164, 106, 115, 57, 56, 129, 143, 0, 92, 174, 37, 114, 194, 97, 201,
+            67, 83, 60, 242, 21, 255, 122, 109, 95, 55, 136, 212, 12,
+        ],
+        [
+            41, 172, 202, 39, 28, 52, 243, 63, 155, 161, 82, 6, 78, 68, 236, 168, 171, 107, 200,
+            81, 37, 82, 194, 11, 74, 23, 40, 145, 40, 163, 196, 31,
+        ],
+        [
+            119, 146, 247, 74, 70, 181, 50, 90, 212, 1, 145, 188, 149, 47, 106, 9, 44, 225, 113,
+            77, 103, 73, 250, 25, 15, 46, 111, 20, 202, 135, 106, 58,
+        ],
+    ],
+    [
+        [
+            214, 208, 212, 237, 91, 53, 93, 29, 73, 180, 213, 18, 238, 127, 24, 92, 242, 232, 88,
+            248, 28, 20, 126, 241, 2, 100, 46, 30, 212, 70, 50, 2,
+        ],
+        [
+            75, 62, 19, 16, 103, 247, 66, 81, 143, 208, 79, 175, 38, 117, 164, 226, 213, 10, 65,
+            48, 228, 244, 51, 138, 66, 240, 74, 112, 189, 152, 168, 22,
+        ],
+        [
+            137, 246, 59, 222, 246, 36, 63, 111, 128, 237, 151, 78, 199, 142, 182, 92, 117, 227,
+            249, 16, 135, 236, 15, 7, 222, 205, 206, 235, 59, 21, 248, 22,
+        ],
+        [
+            134, 58, 60, 194, 199, 50, 43, 29, 94, 67, 39, 243, 47, 72, 136, 20, 166, 189, 195,
+            227, 151, 138, 193, 6, 141, 87, 134, 214, 107, 227, 179, 25,
+        ],
+        [
+            240, 65, 105, 174, 82, 73, 62, 176, 32, 143, 83, 50, 246, 33, 143, 191, 153, 108, 79,
+            227, 137, 196, 65, 7, 202, 251, 72, 151, 51, 138, 67, 6,
+        ],
+        [
+            240, 164, 171, 188, 152, 96, 15, 167, 244, 151, 116, 123, 174, 150, 114, 219, 203, 190,
+            60, 64, 123, 164, 24, 213, 22, 120, 151, 169, 147, 87, 14, 54,
+        ],
+        [
+            237, 220, 160, 30, 10, 28, 230, 104, 44, 38, 128, 21, 205, 37, 7, 127, 217, 55, 245,
+            49, 101, 127, 156, 214, 36, 193, 135, 216, 188, 175, 29, 13,
+        ],
+        [
+            159, 14, 150, 98, 114, 124, 115, 108, 53, 17, 110, 73, 228, 238, 220, 104, 221, 43, 35,
+            200, 148, 231, 94, 27, 93, 87, 208, 147, 133, 248, 182, 22,
+        ],
+    ],
+    [
+        [
+            195, 102, 107, 183, 172, 226, 147, 203, 62, 64, 248, 145, 214, 32, 229, 17, 52, 12,
+            239, 111, 133, 247, 141, 219, 112, 72, 179, 205, 47, 104, 154, 28,
+        ],
+        [
+            154, 83, 5, 251, 52, 174, 96, 151, 148, 226, 184, 227, 233, 61, 78, 47, 189, 59, 196,
+            225, 49, 253, 53, 118, 250, 113, 105, 195, 118, 18, 59, 58,
+        ],
+        [
+            254, 53, 230, 124, 224, 107, 238, 47, 232, 196, 210, 155, 253, 125, 87, 42, 243, 249,
+            247, 197, 210, 242, 181, 193, 98, 105, 25, 167, 203, 190, 56, 25,
+        ],
+        [
+            119, 44, 168, 159, 70, 8, 158, 167, 237, 214, 246, 240, 186, 191, 26, 102, 222, 77,
+            142, 206, 192, 203, 225, 105, 135, 210, 127, 165, 15, 239, 31, 45,
+        ],
+        [
+            71, 8, 243, 147, 142, 135, 167, 118, 218, 47, 132, 51, 79, 183, 217, 131, 101, 83, 223,
+            206, 34, 158, 147, 137, 194, 202, 7, 29, 82, 158, 123, 25,
+        ],
+        [
+            153, 113, 163, 1, 79, 119, 160, 95, 221, 126, 184, 114, 24, 24, 253, 225, 39, 126, 110,
+            215, 105, 198, 155, 244, 127, 181, 251, 237, 65, 154, 157, 21,
+        ],
+        [
+            135, 239, 95, 132, 96, 211, 235, 194, 241, 123, 41, 109, 18, 212, 73, 170, 223, 91,
+            248, 7, 78, 221, 20, 42, 22, 16, 11, 32, 47, 37, 78, 55,
+        ],
+        [
+            207, 147, 78, 128, 25, 37, 55, 174, 70, 71, 43, 31, 237, 22, 121, 86, 23, 22, 145, 84,
+            77, 46, 59, 0, 250, 91, 15, 235, 56, 172, 105, 45,
+        ],
+    ],
+];
+
+pub fn generator() -> pallas::Affine {
+    pallas::Affine::from_xy(
+        pallas::Base::from_bytes(&GENERATOR.0).unwrap(),
+        pallas::Base::from_bytes(&GENERATOR.1).unwrap(),
+    )
+    .unwrap()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::super::{
+        test_lagrange_coeffs, test_zs_and_us, NUM_WINDOWS, ORCHARD_PERSONALIZATION,
+    };
+    use super::*;
+    use group::Curve;
+    use pasta_curves::{
+        arithmetic::{CurveExt, FieldExt},
+        pallas,
+    };
+
+    #[test]
+    fn generator() {
+        let hasher = pallas::Point::hash_to_curve(ORCHARD_PERSONALIZATION);
+        let point = hasher(b"K");
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(*coords.x(), pallas::Base::from_bytes(&GENERATOR.0).unwrap());
+        assert_eq!(*coords.y(), pallas::Base::from_bytes(&GENERATOR.1).unwrap());
+    }
+
+    #[test]
+    fn lagrange_coeffs() {
+        let base = super::generator();
+        test_lagrange_coeffs(base, NUM_WINDOWS);
+    }
+
+    #[test]
+    fn z() {
+        let base = super::generator();
+        test_zs_and_us(base, &Z, &U, NUM_WINDOWS);
+    }
+}

+ 2965 - 0
src/crypto/constants/fixed_bases/spend_auth_g.rs

@@ -0,0 +1,2965 @@
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    pallas,
+};
+
+/// The value commitment is used to check balance between inputs and outputs. The value is
+/// placed over this generator.
+pub const GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        99, 201, 117, 184, 132, 114, 26, 141, 12, 161, 112, 123, 227, 12, 127, 12, 95, 68, 95, 62,
+        124, 24, 141, 59, 6, 214, 241, 40, 179, 35, 85, 55,
+    ],
+    [
+        201, 59, 12, 123, 129, 62, 227, 76, 216, 189, 5, 192, 254, 20, 201, 223, 251, 36, 214, 254,
+        252, 188, 16, 123, 219, 102, 26, 223, 127, 53, 208, 26,
+    ],
+);
+
+/// Full-width z-values for GENERATOR
+pub const Z: [u64; super::NUM_WINDOWS] = [
+    49707, 15701, 45931, 163127, 41654, 212130, 34473, 25205, 4118, 10240, 12264, 22866, 203610,
+    18808, 13851, 62448, 62380, 94497, 39496, 73216, 32037, 32774, 61690, 39173, 74580, 84678,
+    23418, 103090, 34763, 19801, 54976, 196082, 131117, 20556, 58936, 139049, 49530, 488, 2129,
+    44219, 64328, 38875, 58430, 34536, 84014, 15455, 38059, 15915, 26893, 100337, 120701, 98937,
+    37075, 35293, 8351, 8361, 273432, 717, 3253, 40140, 28024, 95195, 41937, 200127, 95471, 103562,
+    75737, 4182, 362357, 15219, 136680, 168274, 25085, 5925, 254392, 93041, 56204, 46757, 109788,
+    100797, 80349, 87315, 77372, 96572, 18965,
+];
+
+/// Full-width u-values for GENERATOR
+pub const U: [[[u8; 32]; super::H]; super::NUM_WINDOWS] = [
+    [
+        [
+            134, 139, 159, 167, 179, 203, 183, 86, 54, 69, 108, 127, 183, 40, 226, 188, 34, 72,
+            235, 174, 120, 30, 214, 202, 46, 166, 177, 78, 133, 80, 221, 35,
+        ],
+        [
+            128, 147, 194, 62, 34, 230, 94, 209, 44, 242, 88, 94, 91, 252, 184, 217, 72, 173, 32,
+            128, 118, 158, 176, 67, 255, 192, 227, 150, 189, 56, 205, 10,
+        ],
+        [
+            89, 235, 150, 72, 148, 202, 175, 172, 88, 248, 184, 63, 149, 194, 33, 149, 187, 218,
+            51, 194, 131, 184, 34, 138, 62, 112, 115, 0, 197, 109, 145, 37,
+        ],
+        [
+            55, 241, 4, 146, 234, 109, 232, 212, 90, 95, 84, 170, 84, 254, 20, 89, 80, 100, 143, 3,
+            30, 229, 117, 35, 32, 249, 43, 36, 200, 74, 200, 13,
+        ],
+        [
+            194, 23, 77, 68, 227, 113, 225, 181, 201, 67, 219, 25, 234, 73, 160, 104, 12, 6, 180,
+            204, 185, 16, 224, 62, 83, 132, 193, 185, 69, 90, 67, 29,
+        ],
+        [
+            156, 240, 85, 68, 24, 96, 228, 37, 250, 218, 25, 99, 51, 50, 37, 27, 23, 76, 42, 243,
+            126, 23, 236, 249, 179, 94, 59, 83, 197, 193, 215, 32,
+        ],
+        [
+            73, 145, 163, 254, 185, 142, 57, 198, 25, 48, 144, 127, 17, 171, 210, 170, 164, 88, 3,
+            235, 37, 45, 124, 125, 44, 113, 141, 119, 93, 91, 163, 47,
+        ],
+        [
+            144, 156, 74, 131, 227, 73, 40, 222, 73, 67, 210, 157, 154, 161, 96, 112, 61, 251, 210,
+            2, 2, 199, 107, 190, 39, 133, 107, 181, 235, 217, 1, 32,
+        ],
+    ],
+    [
+        [
+            204, 30, 193, 82, 109, 194, 174, 212, 203, 182, 251, 224, 85, 31, 240, 246, 163, 165,
+            69, 160, 26, 78, 143, 50, 115, 92, 109, 71, 48, 205, 160, 15,
+        ],
+        [
+            20, 52, 64, 133, 30, 26, 4, 37, 88, 2, 107, 192, 179, 203, 130, 109, 203, 163, 224, 31,
+            238, 207, 238, 0, 79, 55, 35, 8, 69, 238, 155, 60,
+        ],
+        [
+            129, 188, 56, 216, 72, 61, 212, 36, 171, 128, 228, 90, 229, 75, 126, 41, 186, 124, 100,
+            62, 161, 224, 105, 69, 196, 160, 131, 35, 39, 217, 149, 40,
+        ],
+        [
+            168, 4, 93, 175, 37, 163, 30, 50, 27, 141, 194, 23, 206, 18, 65, 85, 150, 36, 51, 169,
+            206, 47, 128, 65, 151, 181, 117, 50, 74, 251, 37, 14,
+        ],
+        [
+            143, 167, 209, 67, 187, 208, 101, 235, 49, 77, 89, 225, 7, 243, 50, 56, 150, 233, 186,
+            94, 0, 161, 136, 54, 163, 101, 23, 180, 199, 82, 163, 32,
+        ],
+        [
+            83, 85, 245, 163, 247, 47, 226, 3, 90, 35, 254, 250, 71, 176, 18, 214, 121, 5, 11, 162,
+            55, 2, 116, 46, 36, 20, 81, 19, 209, 79, 84, 53,
+        ],
+        [
+            181, 129, 189, 44, 171, 86, 12, 145, 21, 185, 255, 145, 238, 46, 220, 242, 242, 239, 5,
+            39, 176, 87, 6, 205, 209, 13, 190, 26, 72, 252, 247, 47,
+        ],
+        [
+            169, 151, 215, 50, 18, 225, 124, 186, 49, 5, 84, 177, 139, 69, 189, 88, 237, 39, 196,
+            111, 251, 146, 226, 12, 207, 215, 254, 0, 246, 155, 86, 31,
+        ],
+    ],
+    [
+        [
+            178, 207, 217, 160, 25, 246, 180, 59, 161, 29, 253, 55, 84, 14, 217, 170, 120, 167,
+            203, 21, 147, 2, 190, 236, 198, 41, 99, 194, 47, 97, 213, 20,
+        ],
+        [
+            45, 217, 42, 12, 249, 206, 77, 249, 191, 69, 78, 30, 201, 54, 60, 175, 218, 187, 222,
+            73, 28, 240, 105, 118, 228, 192, 184, 161, 65, 230, 115, 35,
+        ],
+        [
+            145, 233, 255, 221, 141, 221, 216, 67, 77, 53, 229, 49, 167, 130, 235, 235, 55, 39, 88,
+            70, 146, 70, 243, 31, 156, 138, 246, 251, 13, 41, 2, 16,
+        ],
+        [
+            44, 14, 167, 217, 244, 57, 222, 12, 243, 116, 172, 17, 218, 246, 161, 124, 209, 248,
+            240, 97, 59, 176, 138, 242, 76, 23, 207, 179, 136, 243, 79, 12,
+        ],
+        [
+            120, 239, 19, 236, 60, 149, 184, 181, 237, 83, 242, 22, 122, 53, 211, 43, 195, 217,
+            208, 185, 53, 156, 105, 158, 161, 156, 47, 90, 67, 139, 159, 60,
+        ],
+        [
+            249, 224, 188, 87, 191, 134, 192, 15, 207, 29, 167, 27, 149, 161, 44, 61, 81, 55, 15,
+            30, 78, 203, 150, 136, 55, 222, 237, 245, 39, 227, 177, 29,
+        ],
+        [
+            91, 228, 118, 231, 230, 113, 246, 243, 112, 73, 19, 146, 105, 173, 81, 28, 27, 59, 168,
+            92, 82, 198, 192, 111, 208, 156, 210, 129, 148, 194, 13, 14,
+        ],
+        [
+            224, 185, 193, 29, 240, 177, 244, 134, 56, 252, 24, 119, 213, 110, 191, 221, 105, 122,
+            89, 30, 114, 196, 53, 33, 168, 48, 77, 85, 241, 128, 168, 51,
+        ],
+    ],
+    [
+        [
+            79, 58, 209, 170, 171, 147, 19, 156, 23, 243, 181, 231, 92, 215, 234, 118, 17, 151,
+            212, 115, 164, 220, 114, 178, 18, 147, 101, 201, 228, 162, 126, 54,
+        ],
+        [
+            235, 245, 230, 232, 32, 231, 43, 206, 119, 97, 30, 131, 10, 3, 195, 93, 78, 158, 42,
+            62, 53, 26, 42, 26, 123, 39, 164, 39, 149, 119, 79, 39,
+        ],
+        [
+            78, 161, 190, 242, 222, 143, 16, 193, 35, 198, 206, 67, 37, 101, 231, 6, 62, 205, 36,
+            2, 146, 11, 191, 111, 78, 107, 222, 19, 32, 194, 31, 28,
+        ],
+        [
+            189, 36, 36, 147, 50, 162, 17, 179, 250, 219, 167, 100, 114, 56, 90, 184, 42, 49, 101,
+            155, 213, 179, 140, 62, 245, 55, 81, 218, 11, 116, 203, 32,
+        ],
+        [
+            170, 122, 46, 42, 82, 84, 63, 207, 174, 176, 7, 139, 74, 49, 198, 238, 243, 217, 155,
+            175, 31, 22, 42, 49, 125, 6, 210, 80, 124, 138, 184, 42,
+        ],
+        [
+            30, 149, 102, 115, 26, 193, 146, 161, 139, 248, 18, 9, 55, 231, 50, 78, 236, 158, 74,
+            204, 173, 228, 73, 125, 75, 127, 42, 21, 202, 128, 69, 46,
+        ],
+        [
+            33, 237, 143, 1, 212, 254, 16, 231, 202, 39, 42, 28, 134, 77, 246, 51, 31, 146, 160,
+            11, 178, 194, 169, 251, 50, 131, 241, 132, 81, 122, 244, 58,
+        ],
+        [
+            197, 18, 235, 234, 189, 238, 252, 93, 244, 246, 76, 251, 21, 250, 8, 118, 38, 40, 39,
+            103, 96, 147, 112, 103, 188, 219, 33, 183, 6, 139, 186, 47,
+        ],
+    ],
+    [
+        [
+            27, 179, 1, 219, 5, 237, 22, 195, 49, 31, 125, 207, 224, 185, 249, 141, 188, 16, 209,
+            225, 213, 167, 101, 63, 245, 229, 177, 242, 28, 121, 227, 4,
+        ],
+        [
+            209, 90, 156, 216, 151, 223, 46, 129, 150, 195, 74, 57, 16, 102, 32, 110, 156, 108, 48,
+            128, 236, 231, 35, 169, 60, 210, 63, 240, 252, 175, 28, 22,
+        ],
+        [
+            133, 6, 154, 178, 236, 58, 163, 25, 85, 197, 169, 75, 26, 103, 112, 168, 225, 245, 103,
+            211, 223, 163, 79, 47, 253, 17, 114, 233, 127, 217, 94, 51,
+        ],
+        [
+            252, 137, 21, 60, 226, 116, 238, 97, 66, 128, 128, 213, 51, 35, 35, 130, 77, 160, 200,
+            226, 91, 25, 22, 133, 27, 188, 198, 159, 155, 4, 106, 4,
+        ],
+        [
+            76, 129, 23, 15, 64, 93, 179, 128, 41, 202, 40, 164, 7, 199, 172, 203, 98, 179, 243,
+            28, 66, 149, 80, 177, 112, 51, 81, 231, 178, 208, 16, 54,
+        ],
+        [
+            100, 99, 114, 178, 31, 130, 16, 122, 18, 47, 103, 243, 55, 84, 112, 92, 156, 246, 119,
+            91, 4, 173, 157, 48, 246, 132, 129, 162, 33, 42, 164, 38,
+        ],
+        [
+            152, 167, 13, 134, 122, 121, 84, 244, 205, 49, 40, 241, 68, 223, 97, 107, 112, 216,
+            124, 98, 232, 219, 187, 158, 28, 95, 222, 129, 219, 240, 233, 13,
+        ],
+        [
+            255, 191, 150, 9, 220, 109, 94, 217, 202, 19, 194, 216, 152, 81, 167, 107, 204, 138,
+            104, 200, 200, 253, 210, 14, 87, 133, 149, 93, 119, 137, 129, 45,
+        ],
+    ],
+    [
+        [
+            162, 107, 4, 19, 49, 176, 93, 99, 15, 133, 159, 53, 191, 0, 79, 228, 236, 96, 145, 53,
+            120, 10, 150, 94, 198, 49, 253, 119, 229, 116, 150, 13,
+        ],
+        [
+            205, 164, 35, 49, 168, 151, 217, 138, 164, 143, 237, 170, 140, 153, 15, 171, 74, 89,
+            60, 195, 13, 20, 170, 36, 66, 199, 45, 252, 18, 47, 204, 8,
+        ],
+        [
+            95, 149, 177, 178, 217, 143, 235, 251, 203, 227, 33, 62, 147, 134, 228, 83, 84, 170,
+            118, 91, 103, 94, 41, 99, 1, 95, 59, 67, 253, 146, 165, 5,
+        ],
+        [
+            19, 184, 182, 93, 1, 4, 202, 21, 119, 77, 151, 12, 98, 255, 223, 34, 54, 162, 44, 199,
+            13, 217, 159, 37, 147, 185, 89, 21, 251, 128, 21, 25,
+        ],
+        [
+            190, 179, 248, 211, 188, 233, 181, 149, 178, 232, 28, 253, 234, 103, 160, 153, 252,
+            188, 19, 132, 143, 227, 31, 109, 134, 85, 21, 104, 133, 39, 148, 13,
+        ],
+        [
+            149, 40, 255, 15, 159, 19, 43, 100, 31, 196, 107, 209, 83, 25, 77, 122, 211, 27, 237,
+            158, 74, 188, 198, 73, 86, 171, 73, 163, 110, 176, 37, 55,
+        ],
+        [
+            25, 194, 88, 151, 108, 22, 157, 145, 11, 87, 6, 215, 227, 141, 203, 218, 34, 25, 236,
+            49, 69, 170, 243, 13, 240, 210, 161, 186, 45, 32, 239, 12,
+        ],
+        [
+            100, 133, 83, 207, 52, 184, 61, 180, 226, 133, 42, 161, 249, 216, 158, 39, 5, 185, 52,
+            8, 212, 185, 49, 234, 32, 200, 23, 158, 19, 111, 74, 50,
+        ],
+    ],
+    [
+        [
+            215, 206, 249, 236, 176, 248, 217, 12, 0, 204, 155, 112, 248, 215, 200, 248, 8, 250,
+            61, 104, 22, 109, 196, 54, 27, 3, 0, 203, 187, 116, 69, 45,
+        ],
+        [
+            82, 29, 122, 199, 191, 205, 105, 136, 96, 93, 249, 65, 104, 197, 48, 64, 166, 175, 144,
+            96, 114, 186, 147, 65, 1, 35, 87, 134, 90, 145, 230, 24,
+        ],
+        [
+            154, 172, 87, 147, 10, 166, 129, 223, 224, 162, 95, 194, 248, 41, 234, 174, 177, 221,
+            64, 244, 202, 201, 225, 138, 179, 110, 80, 104, 84, 39, 26, 43,
+        ],
+        [
+            75, 226, 94, 205, 107, 248, 174, 164, 95, 115, 20, 62, 241, 202, 80, 182, 248, 213,
+            115, 216, 142, 165, 182, 8, 151, 156, 170, 110, 219, 237, 63, 3,
+        ],
+        [
+            49, 234, 64, 230, 146, 237, 191, 49, 112, 45, 60, 43, 252, 216, 195, 70, 153, 146, 225,
+            144, 9, 226, 23, 158, 136, 113, 247, 108, 62, 144, 108, 9,
+        ],
+        [
+            103, 21, 127, 107, 59, 109, 133, 160, 143, 88, 92, 94, 63, 60, 176, 30, 201, 130, 24,
+            59, 22, 197, 68, 223, 207, 57, 45, 122, 91, 202, 196, 35,
+        ],
+        [
+            52, 102, 244, 254, 244, 16, 81, 190, 173, 244, 154, 38, 64, 214, 63, 97, 169, 9, 167,
+            51, 246, 33, 109, 247, 50, 220, 114, 64, 13, 179, 177, 30,
+        ],
+        [
+            144, 221, 225, 200, 23, 166, 32, 166, 176, 75, 198, 254, 19, 193, 245, 128, 7, 12, 208,
+            85, 254, 120, 147, 143, 63, 184, 236, 60, 26, 253, 251, 35,
+        ],
+    ],
+    [
+        [
+            75, 83, 105, 13, 6, 123, 42, 108, 212, 123, 233, 193, 139, 45, 132, 88, 44, 242, 39,
+            25, 1, 235, 41, 93, 161, 218, 156, 90, 105, 43, 114, 46,
+        ],
+        [
+            113, 216, 156, 147, 163, 145, 14, 155, 250, 78, 89, 11, 16, 228, 91, 223, 129, 87, 8,
+            161, 204, 28, 0, 75, 59, 172, 225, 121, 76, 165, 42, 36,
+        ],
+        [
+            195, 34, 156, 131, 184, 36, 15, 228, 23, 198, 79, 88, 138, 166, 168, 21, 16, 35, 82,
+            123, 87, 247, 59, 42, 195, 113, 128, 240, 223, 247, 79, 25,
+        ],
+        [
+            197, 57, 189, 78, 132, 12, 150, 148, 108, 113, 199, 232, 67, 154, 65, 201, 151, 136,
+            175, 146, 0, 126, 215, 68, 183, 100, 207, 132, 39, 238, 74, 28,
+        ],
+        [
+            213, 35, 155, 170, 77, 61, 206, 127, 232, 164, 11, 133, 55, 141, 203, 73, 112, 37, 27,
+            8, 250, 18, 169, 233, 171, 174, 218, 9, 15, 227, 192, 24,
+        ],
+        [
+            134, 99, 90, 204, 109, 34, 78, 239, 97, 108, 119, 18, 165, 166, 98, 20, 155, 15, 193,
+            71, 34, 134, 45, 232, 229, 4, 167, 6, 75, 99, 2, 54,
+        ],
+        [
+            4, 136, 7, 177, 132, 128, 188, 128, 221, 121, 213, 198, 133, 42, 219, 156, 145, 179,
+            35, 254, 88, 233, 96, 90, 206, 150, 181, 191, 254, 218, 217, 31,
+        ],
+        [
+            183, 202, 252, 66, 36, 234, 250, 116, 96, 15, 72, 88, 124, 136, 8, 156, 204, 151, 89,
+            171, 185, 139, 47, 215, 117, 207, 44, 117, 226, 84, 248, 5,
+        ],
+    ],
+    [
+        [
+            48, 78, 243, 80, 211, 5, 172, 75, 113, 98, 154, 247, 185, 52, 36, 155, 5, 244, 149, 7,
+            84, 162, 39, 0, 233, 219, 188, 229, 84, 18, 154, 34,
+        ],
+        [
+            135, 176, 3, 156, 231, 35, 196, 24, 109, 104, 169, 210, 121, 247, 72, 214, 141, 15,
+            155, 221, 249, 30, 196, 117, 108, 229, 219, 116, 233, 89, 208, 61,
+        ],
+        [
+            108, 238, 126, 36, 119, 110, 54, 206, 165, 24, 218, 88, 206, 201, 226, 190, 28, 76,
+            125, 62, 87, 21, 15, 158, 2, 233, 41, 18, 242, 223, 192, 6,
+        ],
+        [
+            169, 95, 111, 93, 78, 167, 161, 2, 54, 29, 206, 209, 119, 196, 7, 36, 248, 233, 68, 45,
+            243, 58, 155, 147, 32, 175, 221, 168, 144, 79, 126, 18,
+        ],
+        [
+            229, 0, 65, 205, 148, 179, 229, 116, 253, 143, 119, 111, 142, 63, 235, 124, 140, 243,
+            182, 164, 15, 57, 219, 23, 114, 237, 116, 213, 200, 235, 227, 55,
+        ],
+        [
+            9, 233, 193, 136, 60, 112, 74, 107, 87, 12, 113, 20, 8, 8, 94, 195, 227, 83, 178, 77,
+            143, 104, 211, 169, 253, 62, 8, 196, 81, 39, 96, 13,
+        ],
+        [
+            223, 12, 147, 224, 113, 27, 48, 142, 243, 199, 244, 62, 255, 20, 63, 79, 12, 37, 159,
+            81, 80, 172, 136, 23, 107, 186, 180, 33, 148, 49, 128, 10,
+        ],
+        [
+            100, 248, 42, 239, 155, 107, 80, 255, 126, 96, 195, 152, 204, 166, 14, 46, 114, 152,
+            200, 111, 94, 233, 117, 247, 89, 83, 34, 2, 189, 3, 245, 4,
+        ],
+    ],
+    [
+        [
+            26, 254, 208, 112, 167, 15, 77, 90, 124, 14, 227, 31, 204, 94, 253, 228, 223, 252, 114,
+            141, 234, 26, 108, 144, 115, 131, 19, 142, 25, 148, 80, 53,
+        ],
+        [
+            95, 154, 56, 85, 66, 246, 97, 207, 254, 117, 98, 51, 204, 68, 9, 1, 157, 25, 113, 175,
+            12, 172, 33, 67, 212, 17, 238, 76, 166, 43, 6, 30,
+        ],
+        [
+            48, 204, 33, 34, 141, 223, 27, 151, 244, 225, 206, 129, 54, 211, 251, 18, 168, 186,
+            214, 141, 37, 229, 219, 62, 187, 87, 66, 140, 181, 233, 161, 35,
+        ],
+        [
+            143, 158, 2, 174, 102, 73, 205, 247, 110, 78, 131, 38, 192, 195, 70, 193, 14, 166, 232,
+            42, 142, 222, 35, 147, 189, 77, 50, 220, 23, 56, 126, 38,
+        ],
+        [
+            10, 84, 87, 89, 169, 77, 97, 156, 0, 100, 41, 191, 232, 88, 138, 82, 220, 123, 231, 59,
+            142, 115, 196, 116, 217, 80, 178, 117, 237, 250, 11, 32,
+        ],
+        [
+            152, 88, 228, 103, 64, 4, 197, 110, 204, 4, 0, 131, 250, 205, 206, 83, 180, 179, 98,
+            51, 213, 11, 237, 149, 150, 226, 123, 62, 129, 198, 28, 58,
+        ],
+        [
+            188, 254, 66, 154, 178, 61, 236, 232, 27, 107, 131, 38, 104, 160, 49, 57, 3, 111, 18,
+            106, 158, 91, 57, 220, 174, 59, 138, 227, 176, 49, 171, 15,
+        ],
+        [
+            92, 116, 148, 172, 212, 215, 137, 153, 48, 241, 40, 25, 45, 204, 141, 58, 235, 146,
+            155, 248, 50, 112, 4, 206, 228, 70, 94, 117, 128, 150, 213, 18,
+        ],
+    ],
+    [
+        [
+            155, 96, 199, 129, 161, 131, 9, 109, 43, 95, 79, 108, 230, 168, 172, 51, 244, 183, 203,
+            211, 198, 95, 64, 184, 12, 184, 190, 250, 108, 77, 202, 61,
+        ],
+        [
+            151, 114, 132, 115, 19, 130, 213, 126, 140, 64, 58, 149, 171, 26, 245, 47, 253, 9, 212,
+            80, 154, 3, 206, 254, 158, 241, 87, 90, 67, 8, 29, 59,
+        ],
+        [
+            231, 100, 245, 101, 53, 146, 235, 219, 228, 106, 101, 51, 85, 110, 51, 78, 221, 149,
+            223, 78, 184, 47, 144, 234, 161, 28, 6, 48, 41, 228, 253, 57,
+        ],
+        [
+            239, 82, 160, 74, 136, 231, 198, 194, 99, 192, 170, 182, 36, 125, 149, 58, 9, 239, 91,
+            146, 54, 104, 94, 42, 147, 4, 61, 79, 185, 11, 51, 1,
+        ],
+        [
+            56, 89, 137, 88, 196, 32, 115, 15, 6, 53, 123, 43, 42, 27, 226, 220, 196, 131, 211,
+            126, 14, 174, 191, 229, 172, 6, 210, 189, 92, 66, 79, 26,
+        ],
+        [
+            236, 153, 243, 131, 143, 123, 164, 95, 214, 160, 21, 150, 12, 71, 118, 170, 92, 166,
+            223, 162, 133, 58, 93, 2, 31, 57, 197, 190, 66, 169, 112, 18,
+        ],
+        [
+            137, 13, 132, 54, 102, 120, 119, 177, 34, 217, 123, 89, 76, 242, 218, 72, 236, 129, 33,
+            42, 148, 242, 221, 33, 252, 74, 219, 142, 25, 82, 162, 62,
+        ],
+        [
+            0, 132, 243, 70, 85, 72, 216, 242, 225, 170, 56, 212, 52, 143, 154, 202, 248, 33, 148,
+            236, 117, 24, 29, 63, 148, 233, 28, 74, 59, 44, 221, 6,
+        ],
+    ],
+    [
+        [
+            122, 45, 241, 68, 72, 20, 58, 84, 181, 215, 45, 12, 74, 54, 17, 144, 144, 97, 82, 103,
+            81, 123, 158, 238, 167, 173, 212, 8, 90, 63, 188, 59,
+        ],
+        [
+            190, 69, 211, 175, 56, 60, 42, 23, 208, 231, 241, 96, 205, 55, 222, 210, 178, 240, 230,
+            118, 210, 253, 59, 206, 104, 165, 221, 249, 237, 74, 42, 33,
+        ],
+        [
+            69, 202, 255, 56, 181, 188, 225, 92, 19, 165, 74, 192, 67, 249, 139, 35, 87, 125, 27,
+            228, 61, 78, 56, 144, 42, 255, 159, 217, 53, 99, 10, 62,
+        ],
+        [
+            17, 213, 190, 3, 139, 251, 81, 49, 133, 14, 185, 61, 240, 132, 117, 99, 240, 125, 104,
+            191, 248, 27, 77, 11, 130, 122, 237, 184, 35, 100, 180, 3,
+        ],
+        [
+            236, 29, 195, 209, 34, 84, 144, 163, 206, 89, 168, 108, 27, 11, 70, 115, 204, 213, 254,
+            154, 127, 24, 198, 242, 246, 223, 181, 250, 165, 119, 22, 62,
+        ],
+        [
+            60, 247, 191, 168, 239, 211, 60, 148, 241, 31, 18, 170, 16, 159, 36, 114, 42, 255, 166,
+            224, 203, 137, 29, 159, 207, 121, 83, 18, 65, 177, 147, 58,
+        ],
+        [
+            142, 74, 131, 209, 60, 216, 199, 80, 41, 112, 74, 182, 191, 182, 44, 195, 255, 209,
+            212, 108, 139, 121, 174, 211, 221, 158, 186, 94, 7, 171, 195, 6,
+        ],
+        [
+            198, 195, 122, 214, 128, 112, 1, 64, 196, 79, 62, 9, 3, 224, 192, 175, 23, 151, 79,
+            177, 86, 124, 241, 131, 111, 212, 44, 236, 166, 31, 192, 15,
+        ],
+    ],
+    [
+        [
+            50, 31, 67, 146, 113, 240, 176, 252, 99, 195, 220, 195, 236, 33, 235, 44, 22, 161, 130,
+            84, 214, 230, 9, 201, 254, 31, 226, 194, 208, 156, 234, 31,
+        ],
+        [
+            130, 252, 165, 204, 53, 14, 76, 171, 205, 52, 8, 140, 156, 25, 1, 79, 106, 128, 120,
+            230, 96, 4, 65, 143, 120, 86, 95, 116, 178, 151, 251, 21,
+        ],
+        [
+            82, 176, 110, 60, 13, 107, 15, 237, 57, 201, 226, 28, 131, 232, 139, 0, 26, 117, 17,
+            21, 90, 52, 206, 160, 31, 184, 67, 211, 119, 126, 23, 2,
+        ],
+        [
+            86, 78, 25, 205, 17, 108, 177, 47, 226, 5, 14, 124, 217, 100, 164, 146, 67, 56, 65,
+            155, 54, 2, 97, 66, 248, 244, 46, 71, 35, 246, 90, 35,
+        ],
+        [
+            28, 122, 89, 60, 230, 19, 230, 132, 129, 117, 243, 172, 180, 95, 210, 183, 231, 73,
+            194, 50, 123, 93, 40, 116, 179, 64, 48, 127, 37, 161, 133, 1,
+        ],
+        [
+            72, 176, 170, 234, 97, 26, 154, 13, 139, 23, 69, 194, 241, 59, 143, 29, 131, 72, 236,
+            123, 90, 116, 132, 207, 226, 63, 190, 11, 9, 159, 225, 18,
+        ],
+        [
+            71, 3, 178, 208, 101, 43, 142, 1, 34, 183, 67, 144, 188, 255, 243, 77, 160, 17, 3, 90,
+            104, 102, 15, 237, 159, 17, 119, 223, 119, 180, 184, 11,
+        ],
+        [
+            198, 247, 138, 113, 71, 170, 58, 158, 166, 18, 216, 133, 230, 166, 87, 243, 180, 129,
+            59, 227, 21, 156, 206, 171, 200, 29, 193, 191, 35, 144, 110, 35,
+        ],
+    ],
+    [
+        [
+            143, 29, 76, 191, 243, 57, 156, 88, 188, 187, 113, 179, 47, 12, 12, 80, 210, 133, 232,
+            199, 196, 174, 105, 166, 185, 201, 72, 33, 182, 107, 10, 14,
+        ],
+        [
+            164, 93, 48, 22, 226, 133, 56, 19, 13, 143, 250, 49, 96, 151, 50, 136, 186, 199, 102,
+            135, 44, 77, 221, 203, 66, 145, 199, 234, 71, 151, 237, 60,
+        ],
+        [
+            40, 169, 150, 23, 171, 18, 88, 233, 196, 71, 216, 65, 86, 136, 191, 225, 157, 148, 204,
+            166, 81, 32, 185, 159, 33, 211, 227, 110, 49, 200, 239, 6,
+        ],
+        [
+            177, 51, 226, 132, 191, 36, 206, 168, 107, 159, 196, 253, 111, 164, 203, 30, 229, 157,
+            238, 168, 231, 1, 231, 132, 124, 170, 113, 72, 205, 71, 179, 61,
+        ],
+        [
+            173, 21, 156, 246, 171, 56, 11, 126, 227, 206, 228, 132, 13, 35, 56, 214, 167, 169,
+            199, 247, 183, 237, 175, 164, 56, 38, 12, 149, 16, 165, 206, 41,
+        ],
+        [
+            128, 227, 45, 193, 60, 153, 0, 6, 8, 102, 44, 127, 61, 224, 183, 230, 212, 141, 1, 51,
+            225, 100, 204, 170, 122, 148, 93, 219, 56, 143, 127, 14,
+        ],
+        [
+            70, 116, 18, 220, 241, 134, 196, 152, 34, 203, 160, 47, 133, 155, 48, 238, 3, 231, 142,
+            250, 130, 80, 127, 29, 47, 30, 247, 166, 7, 84, 97, 32,
+        ],
+        [
+            198, 120, 45, 251, 227, 181, 90, 244, 88, 96, 139, 170, 238, 2, 214, 157, 142, 252, 38,
+            70, 46, 231, 140, 254, 133, 163, 174, 239, 236, 31, 248, 47,
+        ],
+    ],
+    [
+        [
+            55, 136, 210, 179, 46, 105, 249, 203, 6, 77, 242, 11, 176, 133, 40, 140, 94, 213, 221,
+            116, 54, 114, 154, 208, 221, 104, 34, 129, 102, 30, 159, 58,
+        ],
+        [
+            79, 251, 68, 141, 49, 255, 119, 149, 245, 56, 33, 15, 177, 119, 71, 34, 2, 157, 154,
+            100, 0, 130, 254, 89, 119, 244, 255, 136, 145, 170, 75, 22,
+        ],
+        [
+            246, 138, 15, 233, 177, 157, 214, 220, 249, 137, 175, 49, 64, 49, 163, 203, 16, 5, 156,
+            137, 236, 177, 51, 237, 183, 248, 106, 64, 95, 201, 63, 60,
+        ],
+        [
+            169, 216, 126, 241, 88, 115, 61, 5, 60, 196, 46, 248, 192, 24, 133, 247, 107, 35, 176,
+            62, 3, 251, 187, 51, 131, 108, 26, 58, 71, 173, 69, 50,
+        ],
+        [
+            84, 151, 140, 102, 38, 240, 56, 110, 112, 245, 122, 78, 225, 149, 139, 150, 7, 90, 124,
+            202, 208, 243, 85, 76, 216, 157, 7, 245, 29, 230, 202, 57,
+        ],
+        [
+            151, 205, 82, 162, 218, 18, 210, 30, 96, 49, 203, 180, 161, 163, 135, 58, 156, 223,
+            248, 97, 155, 19, 244, 20, 204, 201, 109, 159, 51, 166, 157, 53,
+        ],
+        [
+            12, 187, 38, 15, 49, 56, 192, 212, 23, 177, 153, 244, 192, 65, 217, 112, 210, 82, 187,
+            254, 42, 203, 172, 84, 39, 84, 171, 8, 145, 13, 6, 50,
+        ],
+        [
+            61, 241, 209, 199, 182, 87, 14, 9, 24, 44, 194, 13, 4, 85, 186, 9, 120, 82, 120, 0,
+            167, 113, 231, 252, 218, 210, 112, 246, 163, 9, 247, 30,
+        ],
+    ],
+    [
+        [
+            196, 38, 105, 221, 18, 136, 108, 66, 223, 180, 237, 185, 161, 102, 180, 224, 164, 195,
+            0, 254, 210, 238, 158, 146, 253, 119, 73, 191, 148, 17, 152, 50,
+        ],
+        [
+            76, 130, 205, 97, 172, 181, 61, 253, 66, 7, 37, 249, 147, 121, 205, 101, 67, 50, 84,
+            125, 60, 49, 65, 55, 48, 130, 37, 86, 92, 89, 181, 35,
+        ],
+        [
+            206, 105, 119, 230, 215, 16, 15, 177, 186, 198, 98, 203, 210, 114, 246, 76, 112, 132,
+            63, 157, 216, 253, 212, 195, 36, 11, 58, 200, 70, 165, 187, 21,
+        ],
+        [
+            95, 85, 152, 202, 120, 158, 2, 113, 140, 9, 152, 197, 28, 23, 243, 98, 30, 116, 241,
+            59, 150, 179, 40, 13, 119, 61, 108, 115, 88, 216, 66, 62,
+        ],
+        [
+            108, 254, 117, 155, 108, 68, 3, 230, 25, 36, 106, 204, 158, 15, 114, 204, 134, 182,
+            239, 235, 104, 144, 35, 31, 84, 246, 38, 252, 87, 60, 20, 12,
+        ],
+        [
+            14, 76, 210, 134, 98, 224, 219, 180, 88, 134, 93, 30, 34, 159, 112, 85, 114, 46, 244,
+            59, 169, 188, 235, 108, 254, 236, 101, 86, 97, 132, 255, 62,
+        ],
+        [
+            23, 167, 12, 59, 95, 158, 244, 22, 231, 148, 247, 162, 226, 95, 136, 77, 62, 234, 119,
+            179, 29, 62, 160, 116, 94, 240, 7, 113, 75, 241, 201, 62,
+        ],
+        [
+            233, 142, 117, 40, 158, 166, 10, 78, 255, 44, 235, 32, 185, 102, 244, 23, 251, 127, 12,
+            249, 120, 18, 196, 115, 151, 251, 236, 217, 97, 244, 107, 52,
+        ],
+    ],
+    [
+        [
+            107, 155, 149, 167, 240, 119, 46, 213, 7, 178, 44, 247, 191, 163, 247, 255, 109, 160,
+            87, 134, 236, 13, 49, 223, 245, 64, 194, 243, 220, 166, 203, 59,
+        ],
+        [
+            119, 76, 9, 136, 64, 42, 217, 106, 111, 151, 245, 107, 101, 191, 56, 195, 239, 79, 134,
+            239, 31, 37, 60, 160, 131, 101, 90, 38, 70, 213, 103, 5,
+        ],
+        [
+            184, 158, 152, 93, 132, 93, 66, 54, 106, 79, 134, 202, 210, 72, 74, 25, 96, 93, 178,
+            109, 231, 248, 173, 100, 154, 238, 170, 161, 194, 75, 148, 35,
+        ],
+        [
+            156, 17, 84, 74, 233, 248, 203, 84, 127, 132, 30, 245, 52, 4, 27, 53, 231, 22, 75, 33,
+            66, 120, 175, 149, 77, 114, 237, 18, 99, 189, 126, 31,
+        ],
+        [
+            78, 144, 141, 232, 241, 133, 132, 75, 214, 189, 122, 225, 96, 155, 59, 205, 144, 243,
+            176, 140, 253, 16, 152, 59, 80, 164, 165, 153, 15, 89, 219, 50,
+        ],
+        [
+            62, 16, 233, 111, 18, 125, 232, 184, 252, 2, 110, 148, 127, 176, 119, 162, 66, 211,
+            198, 136, 64, 217, 189, 197, 121, 66, 32, 71, 147, 13, 146, 8,
+        ],
+        [
+            2, 45, 226, 216, 24, 120, 51, 196, 19, 16, 152, 7, 178, 30, 88, 194, 255, 186, 231, 81,
+            217, 67, 36, 199, 41, 12, 135, 142, 160, 247, 199, 34,
+        ],
+        [
+            80, 193, 196, 122, 181, 155, 245, 75, 185, 218, 222, 58, 140, 110, 234, 148, 30, 19,
+            243, 175, 188, 1, 57, 85, 163, 253, 211, 210, 200, 7, 249, 43,
+        ],
+    ],
+    [
+        [
+            187, 240, 200, 140, 119, 234, 17, 25, 208, 192, 198, 107, 40, 102, 42, 212, 229, 1,
+            231, 121, 19, 35, 249, 226, 185, 185, 225, 179, 84, 18, 191, 15,
+        ],
+        [
+            249, 21, 206, 133, 57, 77, 143, 126, 192, 252, 36, 62, 173, 16, 52, 11, 7, 198, 149,
+            220, 48, 193, 40, 253, 217, 235, 145, 96, 241, 215, 193, 16,
+        ],
+        [
+            203, 97, 200, 83, 165, 80, 108, 220, 108, 185, 123, 227, 143, 247, 12, 200, 9, 195, 68,
+            46, 238, 32, 161, 42, 247, 167, 117, 159, 191, 89, 194, 21,
+        ],
+        [
+            200, 138, 253, 89, 202, 154, 62, 252, 110, 107, 99, 189, 49, 33, 69, 220, 211, 185, 89,
+            62, 101, 231, 203, 68, 45, 5, 73, 39, 144, 230, 186, 43,
+        ],
+        [
+            31, 42, 63, 181, 31, 131, 126, 192, 52, 179, 2, 178, 71, 193, 225, 189, 52, 153, 62,
+            166, 207, 192, 10, 174, 67, 228, 150, 28, 169, 63, 242, 60,
+        ],
+        [
+            228, 40, 179, 0, 71, 223, 234, 22, 20, 72, 239, 146, 142, 7, 168, 47, 102, 186, 137,
+            113, 248, 114, 204, 153, 12, 22, 145, 205, 143, 109, 169, 3,
+        ],
+        [
+            232, 227, 9, 11, 117, 128, 157, 126, 209, 210, 249, 174, 93, 37, 76, 150, 114, 36, 225,
+            75, 198, 10, 191, 167, 6, 2, 244, 29, 191, 7, 21, 44,
+        ],
+        [
+            86, 226, 203, 210, 152, 57, 49, 226, 171, 172, 86, 225, 126, 215, 249, 166, 100, 119,
+            54, 180, 193, 199, 146, 147, 253, 16, 107, 16, 22, 21, 106, 31,
+        ],
+    ],
+    [
+        [
+            249, 155, 151, 211, 192, 36, 207, 21, 36, 141, 169, 175, 223, 248, 235, 62, 161, 214,
+            236, 25, 35, 202, 64, 158, 84, 97, 121, 1, 190, 142, 23, 56,
+        ],
+        [
+            79, 129, 15, 128, 17, 234, 8, 173, 53, 238, 129, 60, 40, 6, 33, 216, 0, 171, 82, 80,
+            227, 3, 219, 184, 48, 231, 244, 213, 115, 224, 162, 49,
+        ],
+        [
+            246, 219, 42, 28, 42, 134, 38, 100, 60, 131, 51, 159, 148, 5, 219, 203, 159, 51, 175,
+            176, 154, 20, 79, 168, 197, 140, 200, 98, 192, 113, 179, 48,
+        ],
+        [
+            87, 7, 235, 9, 102, 19, 100, 91, 214, 230, 74, 213, 117, 120, 7, 239, 137, 255, 158,
+            243, 160, 169, 30, 105, 28, 72, 188, 245, 76, 187, 227, 46,
+        ],
+        [
+            158, 245, 74, 150, 32, 197, 25, 173, 237, 231, 201, 44, 210, 117, 134, 203, 75, 108,
+            102, 63, 124, 33, 47, 100, 56, 65, 129, 102, 161, 211, 117, 22,
+        ],
+        [
+            204, 70, 46, 194, 74, 212, 80, 20, 239, 11, 98, 124, 117, 38, 63, 246, 222, 191, 44,
+            185, 131, 146, 129, 92, 158, 2, 87, 240, 150, 133, 57, 19,
+        ],
+        [
+            236, 136, 27, 147, 102, 12, 170, 62, 254, 16, 6, 217, 27, 178, 115, 247, 60, 158, 45,
+            219, 224, 99, 111, 154, 253, 46, 247, 200, 138, 156, 26, 26,
+        ],
+        [
+            75, 211, 65, 63, 194, 212, 191, 3, 100, 173, 100, 101, 62, 25, 72, 147, 13, 148, 111,
+            14, 157, 82, 27, 241, 125, 154, 243, 137, 14, 135, 241, 26,
+        ],
+    ],
+    [
+        [
+            218, 202, 124, 110, 86, 218, 195, 2, 64, 68, 69, 220, 16, 26, 0, 40, 224, 238, 59, 69,
+            246, 226, 3, 27, 219, 85, 17, 245, 133, 220, 230, 63,
+        ],
+        [
+            212, 226, 110, 162, 36, 55, 75, 198, 129, 197, 158, 79, 126, 204, 159, 71, 33, 60, 121,
+            48, 127, 147, 250, 124, 60, 87, 179, 173, 160, 204, 32, 53,
+        ],
+        [
+            137, 110, 13, 7, 108, 200, 154, 204, 18, 86, 44, 221, 40, 171, 207, 5, 25, 42, 108, 2,
+            147, 18, 42, 89, 101, 50, 48, 7, 233, 123, 235, 8,
+        ],
+        [
+            206, 247, 190, 175, 201, 90, 146, 123, 203, 83, 104, 46, 243, 131, 105, 131, 39, 186,
+            205, 103, 203, 204, 186, 196, 251, 101, 101, 250, 186, 160, 211, 12,
+        ],
+        [
+            237, 149, 65, 13, 108, 153, 242, 14, 61, 62, 156, 46, 128, 126, 158, 246, 226, 128,
+            243, 193, 10, 165, 120, 64, 72, 91, 32, 215, 90, 235, 82, 24,
+        ],
+        [
+            185, 204, 139, 200, 5, 172, 176, 126, 105, 190, 243, 150, 126, 26, 28, 74, 143, 149,
+            118, 82, 210, 254, 70, 30, 81, 23, 128, 89, 255, 171, 137, 63,
+        ],
+        [
+            169, 75, 113, 101, 245, 119, 251, 230, 244, 201, 79, 85, 164, 86, 81, 155, 57, 44, 203,
+            143, 173, 62, 78, 180, 1, 48, 216, 129, 223, 34, 105, 33,
+        ],
+        [
+            71, 92, 139, 39, 87, 72, 88, 2, 1, 5, 154, 14, 244, 138, 253, 116, 113, 203, 7, 174,
+            49, 216, 88, 94, 233, 251, 220, 17, 19, 62, 142, 41,
+        ],
+    ],
+    [
+        [
+            61, 222, 98, 187, 178, 246, 136, 235, 234, 162, 29, 132, 16, 87, 58, 249, 140, 210, 62,
+            204, 34, 166, 135, 164, 118, 21, 181, 46, 215, 232, 234, 41,
+        ],
+        [
+            108, 124, 187, 66, 180, 167, 233, 17, 56, 166, 172, 61, 198, 167, 53, 66, 58, 24, 86,
+            29, 24, 30, 59, 213, 140, 66, 162, 145, 212, 204, 115, 25,
+        ],
+        [
+            126, 189, 246, 53, 52, 94, 147, 57, 67, 135, 51, 106, 225, 56, 234, 69, 109, 0, 84, 85,
+            158, 111, 234, 117, 134, 231, 202, 117, 69, 62, 231, 62,
+        ],
+        [
+            180, 135, 221, 126, 92, 15, 183, 27, 71, 155, 203, 35, 217, 20, 196, 191, 166, 148, 12,
+            90, 70, 8, 55, 187, 227, 234, 199, 6, 170, 31, 164, 35,
+        ],
+        [
+            127, 229, 190, 196, 138, 191, 99, 200, 2, 94, 33, 220, 198, 94, 247, 56, 92, 235, 5,
+            231, 0, 215, 115, 237, 123, 128, 163, 62, 245, 136, 81, 22,
+        ],
+        [
+            227, 192, 203, 190, 191, 238, 65, 46, 225, 246, 98, 119, 248, 140, 53, 18, 29, 161, 15,
+            186, 236, 103, 170, 73, 194, 235, 181, 196, 130, 245, 221, 13,
+        ],
+        [
+            64, 205, 137, 125, 6, 95, 1, 144, 47, 13, 117, 175, 2, 2, 233, 104, 21, 195, 159, 219,
+            27, 30, 12, 229, 218, 26, 207, 101, 32, 16, 167, 2,
+        ],
+        [
+            34, 165, 74, 35, 215, 50, 17, 254, 127, 186, 142, 239, 125, 1, 238, 118, 184, 35, 133,
+            15, 46, 87, 123, 153, 143, 75, 66, 12, 100, 48, 121, 48,
+        ],
+    ],
+    [
+        [
+            214, 114, 165, 15, 16, 78, 181, 140, 200, 65, 29, 172, 151, 153, 42, 42, 237, 0, 16,
+            125, 100, 98, 184, 223, 117, 20, 178, 157, 216, 44, 213, 15,
+        ],
+        [
+            132, 159, 1, 46, 5, 227, 173, 110, 40, 63, 114, 61, 174, 128, 176, 65, 210, 40, 113,
+            98, 56, 97, 31, 79, 27, 108, 73, 89, 187, 91, 212, 56,
+        ],
+        [
+            172, 60, 113, 153, 79, 201, 88, 244, 49, 183, 22, 155, 50, 177, 233, 114, 239, 171, 11,
+            254, 167, 190, 175, 168, 186, 77, 225, 135, 173, 40, 55, 48,
+        ],
+        [
+            125, 213, 133, 173, 206, 217, 164, 129, 242, 146, 105, 114, 154, 236, 10, 141, 30, 90,
+            218, 141, 173, 47, 144, 222, 136, 142, 38, 52, 26, 23, 14, 60,
+        ],
+        [
+            139, 80, 72, 222, 254, 102, 93, 93, 171, 176, 185, 71, 208, 45, 194, 155, 138, 10, 119,
+            216, 70, 65, 186, 101, 170, 173, 40, 248, 151, 68, 36, 2,
+        ],
+        [
+            217, 169, 205, 250, 22, 76, 171, 72, 234, 51, 110, 48, 151, 167, 126, 164, 6, 208, 212,
+            219, 0, 239, 167, 53, 192, 217, 172, 45, 11, 255, 36, 8,
+        ],
+        [
+            185, 240, 107, 188, 203, 252, 145, 109, 83, 50, 19, 103, 221, 108, 214, 191, 76, 193,
+            213, 76, 178, 238, 191, 96, 148, 240, 145, 197, 57, 223, 91, 38,
+        ],
+        [
+            135, 117, 125, 1, 188, 32, 35, 122, 175, 114, 34, 107, 83, 189, 14, 252, 187, 207, 56,
+            81, 179, 150, 83, 169, 41, 7, 153, 219, 41, 249, 137, 36,
+        ],
+    ],
+    [
+        [
+            130, 161, 187, 43, 82, 167, 198, 157, 80, 21, 74, 98, 249, 108, 140, 91, 167, 175, 83,
+            166, 160, 83, 226, 11, 105, 178, 43, 93, 152, 98, 39, 60,
+        ],
+        [
+            103, 60, 46, 185, 126, 175, 11, 242, 101, 195, 88, 74, 137, 157, 7, 133, 136, 190, 182,
+            15, 95, 81, 82, 60, 238, 203, 94, 197, 58, 235, 78, 26,
+        ],
+        [
+            125, 109, 188, 77, 254, 92, 214, 193, 55, 226, 214, 209, 14, 61, 76, 62, 1, 184, 215,
+            234, 137, 221, 36, 165, 14, 51, 144, 85, 103, 230, 139, 54,
+        ],
+        [
+            31, 80, 113, 254, 151, 75, 72, 118, 184, 169, 88, 45, 176, 244, 185, 244, 116, 20, 254,
+            25, 46, 209, 230, 101, 108, 212, 145, 109, 19, 203, 52, 23,
+        ],
+        [
+            223, 26, 38, 148, 184, 152, 184, 143, 7, 88, 24, 23, 10, 222, 186, 75, 235, 47, 152,
+            166, 150, 194, 251, 172, 244, 48, 213, 91, 185, 90, 135, 6,
+        ],
+        [
+            49, 201, 141, 151, 38, 161, 147, 187, 9, 184, 151, 218, 50, 193, 207, 31, 125, 243, 44,
+            73, 133, 109, 219, 122, 48, 232, 143, 23, 243, 253, 230, 4,
+        ],
+        [
+            226, 81, 244, 145, 117, 92, 163, 152, 234, 27, 48, 188, 216, 35, 238, 160, 132, 170,
+            116, 231, 72, 202, 3, 185, 230, 77, 245, 56, 30, 214, 138, 48,
+        ],
+        [
+            203, 71, 145, 89, 101, 217, 131, 63, 86, 163, 54, 136, 121, 122, 155, 211, 113, 235,
+            21, 121, 67, 53, 217, 167, 76, 158, 51, 115, 145, 91, 31, 17,
+        ],
+    ],
+    [
+        [
+            163, 118, 62, 49, 37, 114, 17, 221, 161, 123, 183, 175, 99, 19, 182, 11, 127, 236, 183,
+            255, 144, 45, 151, 179, 76, 158, 3, 244, 18, 197, 192, 15,
+        ],
+        [
+            161, 140, 144, 70, 95, 191, 18, 250, 95, 202, 117, 12, 81, 145, 232, 37, 148, 192, 220,
+            126, 52, 144, 121, 51, 101, 197, 209, 187, 62, 95, 123, 6,
+        ],
+        [
+            218, 235, 88, 200, 137, 249, 88, 23, 9, 21, 41, 221, 173, 222, 183, 202, 244, 51, 59,
+            81, 157, 46, 225, 92, 104, 138, 194, 120, 192, 35, 255, 55,
+        ],
+        [
+            183, 236, 50, 252, 158, 165, 145, 185, 126, 97, 212, 66, 97, 197, 185, 125, 85, 60,
+            239, 123, 147, 234, 128, 46, 113, 127, 136, 143, 12, 160, 244, 14,
+        ],
+        [
+            229, 188, 4, 248, 56, 209, 163, 222, 126, 202, 169, 221, 208, 239, 56, 204, 25, 214,
+            222, 140, 83, 2, 164, 52, 212, 80, 104, 109, 32, 204, 13, 39,
+        ],
+        [
+            124, 94, 218, 55, 16, 89, 156, 202, 79, 167, 11, 70, 95, 50, 198, 187, 51, 105, 69, 76,
+            83, 72, 44, 143, 64, 60, 19, 14, 192, 196, 80, 27,
+        ],
+        [
+            97, 209, 31, 19, 192, 81, 91, 247, 188, 17, 0, 21, 75, 229, 246, 158, 136, 76, 210,
+            207, 249, 143, 152, 221, 229, 242, 59, 114, 206, 95, 96, 47,
+        ],
+        [
+            11, 206, 70, 250, 78, 150, 63, 79, 249, 28, 67, 124, 107, 222, 13, 23, 17, 68, 53, 122,
+            184, 139, 37, 94, 6, 39, 35, 160, 66, 221, 110, 57,
+        ],
+    ],
+    [
+        [
+            223, 134, 239, 176, 66, 205, 170, 212, 138, 20, 104, 236, 148, 255, 100, 186, 129, 240,
+            197, 226, 26, 15, 254, 102, 80, 192, 154, 239, 139, 23, 121, 63,
+        ],
+        [
+            5, 119, 208, 59, 122, 3, 98, 77, 4, 190, 57, 200, 218, 45, 203, 72, 213, 82, 131, 107,
+            169, 215, 115, 204, 1, 224, 230, 159, 198, 109, 107, 54,
+        ],
+        [
+            104, 158, 197, 37, 221, 147, 75, 28, 103, 145, 43, 10, 92, 236, 156, 128, 161, 166, 38,
+            21, 61, 23, 31, 28, 253, 61, 17, 246, 189, 252, 175, 43,
+        ],
+        [
+            24, 105, 76, 61, 63, 75, 50, 76, 51, 192, 208, 63, 88, 229, 128, 119, 220, 237, 199,
+            84, 244, 89, 108, 230, 177, 251, 241, 178, 198, 176, 83, 21,
+        ],
+        [
+            95, 224, 156, 151, 85, 5, 100, 100, 241, 158, 113, 178, 102, 190, 76, 193, 236, 80,
+            137, 95, 138, 94, 146, 3, 76, 157, 86, 102, 237, 20, 176, 63,
+        ],
+        [
+            135, 94, 202, 65, 67, 250, 57, 207, 182, 240, 92, 3, 232, 237, 207, 226, 96, 251, 5,
+            14, 56, 84, 221, 45, 50, 21, 23, 38, 125, 141, 125, 33,
+        ],
+        [
+            1, 250, 154, 59, 193, 213, 14, 252, 103, 49, 176, 144, 111, 21, 26, 187, 8, 115, 236,
+            31, 221, 198, 37, 92, 194, 32, 42, 236, 140, 108, 35, 39,
+        ],
+        [
+            103, 78, 38, 12, 33, 172, 47, 58, 164, 230, 77, 235, 219, 159, 138, 135, 17, 66, 215,
+            244, 183, 189, 78, 154, 114, 85, 131, 71, 221, 132, 206, 51,
+        ],
+    ],
+    [
+        [
+            74, 237, 137, 138, 7, 144, 141, 134, 245, 201, 75, 46, 40, 46, 38, 183, 163, 73, 201,
+            165, 151, 236, 247, 214, 6, 44, 36, 27, 225, 75, 97, 48,
+        ],
+        [
+            38, 39, 238, 243, 197, 119, 161, 224, 249, 104, 44, 35, 221, 140, 86, 236, 9, 96, 12,
+            2, 73, 135, 165, 30, 67, 208, 15, 210, 52, 18, 118, 6,
+        ],
+        [
+            143, 224, 93, 228, 86, 241, 188, 45, 229, 9, 195, 9, 209, 118, 156, 40, 7, 200, 138,
+            200, 192, 83, 107, 147, 195, 86, 84, 8, 93, 62, 87, 54,
+        ],
+        [
+            212, 96, 74, 248, 166, 217, 63, 214, 37, 93, 202, 74, 239, 98, 42, 253, 228, 212, 156,
+            203, 141, 14, 197, 19, 234, 148, 17, 40, 141, 236, 35, 49,
+        ],
+        [
+            173, 148, 235, 124, 235, 146, 153, 90, 15, 115, 1, 233, 109, 117, 216, 239, 79, 144,
+            231, 37, 188, 189, 78, 29, 133, 26, 176, 109, 177, 234, 202, 59,
+        ],
+        [
+            10, 38, 232, 241, 157, 38, 214, 76, 198, 109, 162, 131, 127, 3, 40, 15, 48, 195, 47,
+            211, 52, 8, 0, 189, 126, 120, 13, 42, 238, 226, 225, 3,
+        ],
+        [
+            243, 73, 44, 63, 255, 180, 74, 70, 135, 143, 219, 51, 6, 159, 80, 154, 210, 51, 241,
+            230, 40, 249, 80, 106, 102, 166, 7, 155, 194, 38, 33, 17,
+        ],
+        [
+            191, 105, 232, 173, 147, 80, 10, 21, 203, 53, 211, 74, 36, 15, 3, 188, 128, 47, 9, 186,
+            83, 202, 36, 81, 138, 63, 148, 167, 137, 35, 147, 19,
+        ],
+    ],
+    [
+        [
+            236, 196, 10, 96, 182, 79, 154, 55, 78, 33, 43, 127, 92, 81, 212, 66, 30, 0, 86, 117,
+            207, 159, 3, 186, 59, 148, 154, 200, 141, 92, 147, 27,
+        ],
+        [
+            225, 90, 178, 233, 102, 159, 82, 225, 166, 129, 39, 34, 244, 250, 228, 100, 134, 200,
+            148, 85, 91, 43, 105, 75, 200, 87, 81, 59, 40, 193, 211, 55,
+        ],
+        [
+            59, 148, 63, 224, 145, 150, 218, 137, 164, 83, 27, 147, 217, 75, 108, 182, 36, 204,
+            121, 133, 12, 8, 235, 64, 128, 244, 34, 13, 9, 72, 63, 28,
+        ],
+        [
+            212, 212, 49, 80, 78, 45, 56, 203, 40, 249, 128, 137, 185, 87, 92, 47, 146, 177, 132,
+            62, 215, 25, 127, 115, 205, 101, 6, 154, 76, 80, 114, 18,
+        ],
+        [
+            176, 192, 244, 210, 165, 138, 232, 75, 159, 72, 99, 239, 121, 37, 50, 114, 181, 220,
+            176, 22, 164, 127, 221, 10, 193, 99, 140, 15, 204, 86, 212, 53,
+        ],
+        [
+            159, 147, 161, 250, 222, 214, 217, 27, 87, 5, 8, 226, 156, 162, 178, 255, 170, 187,
+            200, 161, 26, 195, 99, 180, 246, 102, 210, 123, 107, 242, 173, 35,
+        ],
+        [
+            147, 2, 204, 135, 133, 234, 183, 133, 186, 151, 248, 180, 75, 13, 40, 56, 145, 134,
+            209, 237, 43, 6, 107, 52, 33, 206, 165, 226, 205, 75, 28, 21,
+        ],
+        [
+            30, 67, 172, 233, 205, 173, 245, 113, 133, 159, 28, 77, 133, 209, 85, 173, 163, 43,
+            138, 208, 96, 215, 181, 142, 133, 151, 156, 36, 126, 32, 68, 7,
+        ],
+    ],
+    [
+        [
+            12, 123, 146, 187, 79, 71, 121, 126, 110, 67, 163, 209, 185, 8, 43, 250, 139, 95, 132,
+            9, 141, 123, 120, 25, 113, 59, 253, 85, 72, 170, 199, 27,
+        ],
+        [
+            148, 38, 17, 234, 63, 253, 30, 242, 241, 113, 82, 233, 175, 17, 227, 75, 172, 25, 1,
+            230, 87, 107, 49, 184, 36, 27, 255, 135, 253, 15, 42, 18,
+        ],
+        [
+            57, 122, 227, 248, 85, 40, 238, 252, 56, 46, 59, 209, 214, 24, 129, 169, 59, 35, 169,
+            94, 189, 126, 146, 19, 162, 186, 148, 249, 170, 190, 218, 36,
+        ],
+        [
+            72, 154, 129, 64, 173, 23, 154, 53, 215, 48, 178, 84, 152, 160, 105, 56, 49, 219, 11,
+            6, 196, 221, 55, 85, 72, 129, 149, 148, 178, 165, 20, 61,
+        ],
+        [
+            211, 89, 31, 7, 22, 111, 165, 192, 156, 164, 251, 69, 251, 72, 208, 157, 53, 57, 144,
+            72, 12, 146, 11, 14, 145, 181, 14, 68, 237, 120, 174, 4,
+        ],
+        [
+            18, 115, 60, 134, 217, 114, 253, 177, 223, 163, 10, 83, 103, 37, 178, 69, 3, 78, 164,
+            2, 35, 65, 2, 219, 93, 141, 186, 80, 20, 166, 103, 43,
+        ],
+        [
+            110, 16, 223, 29, 240, 124, 98, 122, 115, 98, 200, 21, 240, 17, 173, 209, 114, 172,
+            198, 226, 17, 201, 34, 247, 39, 15, 246, 75, 212, 48, 39, 11,
+        ],
+        [
+            249, 114, 161, 95, 41, 76, 181, 17, 119, 208, 229, 87, 84, 28, 170, 246, 144, 202, 188,
+            5, 49, 53, 77, 232, 8, 6, 247, 81, 111, 232, 35, 57,
+        ],
+    ],
+    [
+        [
+            166, 191, 70, 138, 155, 151, 236, 84, 96, 249, 99, 236, 45, 137, 97, 90, 167, 20, 174,
+            149, 119, 233, 203, 65, 37, 72, 157, 86, 249, 111, 56, 60,
+        ],
+        [
+            43, 38, 90, 143, 119, 212, 89, 41, 208, 243, 146, 176, 197, 213, 11, 165, 57, 6, 3,
+            139, 45, 156, 142, 42, 177, 203, 207, 69, 121, 180, 159, 39,
+        ],
+        [
+            55, 217, 98, 174, 52, 172, 195, 38, 151, 240, 237, 116, 26, 43, 119, 0, 126, 67, 123,
+            173, 195, 172, 254, 130, 16, 111, 177, 190, 128, 161, 192, 9,
+        ],
+        [
+            73, 205, 70, 151, 40, 112, 216, 117, 3, 99, 187, 10, 34, 53, 109, 94, 0, 225, 52, 200,
+            127, 182, 30, 45, 188, 66, 50, 192, 179, 24, 235, 42,
+        ],
+        [
+            8, 249, 190, 160, 146, 39, 217, 65, 210, 62, 89, 36, 4, 149, 125, 101, 32, 202, 88, 37,
+            16, 29, 219, 53, 204, 32, 1, 228, 3, 121, 6, 21,
+        ],
+        [
+            205, 41, 152, 28, 50, 10, 231, 209, 244, 103, 159, 116, 223, 92, 92, 246, 192, 171, 38,
+            66, 116, 104, 90, 75, 238, 94, 179, 10, 71, 73, 189, 57,
+        ],
+        [
+            28, 180, 207, 160, 147, 83, 83, 148, 184, 113, 208, 92, 58, 143, 129, 211, 108, 26, 86,
+            119, 117, 184, 154, 40, 181, 24, 6, 90, 11, 150, 28, 38,
+        ],
+        [
+            144, 187, 91, 40, 224, 180, 119, 167, 173, 26, 227, 221, 172, 189, 180, 197, 52, 233,
+            39, 112, 179, 40, 22, 182, 41, 225, 104, 21, 8, 96, 166, 51,
+        ],
+    ],
+    [
+        [
+            118, 105, 175, 214, 145, 170, 223, 7, 51, 179, 133, 78, 187, 138, 233, 70, 53, 182,
+            238, 228, 35, 55, 107, 18, 52, 34, 86, 113, 121, 120, 97, 8,
+        ],
+        [
+            136, 52, 133, 99, 235, 32, 133, 156, 69, 187, 203, 147, 116, 160, 103, 12, 154, 202,
+            135, 55, 163, 214, 96, 56, 11, 53, 23, 149, 77, 160, 189, 36,
+        ],
+        [
+            46, 168, 103, 19, 16, 88, 71, 160, 190, 241, 72, 249, 169, 10, 141, 151, 42, 14, 129,
+            36, 184, 162, 230, 186, 51, 234, 169, 202, 221, 129, 188, 47,
+        ],
+        [
+            94, 22, 119, 86, 162, 42, 146, 178, 116, 23, 102, 176, 181, 124, 222, 250, 98, 251,
+            121, 116, 211, 152, 216, 137, 68, 158, 133, 226, 124, 183, 135, 22,
+        ],
+        [
+            247, 213, 253, 212, 198, 6, 78, 30, 223, 210, 220, 205, 100, 129, 193, 27, 248, 74, 60,
+            30, 35, 4, 143, 42, 249, 183, 78, 209, 154, 199, 38, 53,
+        ],
+        [
+            226, 200, 233, 87, 125, 230, 129, 209, 4, 2, 105, 213, 112, 223, 41, 44, 9, 120, 65,
+            10, 131, 60, 123, 29, 20, 11, 33, 217, 153, 65, 91, 39,
+        ],
+        [
+            155, 153, 145, 173, 223, 141, 69, 150, 77, 108, 185, 23, 158, 178, 160, 123, 90, 218,
+            166, 40, 80, 206, 252, 227, 104, 248, 194, 61, 88, 204, 154, 8,
+        ],
+        [
+            142, 151, 153, 200, 56, 160, 131, 14, 164, 106, 30, 83, 29, 118, 48, 143, 222, 57, 93,
+            202, 102, 18, 253, 130, 35, 72, 38, 19, 42, 58, 106, 41,
+        ],
+    ],
+    [
+        [
+            23, 79, 174, 233, 153, 156, 213, 212, 214, 92, 159, 141, 29, 229, 223, 133, 240, 209,
+            79, 184, 66, 96, 27, 101, 214, 54, 86, 241, 99, 56, 51, 46,
+        ],
+        [
+            119, 55, 21, 173, 29, 13, 198, 88, 92, 46, 235, 147, 188, 255, 90, 77, 8, 136, 101,
+            250, 53, 209, 119, 162, 7, 76, 17, 162, 29, 199, 118, 39,
+        ],
+        [
+            8, 253, 207, 82, 23, 175, 92, 88, 155, 246, 195, 146, 200, 200, 105, 255, 61, 115, 151,
+            166, 124, 64, 220, 17, 100, 86, 20, 203, 125, 3, 221, 36,
+        ],
+        [
+            174, 75, 215, 152, 74, 10, 18, 7, 252, 162, 23, 11, 68, 157, 89, 226, 95, 128, 7, 78,
+            23, 165, 37, 157, 141, 175, 117, 23, 234, 123, 72, 42,
+        ],
+        [
+            133, 181, 221, 30, 165, 125, 199, 148, 83, 133, 250, 164, 209, 152, 68, 72, 34, 196,
+            80, 12, 224, 123, 47, 42, 221, 191, 74, 161, 197, 203, 235, 32,
+        ],
+        [
+            27, 29, 142, 238, 251, 254, 200, 233, 42, 77, 207, 93, 95, 197, 163, 242, 93, 134, 230,
+            18, 210, 156, 93, 167, 113, 16, 49, 46, 123, 218, 178, 61,
+        ],
+        [
+            118, 213, 164, 221, 213, 78, 38, 138, 116, 99, 222, 183, 249, 126, 137, 103, 13, 10,
+            153, 232, 108, 250, 220, 187, 195, 166, 238, 223, 42, 124, 91, 10,
+        ],
+        [
+            25, 143, 13, 156, 46, 146, 125, 162, 179, 244, 52, 49, 47, 142, 84, 241, 15, 96, 35,
+            122, 26, 175, 155, 30, 133, 224, 76, 77, 136, 128, 198, 6,
+        ],
+    ],
+    [
+        [
+            228, 4, 100, 254, 64, 122, 195, 101, 45, 240, 33, 189, 172, 246, 68, 35, 204, 229, 42,
+            174, 120, 197, 247, 7, 61, 33, 16, 165, 182, 175, 213, 43,
+        ],
+        [
+            95, 82, 224, 168, 92, 69, 52, 224, 169, 53, 233, 52, 82, 158, 169, 80, 71, 142, 135,
+            177, 107, 103, 114, 1, 245, 144, 160, 123, 8, 185, 118, 12,
+        ],
+        [
+            67, 145, 142, 236, 153, 196, 179, 180, 101, 10, 152, 214, 130, 7, 187, 152, 147, 177,
+            234, 96, 10, 16, 126, 208, 89, 163, 239, 38, 237, 148, 11, 29,
+        ],
+        [
+            10, 227, 59, 211, 209, 116, 53, 110, 240, 229, 85, 169, 227, 37, 187, 141, 76, 185,
+            215, 142, 202, 158, 100, 104, 52, 107, 179, 66, 237, 8, 203, 51,
+        ],
+        [
+            158, 60, 113, 87, 219, 161, 5, 234, 31, 203, 166, 8, 226, 230, 59, 175, 238, 85, 94,
+            39, 197, 52, 79, 172, 93, 55, 160, 241, 119, 43, 48, 27,
+        ],
+        [
+            214, 132, 49, 107, 226, 92, 16, 179, 190, 128, 224, 62, 190, 5, 135, 116, 189, 57, 80,
+            246, 109, 33, 9, 96, 231, 206, 202, 64, 169, 175, 222, 2,
+        ],
+        [
+            211, 188, 126, 110, 204, 200, 213, 50, 216, 49, 204, 224, 253, 245, 57, 139, 185, 75,
+            226, 85, 128, 149, 32, 213, 127, 7, 127, 106, 139, 76, 93, 42,
+        ],
+        [
+            38, 227, 189, 95, 248, 213, 125, 206, 75, 148, 138, 153, 134, 92, 243, 67, 101, 42, 86,
+            23, 28, 105, 5, 30, 72, 228, 21, 251, 56, 15, 104, 44,
+        ],
+    ],
+    [
+        [
+            37, 51, 111, 189, 64, 200, 241, 35, 170, 63, 123, 104, 60, 201, 92, 104, 78, 13, 168,
+            90, 133, 18, 74, 125, 137, 233, 244, 183, 194, 166, 136, 4,
+        ],
+        [
+            135, 115, 58, 240, 172, 155, 138, 72, 201, 245, 165, 132, 213, 230, 175, 122, 80, 137,
+            12, 202, 51, 147, 254, 83, 83, 12, 24, 196, 127, 65, 29, 9,
+        ],
+        [
+            102, 193, 159, 222, 145, 157, 184, 248, 13, 50, 103, 129, 22, 72, 211, 169, 252, 59,
+            21, 179, 8, 224, 191, 155, 105, 80, 205, 20, 126, 53, 167, 51,
+        ],
+        [
+            248, 10, 36, 176, 206, 117, 68, 20, 29, 159, 234, 75, 123, 229, 186, 211, 197, 38, 74,
+            210, 209, 247, 75, 138, 105, 11, 213, 184, 88, 146, 169, 63,
+        ],
+        [
+            72, 92, 136, 57, 104, 244, 192, 189, 92, 229, 248, 238, 206, 124, 141, 216, 65, 129,
+            74, 239, 127, 25, 111, 173, 5, 103, 127, 62, 158, 173, 150, 14,
+        ],
+        [
+            137, 66, 178, 24, 248, 195, 72, 192, 193, 118, 248, 34, 201, 117, 22, 68, 132, 3, 194,
+            91, 96, 246, 119, 95, 73, 112, 14, 241, 140, 190, 209, 1,
+        ],
+        [
+            189, 118, 10, 191, 62, 184, 239, 63, 140, 57, 145, 76, 51, 251, 162, 162, 37, 175, 50,
+            68, 158, 17, 225, 79, 180, 153, 166, 114, 251, 155, 69, 33,
+        ],
+        [
+            59, 192, 204, 241, 201, 5, 189, 79, 249, 152, 117, 146, 123, 43, 151, 111, 131, 23,
+            129, 192, 167, 112, 132, 40, 171, 94, 90, 212, 100, 52, 48, 28,
+        ],
+    ],
+    [
+        [
+            160, 245, 228, 171, 90, 165, 111, 25, 114, 50, 116, 39, 201, 216, 29, 129, 112, 207,
+            152, 165, 48, 118, 172, 101, 106, 76, 4, 16, 248, 172, 170, 39,
+        ],
+        [
+            60, 126, 38, 248, 48, 18, 168, 77, 10, 58, 62, 36, 45, 84, 12, 6, 72, 185, 147, 255,
+            88, 135, 221, 226, 229, 114, 39, 186, 151, 16, 175, 17,
+        ],
+        [
+            62, 55, 177, 217, 205, 252, 191, 205, 39, 137, 103, 195, 252, 240, 216, 28, 24, 138,
+            162, 54, 48, 159, 17, 103, 110, 255, 103, 3, 150, 20, 31, 15,
+        ],
+        [
+            120, 251, 98, 40, 80, 237, 108, 131, 14, 65, 116, 12, 242, 115, 26, 181, 106, 240, 90,
+            13, 158, 21, 68, 3, 88, 14, 59, 191, 63, 253, 247, 19,
+        ],
+        [
+            218, 240, 72, 194, 44, 92, 246, 87, 69, 50, 34, 84, 102, 185, 46, 200, 68, 10, 145, 56,
+            10, 240, 100, 73, 125, 33, 207, 254, 198, 215, 119, 23,
+        ],
+        [
+            166, 98, 74, 208, 109, 114, 207, 207, 253, 137, 146, 124, 252, 37, 92, 142, 72, 195,
+            79, 128, 83, 3, 62, 182, 252, 140, 69, 112, 81, 35, 14, 63,
+        ],
+        [
+            216, 80, 1, 36, 96, 224, 105, 59, 214, 215, 53, 144, 31, 78, 236, 102, 94, 23, 217,
+            195, 69, 74, 56, 14, 28, 241, 94, 33, 216, 166, 153, 47,
+        ],
+        [
+            239, 70, 89, 170, 122, 62, 9, 125, 238, 216, 0, 168, 95, 170, 65, 156, 31, 4, 6, 163,
+            64, 110, 235, 190, 227, 59, 9, 254, 83, 42, 179, 19,
+        ],
+    ],
+    [
+        [
+            231, 7, 127, 64, 136, 255, 178, 190, 36, 15, 199, 117, 145, 167, 218, 125, 217, 43,
+            195, 87, 29, 177, 173, 97, 128, 42, 111, 135, 122, 245, 128, 55,
+        ],
+        [
+            35, 175, 64, 138, 189, 200, 135, 138, 203, 147, 145, 199, 126, 81, 114, 39, 30, 64, 73,
+            90, 94, 109, 230, 69, 49, 71, 190, 180, 50, 10, 203, 20,
+        ],
+        [
+            110, 75, 166, 243, 255, 128, 242, 208, 67, 78, 166, 29, 124, 54, 56, 160, 106, 113,
+            190, 155, 58, 241, 21, 161, 93, 198, 173, 46, 251, 76, 109, 34,
+        ],
+        [
+            18, 157, 21, 73, 163, 78, 187, 222, 155, 123, 56, 158, 35, 155, 108, 36, 154, 199, 10,
+            39, 245, 212, 70, 250, 249, 38, 212, 21, 226, 178, 136, 44,
+        ],
+        [
+            135, 162, 176, 158, 247, 168, 215, 162, 0, 67, 153, 248, 4, 101, 176, 233, 224, 73,
+            213, 227, 132, 34, 140, 44, 207, 79, 194, 198, 151, 218, 52, 50,
+        ],
+        [
+            201, 18, 231, 111, 222, 85, 53, 39, 138, 60, 182, 53, 132, 16, 164, 42, 57, 56, 88,
+            234, 13, 162, 66, 189, 142, 130, 211, 204, 252, 71, 47, 16,
+        ],
+        [
+            91, 194, 190, 127, 41, 158, 183, 169, 31, 35, 96, 249, 162, 84, 132, 230, 161, 243,
+            170, 226, 210, 24, 14, 186, 83, 31, 210, 85, 195, 185, 24, 20,
+        ],
+        [
+            217, 59, 106, 21, 76, 11, 79, 85, 36, 138, 162, 208, 13, 136, 63, 206, 136, 158, 34,
+            207, 169, 168, 252, 135, 67, 172, 77, 234, 167, 29, 87, 45,
+        ],
+    ],
+    [
+        [
+            228, 252, 249, 53, 147, 111, 53, 172, 223, 102, 206, 74, 150, 3, 55, 233, 88, 23, 159,
+            60, 57, 46, 186, 171, 76, 170, 249, 69, 244, 79, 192, 30,
+        ],
+        [
+            128, 217, 236, 6, 89, 109, 19, 109, 108, 57, 35, 181, 116, 110, 215, 182, 43, 137, 252,
+            11, 156, 212, 132, 209, 86, 87, 8, 233, 186, 24, 134, 41,
+        ],
+        [
+            159, 52, 52, 246, 254, 33, 247, 217, 161, 118, 36, 12, 186, 90, 199, 184, 112, 54, 159,
+            71, 21, 210, 38, 191, 179, 162, 228, 205, 173, 111, 182, 43,
+        ],
+        [
+            19, 68, 116, 77, 123, 197, 44, 57, 140, 130, 231, 218, 37, 95, 228, 61, 81, 117, 38,
+            22, 118, 84, 173, 119, 161, 183, 187, 24, 201, 83, 166, 40,
+        ],
+        [
+            203, 74, 138, 253, 8, 155, 80, 99, 82, 194, 145, 185, 32, 193, 80, 85, 61, 166, 71, 92,
+            106, 41, 55, 60, 40, 237, 54, 145, 112, 90, 104, 41,
+        ],
+        [
+            152, 100, 177, 4, 228, 177, 130, 52, 85, 136, 118, 163, 98, 102, 225, 225, 113, 159,
+            224, 37, 25, 80, 112, 245, 96, 183, 221, 146, 174, 25, 48, 41,
+        ],
+        [
+            124, 166, 27, 180, 114, 17, 98, 30, 99, 232, 181, 40, 65, 191, 114, 222, 48, 209, 53,
+            93, 98, 38, 42, 146, 68, 143, 229, 208, 46, 178, 238, 62,
+        ],
+        [
+            238, 242, 49, 191, 50, 111, 197, 182, 193, 77, 103, 223, 113, 224, 125, 195, 23, 135,
+            50, 145, 77, 171, 82, 132, 173, 196, 80, 142, 107, 157, 142, 29,
+        ],
+    ],
+    [
+        [
+            82, 195, 210, 133, 249, 13, 111, 212, 92, 164, 28, 91, 160, 60, 34, 35, 243, 234, 176,
+            255, 53, 140, 151, 76, 109, 87, 182, 16, 14, 250, 248, 2,
+        ],
+        [
+            130, 201, 107, 39, 163, 233, 135, 216, 65, 13, 199, 247, 155, 234, 100, 133, 254, 230,
+            170, 109, 170, 222, 252, 40, 68, 48, 107, 211, 83, 112, 240, 60,
+        ],
+        [
+            30, 28, 129, 71, 31, 137, 206, 248, 195, 232, 69, 203, 96, 43, 67, 68, 33, 187, 167,
+            235, 204, 62, 103, 193, 206, 147, 89, 203, 190, 181, 114, 10,
+        ],
+        [
+            127, 36, 5, 200, 56, 245, 144, 50, 154, 33, 53, 7, 127, 232, 151, 11, 124, 180, 160,
+            89, 172, 138, 214, 238, 131, 54, 191, 199, 206, 111, 61, 23,
+        ],
+        [
+            146, 197, 178, 24, 254, 19, 211, 232, 156, 144, 13, 104, 87, 52, 25, 6, 187, 206, 19,
+            91, 43, 70, 93, 18, 227, 52, 139, 210, 183, 88, 127, 36,
+        ],
+        [
+            113, 170, 45, 153, 118, 29, 249, 241, 96, 85, 78, 221, 223, 55, 10, 199, 137, 15, 230,
+            113, 214, 92, 169, 32, 58, 251, 62, 186, 233, 37, 32, 1,
+        ],
+        [
+            47, 80, 145, 109, 177, 172, 202, 217, 197, 228, 249, 136, 223, 48, 136, 55, 244, 227,
+            206, 93, 78, 84, 183, 243, 203, 98, 169, 196, 103, 39, 76, 48,
+        ],
+        [
+            32, 251, 111, 146, 107, 57, 148, 119, 188, 206, 74, 49, 89, 16, 106, 149, 111, 90, 210,
+            38, 142, 50, 196, 143, 191, 133, 221, 123, 219, 205, 157, 15,
+        ],
+    ],
+    [
+        [
+            124, 193, 251, 119, 28, 89, 69, 168, 245, 164, 145, 5, 34, 127, 237, 40, 9, 194, 222,
+            92, 5, 254, 145, 164, 238, 22, 168, 97, 39, 63, 63, 48,
+        ],
+        [
+            128, 14, 241, 12, 198, 51, 53, 31, 29, 56, 116, 167, 33, 172, 77, 124, 84, 230, 106,
+            120, 94, 231, 26, 253, 29, 246, 251, 225, 144, 208, 93, 41,
+        ],
+        [
+            145, 233, 236, 72, 57, 76, 123, 17, 55, 100, 127, 228, 145, 32, 165, 62, 23, 123, 121,
+            2, 13, 178, 199, 180, 214, 163, 228, 157, 63, 135, 187, 30,
+        ],
+        [
+            76, 75, 200, 240, 37, 16, 184, 100, 38, 65, 206, 138, 92, 149, 194, 84, 241, 42, 194,
+            161, 149, 93, 182, 230, 110, 171, 51, 65, 219, 158, 252, 19,
+        ],
+        [
+            169, 156, 202, 117, 173, 222, 62, 242, 203, 66, 26, 216, 9, 92, 112, 184, 46, 165, 52,
+            160, 114, 38, 68, 43, 148, 62, 30, 121, 26, 192, 152, 0,
+        ],
+        [
+            38, 77, 105, 144, 232, 160, 9, 77, 14, 96, 247, 59, 109, 53, 101, 114, 55, 121, 243,
+            111, 90, 240, 61, 220, 55, 0, 114, 64, 49, 194, 37, 63,
+        ],
+        [
+            94, 199, 2, 248, 34, 232, 68, 130, 1, 237, 3, 73, 251, 153, 188, 183, 202, 133, 201,
+            127, 244, 156, 184, 58, 22, 53, 115, 184, 107, 251, 115, 41,
+        ],
+        [
+            44, 105, 2, 121, 133, 252, 4, 51, 135, 185, 18, 240, 184, 64, 39, 128, 126, 216, 168,
+            25, 54, 230, 96, 205, 156, 5, 228, 79, 121, 245, 0, 37,
+        ],
+    ],
+    [
+        [
+            26, 227, 128, 219, 221, 39, 112, 88, 84, 130, 216, 87, 157, 119, 89, 202, 85, 179, 237,
+            107, 51, 211, 185, 30, 143, 196, 239, 4, 187, 89, 157, 46,
+        ],
+        [
+            11, 54, 239, 254, 23, 23, 81, 152, 249, 219, 38, 144, 14, 66, 140, 19, 125, 160, 65,
+            238, 136, 168, 185, 167, 131, 60, 217, 246, 38, 125, 58, 35,
+        ],
+        [
+            157, 212, 24, 185, 100, 207, 250, 73, 82, 53, 146, 208, 36, 19, 63, 130, 58, 99, 61,
+            79, 153, 247, 2, 65, 234, 255, 31, 19, 13, 168, 227, 45,
+        ],
+        [
+            36, 219, 99, 139, 180, 218, 207, 143, 166, 191, 127, 239, 60, 76, 145, 170, 56, 128,
+            112, 71, 49, 92, 121, 144, 212, 14, 21, 80, 66, 58, 141, 30,
+        ],
+        [
+            36, 182, 110, 54, 159, 120, 85, 112, 6, 158, 77, 194, 157, 33, 36, 82, 2, 190, 84, 155,
+            101, 244, 186, 202, 94, 98, 115, 72, 231, 202, 129, 55,
+        ],
+        [
+            39, 152, 205, 65, 57, 155, 123, 160, 72, 205, 121, 246, 119, 90, 39, 77, 49, 95, 30,
+            159, 243, 241, 69, 154, 109, 150, 235, 177, 140, 158, 197, 50,
+        ],
+        [
+            101, 168, 129, 120, 249, 152, 206, 97, 236, 88, 65, 123, 54, 174, 153, 187, 243, 114,
+            75, 24, 105, 33, 133, 230, 209, 159, 244, 92, 139, 79, 29, 60,
+        ],
+        [
+            159, 56, 171, 163, 194, 74, 206, 171, 192, 125, 50, 168, 220, 194, 217, 246, 53, 51,
+            143, 119, 97, 16, 102, 154, 202, 171, 112, 0, 9, 76, 52, 33,
+        ],
+    ],
+    [
+        [
+            109, 67, 166, 112, 18, 88, 181, 61, 137, 12, 191, 223, 140, 243, 174, 222, 244, 102,
+            170, 101, 139, 159, 219, 120, 143, 31, 69, 70, 172, 184, 26, 47,
+        ],
+        [
+            49, 226, 39, 237, 179, 21, 55, 83, 139, 192, 65, 216, 225, 192, 239, 65, 235, 37, 109,
+            139, 101, 80, 151, 15, 183, 1, 40, 226, 236, 136, 173, 62,
+        ],
+        [
+            132, 87, 121, 118, 184, 56, 103, 98, 191, 218, 47, 214, 204, 128, 57, 24, 141, 86, 189,
+            135, 180, 249, 214, 40, 206, 182, 57, 238, 90, 133, 168, 5,
+        ],
+        [
+            60, 151, 209, 75, 237, 97, 152, 67, 235, 169, 140, 65, 35, 251, 107, 207, 254, 72, 81,
+            3, 244, 168, 187, 246, 125, 37, 167, 104, 81, 165, 105, 34,
+        ],
+        [
+            231, 77, 104, 60, 44, 124, 228, 21, 207, 19, 248, 89, 180, 91, 64, 64, 251, 244, 223,
+            207, 76, 3, 207, 142, 92, 16, 177, 109, 3, 141, 225, 16,
+        ],
+        [
+            229, 156, 173, 75, 130, 73, 204, 213, 61, 179, 238, 170, 15, 77, 113, 178, 84, 151,
+            137, 159, 149, 224, 204, 243, 232, 113, 208, 238, 82, 107, 180, 32,
+        ],
+        [
+            136, 153, 152, 220, 13, 5, 102, 224, 162, 188, 90, 143, 119, 179, 243, 104, 91, 134,
+            56, 22, 5, 152, 153, 17, 234, 167, 107, 234, 16, 66, 85, 34,
+        ],
+        [
+            130, 45, 164, 141, 146, 197, 199, 12, 51, 82, 156, 32, 239, 243, 29, 170, 63, 17, 153,
+            176, 150, 114, 38, 219, 27, 107, 187, 72, 32, 106, 68, 20,
+        ],
+    ],
+    [
+        [
+            51, 54, 182, 167, 147, 255, 80, 103, 13, 213, 237, 114, 233, 242, 173, 177, 188, 54, 5,
+            143, 165, 220, 114, 249, 175, 171, 173, 188, 4, 162, 62, 26,
+        ],
+        [
+            241, 98, 202, 23, 140, 169, 52, 94, 94, 232, 69, 90, 53, 215, 112, 146, 164, 223, 204,
+            33, 208, 138, 238, 181, 48, 56, 243, 170, 171, 35, 126, 48,
+        ],
+        [
+            56, 210, 32, 249, 23, 217, 198, 162, 239, 118, 198, 97, 177, 72, 116, 153, 131, 248,
+            194, 171, 180, 33, 195, 66, 159, 125, 110, 230, 56, 89, 15, 9,
+        ],
+        [
+            5, 133, 98, 216, 11, 182, 6, 102, 218, 117, 248, 20, 242, 170, 0, 183, 178, 30, 67,
+            211, 90, 255, 24, 70, 135, 65, 114, 85, 238, 29, 70, 40,
+        ],
+        [
+            102, 170, 201, 230, 61, 107, 34, 64, 162, 224, 15, 128, 93, 20, 103, 143, 19, 116, 25,
+            123, 93, 16, 154, 219, 136, 216, 69, 185, 35, 126, 242, 30,
+        ],
+        [
+            204, 190, 215, 249, 104, 142, 254, 130, 121, 238, 163, 234, 63, 91, 230, 251, 121, 201,
+            127, 69, 0, 121, 61, 203, 137, 2, 77, 227, 203, 127, 89, 44,
+        ],
+        [
+            159, 236, 163, 243, 192, 6, 217, 134, 210, 91, 90, 137, 46, 126, 9, 76, 108, 26, 31,
+            241, 181, 180, 29, 63, 62, 119, 7, 143, 166, 173, 8, 6,
+        ],
+        [
+            8, 238, 253, 27, 28, 102, 219, 25, 139, 220, 55, 32, 203, 141, 243, 93, 224, 72, 195,
+            75, 45, 78, 151, 142, 71, 137, 38, 141, 205, 102, 85, 35,
+        ],
+    ],
+    [
+        [
+            98, 124, 121, 75, 138, 47, 120, 198, 57, 252, 117, 98, 53, 109, 168, 113, 235, 254,
+            170, 23, 167, 88, 117, 230, 246, 7, 189, 223, 21, 12, 28, 43,
+        ],
+        [
+            172, 101, 158, 162, 23, 10, 251, 252, 92, 152, 13, 48, 159, 45, 112, 195, 149, 53, 198,
+            137, 77, 177, 135, 21, 86, 161, 36, 67, 10, 84, 115, 59,
+        ],
+        [
+            89, 60, 73, 153, 180, 157, 56, 238, 205, 197, 102, 16, 177, 170, 181, 232, 46, 160,
+            135, 229, 62, 155, 44, 183, 1, 70, 211, 211, 124, 120, 222, 26,
+        ],
+        [
+            126, 135, 102, 76, 24, 172, 65, 102, 115, 181, 92, 106, 34, 101, 203, 56, 249, 148, 93,
+            125, 212, 127, 82, 177, 180, 49, 119, 240, 169, 234, 9, 49,
+        ],
+        [
+            71, 143, 202, 34, 243, 214, 106, 210, 230, 70, 197, 6, 173, 230, 236, 14, 39, 19, 42,
+            121, 111, 148, 97, 89, 223, 152, 217, 77, 66, 193, 126, 54,
+        ],
+        [
+            81, 149, 56, 199, 215, 100, 87, 71, 249, 207, 114, 45, 137, 99, 209, 60, 26, 92, 202,
+            131, 184, 151, 170, 22, 219, 93, 71, 234, 107, 142, 232, 59,
+        ],
+        [
+            17, 166, 47, 181, 47, 121, 77, 103, 36, 162, 150, 155, 54, 127, 29, 40, 219, 189, 57,
+            150, 76, 147, 110, 67, 241, 212, 104, 10, 154, 50, 48, 17,
+        ],
+        [
+            20, 246, 109, 111, 72, 251, 94, 213, 187, 51, 196, 220, 212, 10, 167, 224, 102, 27,
+            115, 235, 106, 242, 214, 243, 148, 66, 111, 9, 221, 230, 224, 13,
+        ],
+    ],
+    [
+        [
+            158, 218, 203, 21, 240, 183, 105, 204, 138, 99, 207, 223, 104, 252, 85, 27, 195, 215,
+            225, 142, 69, 132, 177, 232, 49, 174, 246, 78, 103, 125, 17, 29,
+        ],
+        [
+            228, 101, 236, 222, 176, 167, 152, 154, 183, 104, 237, 123, 248, 121, 232, 69, 215,
+            181, 73, 228, 140, 179, 94, 40, 67, 69, 67, 102, 154, 223, 122, 51,
+        ],
+        [
+            248, 30, 67, 220, 168, 33, 81, 46, 96, 22, 94, 129, 31, 130, 56, 223, 184, 1, 198, 98,
+            212, 233, 165, 210, 145, 4, 100, 44, 234, 75, 14, 6,
+        ],
+        [
+            176, 203, 91, 145, 241, 154, 103, 144, 187, 208, 156, 255, 219, 145, 244, 86, 128, 136,
+            123, 221, 50, 148, 156, 138, 187, 15, 153, 186, 86, 77, 138, 8,
+        ],
+        [
+            180, 19, 118, 126, 101, 180, 248, 122, 194, 255, 63, 91, 186, 33, 147, 163, 36, 254,
+            211, 96, 175, 110, 18, 140, 9, 76, 246, 237, 146, 1, 231, 12,
+        ],
+        [
+            88, 60, 192, 62, 79, 179, 180, 200, 248, 127, 196, 132, 80, 39, 113, 255, 229, 201,
+            241, 38, 97, 34, 4, 49, 232, 50, 107, 64, 4, 224, 224, 37,
+        ],
+        [
+            149, 121, 11, 212, 194, 55, 251, 28, 119, 100, 176, 84, 249, 60, 182, 190, 221, 64,
+            228, 2, 214, 39, 56, 220, 227, 136, 228, 13, 141, 159, 245, 42,
+        ],
+        [
+            60, 243, 115, 233, 255, 140, 63, 231, 210, 14, 155, 130, 118, 194, 7, 141, 48, 173,
+            107, 162, 177, 75, 123, 169, 232, 103, 73, 240, 67, 80, 57, 24,
+        ],
+    ],
+    [
+        [
+            123, 136, 142, 35, 186, 163, 74, 144, 91, 217, 190, 33, 143, 34, 55, 166, 163, 87, 199,
+            199, 13, 152, 48, 89, 144, 123, 47, 91, 121, 216, 134, 26,
+        ],
+        [
+            91, 28, 158, 185, 86, 38, 1, 159, 40, 166, 63, 248, 93, 73, 118, 55, 180, 26, 78, 86,
+            42, 5, 98, 205, 83, 26, 145, 23, 158, 205, 197, 54,
+        ],
+        [
+            13, 183, 119, 158, 77, 201, 152, 68, 105, 136, 252, 223, 120, 231, 59, 72, 171, 229,
+            90, 75, 140, 89, 17, 82, 61, 117, 213, 226, 128, 253, 101, 39,
+        ],
+        [
+            59, 213, 226, 8, 10, 97, 178, 127, 43, 50, 225, 84, 92, 71, 0, 6, 25, 254, 192, 225,
+            129, 154, 45, 197, 149, 89, 51, 131, 185, 23, 99, 50,
+        ],
+        [
+            86, 45, 93, 113, 243, 120, 77, 157, 17, 22, 33, 162, 239, 86, 34, 58, 187, 204, 242,
+            211, 193, 192, 149, 103, 35, 85, 43, 239, 101, 191, 214, 23,
+        ],
+        [
+            46, 196, 68, 68, 11, 189, 17, 137, 247, 165, 190, 8, 171, 95, 251, 9, 230, 51, 75, 122,
+            196, 72, 18, 142, 118, 216, 157, 154, 149, 160, 68, 23,
+        ],
+        [
+            135, 237, 213, 40, 201, 43, 82, 54, 223, 17, 46, 232, 102, 235, 40, 83, 119, 29, 149,
+            23, 11, 62, 225, 95, 65, 46, 134, 46, 176, 242, 155, 0,
+        ],
+        [
+            253, 9, 210, 43, 163, 50, 199, 172, 36, 116, 174, 131, 178, 56, 211, 11, 88, 67, 68,
+            216, 138, 157, 28, 47, 254, 216, 114, 210, 142, 206, 184, 55,
+        ],
+    ],
+    [
+        [
+            197, 81, 131, 228, 67, 23, 186, 51, 177, 152, 255, 231, 198, 185, 86, 51, 221, 245,
+            167, 67, 74, 178, 231, 210, 217, 140, 72, 202, 217, 176, 139, 60,
+        ],
+        [
+            84, 252, 34, 127, 193, 224, 200, 198, 234, 98, 124, 60, 4, 168, 73, 124, 79, 120, 198,
+            114, 70, 123, 112, 62, 82, 53, 64, 80, 174, 183, 98, 6,
+        ],
+        [
+            199, 164, 163, 248, 113, 221, 67, 237, 201, 176, 1, 167, 144, 149, 235, 184, 83, 244,
+            12, 92, 104, 253, 162, 59, 22, 201, 221, 234, 163, 224, 89, 5,
+        ],
+        [
+            87, 154, 186, 165, 223, 109, 104, 245, 249, 189, 175, 226, 10, 125, 198, 87, 129, 98,
+            86, 13, 230, 38, 3, 66, 58, 175, 193, 243, 130, 7, 197, 41,
+        ],
+        [
+            71, 25, 97, 21, 122, 68, 82, 109, 212, 193, 136, 140, 58, 0, 12, 145, 215, 119, 7, 158,
+            82, 133, 73, 16, 20, 124, 236, 178, 228, 255, 82, 37,
+        ],
+        [
+            3, 127, 251, 18, 54, 47, 117, 7, 70, 9, 116, 157, 145, 150, 42, 199, 157, 49, 154, 22,
+            251, 13, 55, 97, 62, 218, 210, 141, 253, 191, 74, 6,
+        ],
+        [
+            173, 242, 97, 188, 114, 16, 6, 168, 246, 152, 247, 172, 229, 126, 102, 1, 15, 91, 193,
+            129, 169, 34, 47, 166, 229, 92, 100, 13, 226, 74, 56, 52,
+        ],
+        [
+            37, 169, 210, 23, 92, 170, 67, 52, 168, 83, 127, 25, 142, 75, 150, 126, 218, 154, 237,
+            239, 54, 45, 19, 253, 219, 252, 48, 37, 104, 56, 2, 21,
+        ],
+    ],
+    [
+        [
+            60, 125, 249, 106, 109, 26, 169, 114, 202, 228, 129, 132, 38, 39, 147, 68, 43, 242, 79,
+            218, 20, 31, 165, 156, 137, 220, 49, 241, 151, 247, 105, 53,
+        ],
+        [
+            212, 200, 140, 161, 15, 200, 20, 128, 243, 18, 105, 104, 217, 199, 147, 246, 93, 207,
+            207, 122, 198, 145, 173, 157, 243, 84, 236, 192, 37, 75, 26, 18,
+        ],
+        [
+            48, 74, 217, 159, 193, 212, 181, 11, 109, 13, 103, 211, 74, 136, 28, 55, 187, 15, 70,
+            196, 203, 198, 192, 71, 116, 32, 179, 94, 46, 123, 243, 62,
+        ],
+        [
+            32, 118, 247, 159, 253, 204, 153, 215, 217, 29, 212, 104, 196, 46, 55, 76, 139, 95,
+            221, 156, 28, 206, 109, 199, 191, 207, 48, 128, 215, 199, 153, 14,
+        ],
+        [
+            243, 149, 62, 162, 172, 158, 84, 72, 94, 135, 29, 157, 48, 234, 186, 120, 34, 167, 217,
+            200, 135, 119, 88, 173, 184, 86, 133, 70, 192, 84, 196, 57,
+        ],
+        [
+            244, 67, 190, 58, 76, 41, 196, 149, 51, 29, 81, 123, 148, 148, 73, 244, 118, 244, 250,
+            41, 239, 117, 59, 26, 104, 33, 23, 149, 65, 244, 39, 33,
+        ],
+        [
+            54, 60, 215, 246, 79, 251, 104, 178, 207, 103, 237, 158, 80, 0, 147, 131, 213, 98, 195,
+            57, 104, 115, 125, 246, 1, 99, 10, 173, 43, 139, 242, 1,
+        ],
+        [
+            84, 50, 191, 103, 217, 208, 123, 53, 160, 95, 108, 77, 170, 154, 202, 199, 67, 242, 75,
+            192, 30, 171, 48, 213, 177, 52, 208, 103, 137, 76, 9, 0,
+        ],
+    ],
+    [
+        [
+            198, 88, 29, 105, 10, 101, 59, 211, 37, 76, 97, 63, 188, 168, 187, 252, 174, 75, 103,
+            28, 207, 172, 19, 47, 89, 231, 179, 10, 117, 142, 240, 27,
+        ],
+        [
+            37, 124, 164, 233, 8, 135, 109, 1, 136, 169, 167, 146, 195, 44, 71, 214, 193, 210, 10,
+            250, 119, 80, 176, 97, 1, 122, 97, 4, 251, 47, 251, 14,
+        ],
+        [
+            189, 244, 239, 17, 181, 148, 184, 159, 229, 49, 128, 129, 26, 100, 215, 116, 27, 55,
+            169, 152, 190, 16, 82, 32, 145, 95, 121, 181, 178, 107, 32, 38,
+        ],
+        [
+            208, 57, 233, 100, 166, 183, 132, 121, 242, 57, 169, 22, 247, 39, 94, 133, 137, 112,
+            113, 87, 193, 38, 162, 181, 160, 250, 164, 231, 50, 189, 83, 18,
+        ],
+        [
+            89, 30, 89, 240, 145, 188, 55, 190, 206, 229, 82, 37, 221, 78, 109, 41, 114, 35, 237,
+            224, 11, 114, 82, 220, 237, 91, 24, 25, 209, 240, 157, 54,
+        ],
+        [
+            53, 11, 143, 37, 127, 190, 2, 16, 220, 176, 53, 153, 217, 128, 213, 211, 52, 117, 20,
+            40, 23, 78, 48, 220, 36, 118, 56, 67, 198, 220, 105, 61,
+        ],
+        [
+            130, 17, 90, 245, 190, 206, 74, 238, 215, 29, 201, 98, 113, 136, 240, 128, 69, 26, 86,
+            198, 78, 240, 146, 69, 242, 168, 245, 180, 73, 231, 119, 3,
+        ],
+        [
+            117, 183, 82, 52, 195, 130, 3, 41, 1, 9, 249, 106, 246, 164, 128, 188, 215, 143, 162,
+            187, 35, 36, 150, 143, 43, 50, 156, 147, 232, 175, 97, 49,
+        ],
+    ],
+    [
+        [
+            38, 224, 69, 88, 100, 38, 34, 196, 95, 198, 226, 152, 100, 82, 198, 120, 108, 7, 59,
+            14, 129, 184, 42, 54, 141, 209, 250, 70, 224, 158, 238, 62,
+        ],
+        [
+            39, 179, 16, 131, 80, 58, 46, 177, 58, 161, 92, 239, 226, 252, 174, 213, 245, 185, 34,
+            111, 151, 92, 102, 16, 136, 219, 119, 113, 139, 136, 34, 3,
+        ],
+        [
+            150, 71, 69, 203, 65, 36, 72, 94, 92, 38, 188, 129, 142, 8, 151, 232, 181, 160, 72,
+            169, 34, 41, 159, 165, 68, 204, 138, 253, 86, 27, 121, 25,
+        ],
+        [
+            39, 162, 63, 3, 162, 220, 95, 191, 231, 84, 23, 145, 162, 179, 153, 113, 214, 161, 86,
+            3, 160, 28, 114, 83, 175, 233, 79, 73, 219, 69, 177, 9,
+        ],
+        [
+            137, 4, 29, 218, 129, 49, 228, 150, 66, 226, 72, 29, 194, 103, 28, 253, 238, 18, 6, 77,
+            175, 84, 92, 130, 186, 220, 67, 10, 191, 26, 234, 28,
+        ],
+        [
+            84, 223, 200, 75, 221, 183, 164, 115, 0, 67, 189, 87, 45, 218, 79, 28, 148, 155, 97,
+            88, 245, 71, 78, 252, 147, 23, 126, 73, 127, 176, 246, 40,
+        ],
+        [
+            179, 241, 1, 84, 103, 179, 254, 187, 112, 110, 174, 233, 19, 158, 3, 90, 250, 147, 45,
+            63, 243, 166, 155, 159, 8, 234, 67, 205, 55, 245, 253, 14,
+        ],
+        [
+            226, 134, 21, 50, 73, 160, 26, 45, 255, 234, 88, 153, 31, 125, 250, 213, 120, 231, 112,
+            91, 28, 234, 92, 44, 231, 118, 31, 130, 206, 179, 242, 8,
+        ],
+    ],
+    [
+        [
+            167, 13, 48, 42, 131, 107, 78, 98, 138, 196, 106, 57, 105, 59, 218, 50, 239, 183, 45,
+            39, 30, 212, 206, 92, 65, 91, 170, 52, 34, 57, 174, 11,
+        ],
+        [
+            217, 73, 127, 55, 81, 100, 78, 66, 157, 217, 177, 137, 100, 148, 138, 154, 9, 201, 139,
+            236, 209, 100, 133, 99, 114, 87, 106, 9, 109, 201, 195, 11,
+        ],
+        [
+            94, 10, 206, 24, 189, 217, 152, 247, 221, 25, 15, 16, 3, 132, 132, 84, 101, 19, 137,
+            74, 224, 150, 101, 239, 114, 174, 156, 74, 119, 58, 68, 13,
+        ],
+        [
+            23, 77, 197, 220, 177, 194, 206, 23, 139, 196, 0, 238, 80, 128, 118, 20, 243, 149, 74,
+            32, 204, 153, 72, 26, 160, 54, 66, 168, 143, 169, 204, 51,
+        ],
+        [
+            40, 217, 104, 147, 156, 74, 178, 30, 32, 214, 13, 145, 178, 253, 53, 41, 125, 142, 47,
+            40, 15, 49, 207, 85, 55, 217, 159, 250, 157, 91, 55, 55,
+        ],
+        [
+            40, 244, 153, 231, 80, 142, 238, 13, 177, 131, 169, 177, 186, 16, 151, 255, 8, 111, 47,
+            152, 52, 15, 83, 240, 84, 197, 239, 128, 202, 202, 76, 30,
+        ],
+        [
+            250, 60, 71, 175, 180, 159, 32, 159, 225, 187, 30, 160, 169, 116, 171, 153, 23, 152,
+            172, 89, 254, 12, 18, 217, 158, 115, 139, 123, 180, 230, 119, 58,
+        ],
+        [
+            208, 102, 76, 132, 87, 190, 6, 202, 244, 78, 197, 130, 183, 148, 55, 26, 61, 211, 35,
+            148, 181, 36, 158, 12, 157, 120, 21, 100, 45, 85, 114, 5,
+        ],
+    ],
+    [
+        [
+            154, 225, 115, 161, 18, 54, 207, 2, 188, 4, 87, 220, 139, 224, 192, 9, 203, 28, 219,
+            127, 130, 225, 41, 129, 213, 5, 243, 222, 219, 195, 53, 54,
+        ],
+        [
+            112, 249, 215, 104, 105, 10, 110, 38, 76, 233, 154, 73, 92, 73, 120, 254, 31, 78, 198,
+            139, 142, 165, 130, 70, 118, 175, 226, 90, 139, 203, 142, 30,
+        ],
+        [
+            98, 135, 112, 214, 115, 38, 47, 143, 75, 8, 199, 93, 243, 142, 80, 205, 242, 230, 144,
+            69, 57, 131, 221, 123, 154, 254, 70, 177, 38, 5, 179, 55,
+        ],
+        [
+            172, 90, 158, 114, 79, 59, 0, 48, 148, 66, 138, 218, 129, 224, 130, 181, 91, 214, 102,
+            138, 186, 20, 248, 111, 189, 6, 113, 155, 152, 70, 184, 53,
+        ],
+        [
+            93, 132, 123, 157, 80, 196, 33, 122, 74, 252, 53, 16, 109, 153, 14, 47, 185, 36, 0,
+            205, 112, 169, 47, 118, 85, 10, 88, 148, 215, 102, 50, 49,
+        ],
+        [
+            227, 29, 11, 192, 11, 129, 121, 0, 224, 246, 251, 181, 43, 252, 124, 103, 158, 178,
+            116, 105, 135, 194, 215, 0, 74, 24, 4, 103, 198, 99, 92, 62,
+        ],
+        [
+            215, 88, 93, 169, 126, 62, 12, 33, 41, 174, 153, 42, 94, 183, 54, 237, 185, 27, 82,
+            137, 5, 203, 193, 5, 43, 214, 218, 227, 158, 86, 67, 11,
+        ],
+        [
+            204, 198, 113, 206, 88, 212, 218, 203, 76, 170, 88, 64, 85, 144, 199, 183, 19, 103,
+            204, 12, 154, 29, 84, 152, 96, 147, 233, 62, 34, 37, 252, 19,
+        ],
+    ],
+    [
+        [
+            22, 87, 1, 109, 71, 145, 157, 11, 187, 118, 148, 132, 206, 10, 133, 13, 217, 56, 66,
+            83, 203, 55, 30, 139, 161, 158, 238, 242, 100, 169, 53, 2,
+        ],
+        [
+            71, 213, 215, 26, 60, 9, 211, 106, 70, 217, 178, 104, 196, 36, 165, 198, 160, 50, 164,
+            0, 229, 135, 70, 162, 214, 3, 75, 70, 207, 163, 75, 56,
+        ],
+        [
+            221, 79, 237, 22, 189, 144, 124, 70, 190, 2, 159, 160, 123, 87, 13, 127, 179, 26, 237,
+            107, 37, 252, 71, 33, 180, 38, 63, 45, 24, 235, 161, 20,
+        ],
+        [
+            187, 190, 72, 212, 201, 195, 98, 232, 141, 33, 40, 137, 167, 195, 147, 44, 89, 98, 212,
+            216, 94, 167, 189, 122, 222, 141, 116, 37, 88, 168, 103, 17,
+        ],
+        [
+            239, 90, 233, 200, 169, 16, 109, 99, 224, 159, 160, 124, 212, 51, 244, 255, 153, 179,
+            203, 234, 125, 186, 86, 67, 157, 144, 19, 254, 145, 81, 67, 37,
+        ],
+        [
+            43, 152, 102, 183, 158, 246, 197, 209, 214, 63, 126, 228, 123, 198, 231, 33, 187, 146,
+            175, 159, 120, 2, 176, 113, 101, 202, 195, 61, 128, 217, 57, 41,
+        ],
+        [
+            34, 53, 55, 23, 239, 129, 15, 228, 220, 113, 238, 34, 251, 139, 231, 49, 202, 252, 146,
+            71, 231, 123, 197, 152, 214, 254, 26, 213, 42, 141, 44, 59,
+        ],
+        [
+            14, 199, 227, 234, 179, 149, 80, 241, 36, 197, 33, 50, 41, 101, 228, 198, 1, 235, 176,
+            65, 116, 150, 209, 35, 170, 142, 31, 4, 168, 133, 28, 25,
+        ],
+    ],
+    [
+        [
+            227, 69, 192, 97, 61, 2, 159, 47, 31, 246, 219, 46, 10, 9, 197, 91, 223, 218, 48, 88,
+            68, 196, 183, 101, 146, 42, 88, 243, 6, 163, 85, 24,
+        ],
+        [
+            133, 181, 41, 19, 10, 65, 213, 69, 31, 230, 153, 104, 99, 35, 68, 61, 213, 42, 252,
+            215, 14, 69, 37, 225, 58, 113, 145, 234, 102, 36, 26, 61,
+        ],
+        [
+            36, 174, 201, 204, 110, 25, 137, 23, 88, 63, 173, 206, 140, 217, 221, 34, 191, 239,
+            200, 133, 87, 234, 201, 114, 100, 21, 214, 213, 227, 116, 87, 43,
+        ],
+        [
+            33, 254, 187, 9, 6, 142, 196, 236, 174, 73, 115, 38, 11, 202, 94, 21, 232, 88, 10, 16,
+            86, 137, 2, 114, 74, 232, 75, 217, 55, 154, 163, 36,
+        ],
+        [
+            61, 43, 128, 223, 251, 52, 151, 169, 224, 228, 34, 213, 36, 60, 191, 138, 119, 196,
+            244, 87, 107, 167, 139, 227, 227, 36, 95, 70, 145, 206, 23, 59,
+        ],
+        [
+            149, 239, 176, 117, 82, 16, 109, 249, 224, 163, 81, 48, 91, 82, 238, 212, 205, 250,
+            105, 102, 169, 8, 45, 218, 154, 106, 204, 233, 104, 179, 21, 47,
+        ],
+        [
+            136, 82, 212, 89, 173, 244, 117, 33, 77, 197, 211, 141, 19, 126, 62, 14, 18, 88, 118,
+            61, 46, 233, 207, 23, 181, 122, 253, 31, 223, 68, 115, 44,
+        ],
+        [
+            230, 82, 213, 56, 121, 61, 11, 146, 68, 52, 147, 115, 18, 230, 149, 148, 48, 88, 173,
+            238, 218, 98, 191, 129, 200, 222, 212, 245, 210, 215, 171, 28,
+        ],
+    ],
+    [
+        [
+            191, 225, 193, 65, 70, 115, 255, 253, 40, 60, 196, 222, 142, 70, 14, 97, 163, 100, 23,
+            145, 35, 160, 154, 227, 141, 93, 182, 222, 47, 174, 56, 40,
+        ],
+        [
+            197, 21, 27, 76, 137, 232, 211, 79, 171, 229, 90, 184, 215, 43, 72, 109, 244, 111, 249,
+            227, 72, 76, 67, 98, 93, 71, 22, 15, 118, 88, 255, 26,
+        ],
+        [
+            171, 251, 162, 17, 102, 160, 158, 12, 84, 9, 1, 167, 213, 63, 157, 165, 63, 95, 171,
+            233, 58, 186, 255, 70, 112, 8, 197, 221, 248, 175, 3, 11,
+        ],
+        [
+            211, 3, 175, 11, 139, 74, 240, 174, 110, 157, 211, 68, 153, 75, 254, 118, 192, 108,
+            206, 103, 55, 115, 235, 149, 79, 220, 166, 192, 115, 153, 230, 48,
+        ],
+        [
+            27, 45, 52, 129, 100, 72, 202, 230, 149, 80, 18, 81, 42, 120, 156, 241, 218, 16, 49,
+            65, 215, 124, 129, 56, 207, 166, 117, 199, 29, 53, 222, 26,
+        ],
+        [
+            76, 70, 58, 161, 96, 99, 111, 185, 67, 54, 34, 220, 49, 46, 125, 120, 115, 149, 96,
+            111, 185, 212, 0, 186, 22, 117, 140, 245, 135, 179, 42, 19,
+        ],
+        [
+            66, 230, 5, 90, 123, 140, 234, 5, 139, 250, 44, 103, 84, 127, 174, 178, 194, 65, 195,
+            50, 213, 77, 153, 212, 244, 209, 216, 149, 55, 234, 135, 6,
+        ],
+        [
+            254, 64, 206, 41, 117, 44, 153, 71, 0, 204, 67, 65, 231, 116, 35, 8, 99, 69, 207, 34,
+            15, 233, 184, 86, 39, 186, 205, 238, 233, 245, 250, 44,
+        ],
+    ],
+    [
+        [
+            199, 157, 28, 88, 230, 49, 91, 18, 24, 87, 45, 179, 63, 135, 122, 54, 172, 223, 233,
+            189, 237, 197, 203, 20, 126, 47, 99, 38, 69, 226, 255, 14,
+        ],
+        [
+            166, 224, 94, 181, 103, 110, 4, 185, 117, 168, 188, 254, 60, 122, 232, 159, 147, 129,
+            120, 140, 200, 103, 249, 27, 133, 22, 186, 19, 170, 127, 231, 35,
+        ],
+        [
+            148, 181, 107, 54, 45, 247, 223, 58, 41, 106, 43, 34, 157, 54, 190, 18, 237, 98, 10,
+            159, 193, 210, 95, 129, 44, 182, 121, 37, 250, 123, 200, 56,
+        ],
+        [
+            165, 157, 120, 229, 210, 117, 15, 122, 29, 182, 94, 216, 135, 219, 142, 206, 235, 38,
+            6, 254, 112, 192, 172, 33, 177, 179, 58, 161, 33, 231, 226, 44,
+        ],
+        [
+            22, 188, 212, 0, 63, 2, 102, 220, 41, 147, 252, 183, 186, 222, 65, 133, 223, 104, 245,
+            251, 67, 50, 241, 141, 16, 153, 53, 36, 223, 92, 56, 33,
+        ],
+        [
+            3, 171, 26, 109, 247, 144, 210, 147, 173, 157, 69, 27, 151, 43, 191, 184, 230, 134,
+            121, 109, 159, 59, 207, 83, 160, 231, 1, 16, 121, 248, 25, 2,
+        ],
+        [
+            187, 76, 191, 137, 218, 205, 64, 191, 85, 92, 226, 13, 159, 50, 44, 20, 106, 248, 106,
+            104, 38, 147, 26, 206, 72, 152, 219, 227, 39, 111, 153, 22,
+        ],
+        [
+            37, 88, 160, 215, 216, 90, 55, 159, 157, 19, 83, 137, 20, 17, 97, 87, 108, 194, 57,
+            124, 237, 155, 251, 143, 155, 24, 194, 250, 107, 157, 108, 6,
+        ],
+    ],
+    [
+        [
+            179, 238, 187, 220, 201, 52, 151, 82, 231, 246, 234, 157, 60, 224, 148, 107, 52, 158,
+            184, 135, 41, 91, 13, 157, 216, 87, 79, 70, 110, 154, 19, 9,
+        ],
+        [
+            79, 134, 215, 209, 161, 228, 162, 74, 17, 227, 169, 26, 65, 40, 189, 70, 253, 44, 93,
+            128, 39, 142, 12, 97, 154, 111, 201, 52, 11, 129, 200, 9,
+        ],
+        [
+            73, 100, 11, 140, 141, 41, 181, 27, 253, 130, 136, 154, 107, 9, 135, 217, 16, 152, 64,
+            77, 175, 250, 164, 120, 110, 201, 44, 94, 10, 74, 233, 42,
+        ],
+        [
+            9, 25, 17, 237, 209, 6, 7, 44, 161, 60, 19, 113, 80, 235, 188, 115, 251, 74, 128, 65,
+            255, 21, 126, 249, 164, 59, 22, 226, 177, 71, 22, 24,
+        ],
+        [
+            34, 100, 239, 148, 80, 7, 119, 217, 234, 64, 187, 147, 240, 200, 246, 154, 249, 100,
+            209, 249, 185, 119, 23, 202, 156, 219, 19, 22, 127, 127, 212, 25,
+        ],
+        [
+            239, 117, 59, 251, 76, 110, 242, 157, 3, 197, 97, 180, 211, 12, 224, 189, 252, 196,
+            171, 31, 104, 172, 244, 239, 53, 75, 208, 126, 41, 144, 59, 49,
+        ],
+        [
+            29, 222, 224, 229, 25, 2, 93, 176, 51, 17, 100, 137, 64, 86, 76, 200, 138, 21, 29, 217,
+            63, 159, 144, 129, 8, 201, 76, 236, 91, 62, 67, 50,
+        ],
+        [
+            24, 21, 241, 5, 210, 159, 87, 84, 200, 22, 175, 154, 87, 212, 37, 148, 23, 160, 175,
+            200, 118, 117, 174, 229, 11, 130, 157, 255, 26, 52, 11, 8,
+        ],
+    ],
+    [
+        [
+            252, 153, 100, 93, 87, 56, 92, 116, 12, 45, 12, 57, 66, 110, 227, 147, 147, 101, 100,
+            0, 10, 181, 178, 164, 21, 13, 180, 13, 89, 248, 205, 7,
+        ],
+        [
+            86, 69, 138, 31, 50, 117, 37, 245, 147, 126, 71, 200, 159, 103, 75, 102, 204, 178, 135,
+            180, 3, 63, 115, 110, 254, 22, 32, 8, 50, 111, 104, 22,
+        ],
+        [
+            66, 78, 49, 221, 153, 235, 211, 155, 58, 202, 119, 231, 206, 30, 248, 215, 223, 171,
+            150, 81, 46, 255, 66, 79, 74, 248, 252, 151, 251, 131, 160, 7,
+        ],
+        [
+            153, 143, 67, 122, 83, 102, 174, 152, 47, 152, 114, 206, 200, 235, 113, 13, 45, 164,
+            174, 214, 19, 129, 73, 211, 103, 185, 237, 210, 68, 157, 11, 24,
+        ],
+        [
+            83, 217, 27, 197, 244, 71, 107, 145, 132, 40, 44, 124, 230, 82, 21, 131, 249, 225, 116,
+            102, 163, 121, 50, 142, 20, 27, 72, 67, 183, 28, 169, 46,
+        ],
+        [
+            56, 15, 117, 133, 19, 226, 237, 94, 34, 153, 237, 147, 143, 59, 163, 126, 83, 107, 102,
+            25, 204, 62, 208, 59, 218, 48, 126, 107, 79, 164, 3, 3,
+        ],
+        [
+            127, 209, 7, 206, 197, 21, 110, 43, 111, 178, 96, 254, 183, 112, 65, 204, 159, 42, 129,
+            127, 147, 172, 175, 22, 114, 1, 144, 109, 70, 51, 246, 28,
+        ],
+        [
+            126, 247, 38, 212, 155, 106, 76, 120, 152, 196, 61, 109, 174, 141, 172, 42, 144, 51,
+            35, 254, 134, 214, 219, 152, 80, 109, 121, 166, 91, 226, 119, 18,
+        ],
+    ],
+    [
+        [
+            131, 89, 210, 253, 224, 36, 151, 136, 156, 86, 88, 23, 205, 83, 177, 59, 106, 12, 16,
+            233, 183, 197, 90, 203, 29, 196, 1, 237, 224, 223, 99, 15,
+        ],
+        [
+            224, 204, 224, 17, 99, 37, 205, 45, 255, 41, 69, 6, 204, 226, 63, 14, 180, 116, 248,
+            184, 82, 55, 19, 160, 151, 69, 187, 35, 87, 120, 132, 15,
+        ],
+        [
+            125, 177, 114, 23, 209, 68, 219, 141, 142, 186, 25, 218, 57, 226, 190, 210, 45, 94,
+            196, 39, 20, 233, 122, 93, 225, 23, 220, 158, 192, 78, 152, 24,
+        ],
+        [
+            57, 56, 40, 61, 97, 131, 104, 4, 240, 109, 227, 75, 152, 44, 242, 243, 188, 45, 229,
+            118, 46, 27, 180, 167, 240, 224, 124, 15, 143, 50, 225, 6,
+        ],
+        [
+            53, 16, 46, 178, 58, 24, 197, 247, 42, 220, 177, 47, 133, 95, 81, 61, 134, 28, 220,
+            184, 45, 12, 121, 18, 174, 234, 250, 124, 46, 190, 104, 19,
+        ],
+        [
+            38, 156, 61, 146, 163, 231, 91, 107, 19, 123, 200, 192, 85, 173, 156, 34, 44, 66, 161,
+            83, 221, 166, 70, 51, 85, 232, 243, 252, 162, 18, 15, 56,
+        ],
+        [
+            123, 18, 87, 200, 196, 100, 121, 223, 151, 195, 24, 144, 131, 124, 56, 229, 199, 83,
+            183, 137, 62, 154, 247, 40, 76, 135, 146, 9, 103, 5, 68, 33,
+        ],
+        [
+            184, 165, 230, 0, 109, 19, 115, 70, 25, 102, 2, 138, 190, 210, 62, 196, 27, 76, 57, 31,
+            127, 78, 172, 163, 114, 236, 24, 224, 54, 31, 4, 45,
+        ],
+    ],
+    [
+        [
+            138, 133, 77, 92, 247, 250, 141, 156, 66, 158, 130, 208, 243, 85, 97, 12, 47, 187, 101,
+            220, 195, 14, 119, 254, 22, 0, 119, 0, 247, 177, 238, 18,
+        ],
+        [
+            202, 128, 126, 221, 182, 213, 55, 69, 34, 2, 42, 251, 22, 177, 35, 130, 132, 199, 33,
+            5, 210, 99, 140, 214, 159, 25, 136, 202, 160, 255, 153, 29,
+        ],
+        [
+            8, 156, 183, 206, 52, 122, 127, 243, 45, 216, 68, 38, 215, 206, 139, 166, 196, 43, 58,
+            250, 200, 141, 58, 74, 28, 236, 244, 39, 167, 34, 55, 26,
+        ],
+        [
+            174, 91, 180, 80, 186, 115, 38, 145, 115, 89, 5, 138, 189, 53, 49, 203, 52, 86, 205,
+            123, 164, 146, 169, 110, 119, 202, 249, 86, 19, 179, 89, 60,
+        ],
+        [
+            135, 230, 4, 37, 38, 213, 28, 78, 101, 215, 177, 207, 184, 98, 242, 130, 215, 189, 209,
+            198, 171, 165, 39, 79, 18, 196, 43, 75, 85, 32, 191, 46,
+        ],
+        [
+            121, 226, 59, 93, 13, 120, 205, 138, 103, 215, 23, 193, 170, 191, 103, 45, 154, 1, 76,
+            213, 25, 118, 23, 228, 233, 180, 229, 181, 61, 104, 52, 14,
+        ],
+        [
+            4, 161, 12, 147, 13, 60, 20, 82, 53, 224, 72, 90, 102, 123, 77, 85, 31, 11, 131, 50,
+            41, 88, 50, 22, 149, 35, 29, 142, 247, 84, 135, 16,
+        ],
+        [
+            196, 43, 149, 199, 167, 192, 232, 239, 9, 9, 110, 4, 148, 64, 58, 97, 207, 253, 80,
+            247, 228, 179, 121, 4, 183, 162, 169, 120, 200, 254, 109, 35,
+        ],
+    ],
+    [
+        [
+            217, 164, 120, 31, 248, 243, 75, 91, 94, 55, 138, 226, 220, 92, 79, 18, 59, 193, 156,
+            126, 26, 222, 103, 8, 250, 221, 211, 68, 177, 71, 133, 11,
+        ],
+        [
+            34, 78, 160, 92, 3, 181, 43, 166, 227, 79, 153, 125, 39, 253, 0, 135, 22, 125, 102,
+            161, 212, 195, 132, 46, 25, 132, 4, 234, 198, 43, 85, 49,
+        ],
+        [
+            133, 39, 163, 244, 250, 113, 200, 90, 202, 172, 126, 52, 182, 135, 223, 43, 6, 214,
+            135, 140, 239, 172, 1, 36, 37, 93, 212, 96, 74, 51, 189, 10,
+        ],
+        [
+            126, 177, 236, 150, 50, 183, 198, 85, 154, 215, 89, 75, 4, 57, 211, 33, 179, 220, 253,
+            182, 13, 65, 218, 80, 132, 54, 222, 214, 52, 39, 198, 7,
+        ],
+        [
+            133, 246, 57, 187, 96, 68, 33, 138, 75, 185, 97, 210, 2, 89, 238, 63, 73, 39, 51, 58,
+            242, 125, 16, 9, 91, 94, 243, 69, 35, 42, 136, 9,
+        ],
+        [
+            149, 191, 120, 245, 46, 159, 66, 53, 67, 200, 107, 196, 86, 191, 234, 195, 140, 23,
+            152, 5, 213, 125, 61, 250, 113, 227, 62, 153, 193, 198, 62, 23,
+        ],
+        [
+            181, 92, 7, 115, 101, 203, 87, 170, 108, 11, 133, 229, 209, 88, 235, 9, 211, 0, 34,
+            128, 143, 32, 158, 16, 55, 100, 222, 242, 247, 39, 217, 41,
+        ],
+        [
+            176, 9, 186, 146, 2, 201, 229, 116, 61, 190, 159, 129, 11, 22, 215, 50, 181, 105, 128,
+            91, 161, 104, 19, 214, 144, 254, 225, 169, 186, 237, 100, 32,
+        ],
+    ],
+    [
+        [
+            40, 7, 199, 148, 140, 28, 231, 90, 252, 187, 127, 106, 225, 109, 28, 74, 174, 202, 162,
+            233, 111, 25, 39, 121, 86, 188, 166, 60, 26, 192, 125, 23,
+        ],
+        [
+            29, 191, 141, 163, 214, 37, 63, 14, 117, 75, 249, 36, 245, 31, 107, 34, 130, 14, 5,
+            129, 145, 43, 255, 54, 59, 211, 77, 194, 248, 213, 122, 10,
+        ],
+        [
+            90, 72, 79, 149, 87, 28, 38, 255, 171, 49, 255, 93, 202, 66, 30, 225, 2, 33, 50, 59,
+            167, 22, 89, 84, 195, 250, 231, 41, 48, 59, 54, 54,
+        ],
+        [
+            52, 242, 43, 225, 153, 145, 156, 46, 4, 211, 112, 65, 19, 141, 52, 99, 139, 149, 190,
+            143, 143, 57, 228, 85, 0, 67, 199, 163, 60, 171, 182, 2,
+        ],
+        [
+            6, 134, 104, 87, 111, 169, 74, 7, 110, 63, 55, 7, 135, 154, 171, 179, 33, 64, 254, 160,
+            90, 79, 218, 218, 147, 45, 244, 115, 21, 71, 63, 54,
+        ],
+        [
+            182, 244, 16, 171, 5, 16, 178, 183, 14, 152, 205, 29, 128, 93, 92, 17, 206, 47, 111,
+            155, 27, 164, 23, 21, 13, 125, 119, 240, 170, 148, 16, 53,
+        ],
+        [
+            78, 4, 253, 34, 167, 129, 30, 5, 1, 146, 243, 55, 152, 9, 74, 73, 26, 199, 175, 138,
+            162, 181, 235, 238, 158, 40, 157, 162, 8, 163, 63, 29,
+        ],
+        [
+            159, 213, 249, 32, 115, 186, 250, 55, 240, 55, 181, 229, 106, 166, 99, 149, 114, 141,
+            239, 154, 192, 4, 127, 64, 247, 172, 240, 23, 243, 109, 102, 16,
+        ],
+    ],
+    [
+        [
+            208, 62, 192, 255, 179, 46, 237, 29, 32, 212, 88, 59, 32, 109, 116, 45, 150, 40, 251,
+            132, 136, 88, 63, 10, 111, 34, 102, 42, 7, 106, 48, 30,
+        ],
+        [
+            235, 194, 35, 149, 132, 244, 37, 88, 78, 71, 224, 63, 246, 169, 172, 201, 131, 7, 57,
+            88, 91, 199, 146, 170, 188, 167, 141, 1, 40, 121, 209, 61,
+        ],
+        [
+            50, 65, 193, 19, 111, 120, 148, 118, 147, 240, 246, 104, 72, 174, 113, 54, 201, 144,
+            17, 98, 92, 11, 113, 250, 183, 114, 0, 74, 134, 20, 217, 47,
+        ],
+        [
+            87, 190, 24, 114, 241, 193, 159, 122, 102, 3, 11, 48, 61, 248, 75, 21, 92, 19, 224,
+            163, 186, 64, 204, 3, 37, 86, 103, 31, 53, 49, 204, 62,
+        ],
+        [
+            137, 116, 208, 75, 219, 108, 60, 61, 85, 214, 112, 149, 190, 75, 153, 174, 134, 62,
+            187, 183, 63, 151, 51, 41, 250, 231, 194, 99, 131, 71, 91, 57,
+        ],
+        [
+            214, 76, 152, 156, 14, 135, 169, 54, 244, 66, 31, 124, 203, 249, 203, 238, 149, 193,
+            165, 38, 141, 78, 15, 161, 59, 180, 218, 91, 96, 75, 3, 42,
+        ],
+        [
+            9, 219, 89, 115, 107, 140, 184, 162, 172, 175, 14, 145, 179, 159, 157, 5, 36, 112, 255,
+            25, 134, 192, 252, 32, 94, 23, 81, 146, 187, 238, 88, 59,
+        ],
+        [
+            226, 191, 50, 112, 133, 132, 199, 142, 252, 89, 92, 227, 45, 129, 181, 217, 107, 158,
+            105, 62, 76, 104, 15, 6, 219, 239, 88, 28, 104, 248, 0, 39,
+        ],
+    ],
+    [
+        [
+            135, 78, 215, 34, 105, 20, 88, 1, 116, 251, 173, 74, 81, 101, 102, 140, 171, 42, 13,
+            54, 241, 73, 104, 41, 94, 167, 87, 232, 13, 15, 171, 6,
+        ],
+        [
+            18, 88, 231, 231, 168, 128, 81, 148, 23, 38, 172, 207, 34, 73, 241, 215, 221, 119, 64,
+            126, 107, 176, 138, 251, 112, 72, 252, 250, 245, 48, 36, 32,
+        ],
+        [
+            20, 44, 38, 7, 55, 71, 118, 91, 105, 195, 150, 14, 32, 211, 187, 89, 108, 224, 153,
+            109, 204, 72, 160, 152, 23, 199, 155, 84, 53, 183, 30, 17,
+        ],
+        [
+            244, 232, 165, 147, 219, 157, 69, 181, 173, 36, 94, 183, 49, 16, 68, 180, 203, 232,
+            159, 198, 107, 174, 162, 163, 135, 203, 109, 106, 71, 28, 132, 54,
+        ],
+        [
+            128, 32, 218, 132, 20, 69, 199, 166, 54, 131, 78, 244, 246, 161, 200, 50, 62, 90, 228,
+            51, 26, 1, 225, 211, 41, 51, 115, 34, 4, 184, 7, 29,
+        ],
+        [
+            77, 46, 225, 194, 127, 232, 30, 240, 158, 194, 26, 28, 221, 172, 60, 118, 248, 174,
+            218, 183, 52, 107, 113, 40, 234, 106, 137, 58, 251, 190, 14, 47,
+        ],
+        [
+            84, 208, 14, 230, 33, 132, 17, 151, 159, 240, 47, 66, 226, 210, 183, 101, 220, 32, 19,
+            175, 47, 156, 100, 55, 2, 45, 224, 187, 154, 232, 63, 45,
+        ],
+        [
+            38, 3, 199, 23, 232, 121, 90, 88, 192, 71, 149, 125, 160, 140, 92, 248, 244, 52, 250,
+            237, 159, 240, 87, 131, 206, 103, 57, 231, 240, 126, 44, 8,
+        ],
+    ],
+    [
+        [
+            121, 185, 230, 118, 95, 189, 254, 13, 234, 203, 79, 140, 250, 63, 61, 205, 108, 239,
+            89, 178, 242, 36, 237, 131, 191, 178, 198, 57, 106, 146, 208, 2,
+        ],
+        [
+            254, 175, 112, 227, 155, 33, 74, 141, 22, 57, 159, 5, 129, 57, 239, 27, 96, 22, 86, 8,
+            223, 241, 173, 226, 171, 232, 32, 45, 158, 169, 2, 25,
+        ],
+        [
+            21, 46, 93, 77, 133, 253, 127, 147, 1, 240, 85, 211, 36, 215, 94, 13, 26, 253, 25, 72,
+            67, 90, 229, 7, 174, 236, 233, 250, 65, 217, 124, 51,
+        ],
+        [
+            213, 61, 22, 32, 180, 27, 96, 10, 216, 12, 135, 161, 36, 223, 176, 137, 197, 99, 83,
+            215, 58, 242, 191, 192, 84, 236, 195, 12, 141, 45, 215, 23,
+        ],
+        [
+            147, 199, 116, 205, 253, 64, 71, 177, 48, 220, 174, 145, 113, 191, 60, 31, 60, 171, 79,
+            86, 141, 122, 89, 188, 252, 100, 42, 127, 193, 98, 172, 43,
+        ],
+        [
+            83, 40, 233, 182, 200, 135, 94, 11, 109, 77, 241, 71, 248, 64, 10, 227, 84, 146, 205,
+            168, 77, 57, 138, 34, 128, 201, 16, 115, 35, 244, 147, 0,
+        ],
+        [
+            8, 124, 97, 197, 83, 77, 42, 95, 91, 69, 173, 108, 237, 215, 44, 211, 28, 202, 237, 0,
+            22, 248, 104, 213, 146, 245, 52, 221, 218, 26, 160, 62,
+        ],
+        [
+            46, 200, 28, 76, 156, 255, 239, 240, 233, 131, 252, 96, 12, 144, 56, 163, 52, 116, 162,
+            59, 149, 1, 133, 107, 190, 132, 233, 235, 230, 244, 231, 49,
+        ],
+    ],
+    [
+        [
+            131, 244, 147, 237, 104, 133, 117, 169, 82, 239, 134, 219, 21, 106, 10, 250, 191, 18,
+            211, 97, 10, 161, 87, 187, 16, 85, 107, 192, 9, 17, 208, 44,
+        ],
+        [
+            129, 156, 210, 98, 148, 44, 136, 246, 152, 130, 74, 18, 3, 30, 242, 12, 155, 8, 49,
+            245, 49, 215, 93, 167, 0, 8, 213, 68, 9, 38, 113, 53,
+        ],
+        [
+            114, 214, 69, 108, 113, 73, 81, 37, 251, 91, 43, 99, 248, 39, 99, 40, 85, 223, 101, 78,
+            243, 170, 160, 149, 155, 104, 14, 78, 97, 248, 37, 57,
+        ],
+        [
+            77, 232, 118, 221, 50, 130, 124, 90, 91, 140, 68, 158, 193, 229, 180, 176, 151, 167,
+            148, 141, 46, 104, 179, 55, 57, 142, 216, 23, 141, 196, 236, 54,
+        ],
+        [
+            198, 180, 66, 160, 132, 49, 199, 243, 237, 240, 166, 225, 99, 37, 155, 24, 179, 113,
+            199, 80, 80, 132, 32, 52, 251, 211, 162, 116, 170, 203, 81, 42,
+        ],
+        [
+            241, 79, 65, 222, 239, 74, 64, 122, 34, 93, 203, 102, 251, 103, 65, 233, 204, 203, 192,
+            245, 189, 251, 1, 151, 128, 157, 182, 203, 193, 102, 27, 23,
+        ],
+        [
+            60, 20, 8, 87, 8, 19, 211, 166, 63, 239, 146, 164, 49, 67, 11, 133, 95, 9, 182, 199,
+            17, 86, 113, 170, 168, 83, 77, 230, 81, 201, 238, 13,
+        ],
+        [
+            68, 167, 166, 81, 81, 66, 93, 73, 185, 91, 178, 215, 84, 163, 122, 201, 149, 247, 161,
+            87, 127, 103, 79, 29, 14, 199, 44, 247, 33, 123, 183, 38,
+        ],
+    ],
+    [
+        [
+            143, 198, 147, 9, 216, 184, 32, 238, 248, 95, 47, 180, 248, 117, 252, 150, 150, 89,
+            148, 161, 187, 47, 61, 225, 246, 154, 106, 101, 128, 51, 151, 12,
+        ],
+        [
+            38, 250, 166, 101, 235, 31, 63, 68, 193, 170, 168, 34, 52, 63, 97, 98, 214, 229, 31,
+            74, 233, 172, 22, 81, 196, 245, 11, 111, 44, 98, 185, 1,
+        ],
+        [
+            141, 209, 110, 148, 171, 39, 157, 235, 89, 173, 140, 216, 148, 1, 175, 157, 227, 104,
+            210, 112, 66, 160, 156, 124, 27, 102, 120, 142, 149, 110, 148, 12,
+        ],
+        [
+            71, 30, 90, 107, 232, 6, 151, 1, 6, 25, 188, 6, 31, 64, 184, 104, 184, 216, 57, 92,
+            230, 236, 169, 238, 77, 38, 45, 165, 162, 162, 252, 7,
+        ],
+        [
+            136, 10, 204, 99, 83, 109, 73, 101, 61, 41, 237, 197, 0, 232, 185, 168, 79, 128, 191,
+            219, 87, 14, 163, 244, 0, 145, 72, 199, 11, 55, 218, 38,
+        ],
+        [
+            246, 115, 92, 44, 64, 216, 74, 82, 132, 50, 82, 211, 56, 171, 176, 137, 24, 110, 103,
+            158, 46, 158, 151, 154, 132, 254, 220, 180, 5, 120, 72, 10,
+        ],
+        [
+            30, 159, 81, 104, 246, 32, 96, 43, 152, 44, 150, 221, 165, 14, 162, 61, 30, 166, 133,
+            194, 104, 127, 76, 214, 122, 89, 109, 2, 219, 232, 185, 5,
+        ],
+        [
+            138, 10, 208, 162, 118, 236, 11, 68, 180, 213, 38, 108, 145, 79, 115, 185, 231, 51, 84,
+            160, 104, 136, 76, 142, 201, 121, 111, 41, 3, 126, 71, 52,
+        ],
+    ],
+    [
+        [
+            146, 172, 178, 233, 212, 141, 180, 76, 211, 173, 0, 136, 102, 215, 35, 18, 210, 57,
+            230, 203, 52, 90, 73, 253, 90, 56, 84, 206, 187, 227, 139, 51,
+        ],
+        [
+            12, 172, 149, 245, 3, 108, 117, 73, 133, 51, 161, 59, 203, 181, 112, 71, 115, 193, 65,
+            135, 234, 163, 80, 138, 170, 33, 62, 175, 158, 128, 5, 62,
+        ],
+        [
+            133, 76, 138, 32, 247, 244, 21, 235, 18, 19, 89, 83, 65, 116, 151, 3, 0, 132, 125, 21,
+            220, 165, 25, 140, 77, 25, 235, 191, 41, 144, 142, 54,
+        ],
+        [
+            234, 91, 142, 174, 106, 23, 132, 53, 16, 96, 217, 122, 84, 117, 226, 87, 131, 59, 157,
+            78, 201, 217, 103, 134, 14, 141, 193, 42, 17, 135, 118, 3,
+        ],
+        [
+            60, 209, 64, 222, 188, 72, 228, 235, 152, 155, 14, 252, 73, 49, 37, 168, 181, 101, 219,
+            232, 169, 55, 171, 90, 138, 159, 181, 180, 41, 195, 41, 48,
+        ],
+        [
+            153, 0, 87, 75, 203, 95, 71, 181, 161, 183, 42, 85, 14, 77, 220, 46, 138, 157, 229,
+            178, 159, 144, 57, 24, 238, 125, 128, 79, 134, 222, 64, 61,
+        ],
+        [
+            51, 123, 20, 217, 230, 53, 195, 7, 147, 10, 229, 20, 147, 206, 100, 197, 88, 73, 14,
+            211, 138, 72, 211, 100, 184, 62, 149, 254, 53, 140, 211, 38,
+        ],
+        [
+            125, 218, 238, 203, 197, 139, 19, 248, 119, 73, 85, 241, 205, 20, 187, 100, 110, 150,
+            80, 176, 39, 83, 85, 44, 160, 209, 47, 240, 119, 195, 98, 9,
+        ],
+    ],
+    [
+        [
+            225, 193, 188, 61, 63, 105, 192, 160, 101, 114, 91, 50, 187, 102, 91, 202, 144, 99, 48,
+            178, 235, 57, 151, 190, 202, 221, 26, 129, 39, 222, 144, 13,
+        ],
+        [
+            214, 4, 119, 107, 105, 182, 45, 196, 47, 123, 78, 115, 118, 142, 134, 160, 176, 161,
+            175, 251, 249, 25, 123, 177, 39, 236, 198, 98, 166, 14, 35, 47,
+        ],
+        [
+            227, 146, 231, 46, 217, 182, 26, 134, 224, 88, 174, 142, 210, 131, 27, 217, 90, 20,
+            169, 93, 202, 238, 30, 17, 75, 25, 218, 94, 117, 74, 98, 28,
+        ],
+        [
+            211, 62, 181, 29, 241, 231, 74, 132, 58, 71, 13, 180, 216, 120, 215, 208, 191, 166,
+            110, 238, 239, 129, 248, 13, 11, 70, 25, 173, 118, 194, 208, 38,
+        ],
+        [
+            66, 6, 102, 187, 1, 88, 189, 123, 109, 200, 226, 193, 103, 248, 134, 154, 16, 188, 82,
+            145, 255, 211, 203, 237, 25, 60, 201, 58, 159, 125, 47, 51,
+        ],
+        [
+            92, 174, 73, 174, 127, 71, 106, 23, 242, 24, 143, 255, 40, 70, 242, 75, 236, 158, 165,
+            248, 142, 147, 103, 167, 116, 17, 171, 193, 247, 38, 196, 17,
+        ],
+        [
+            195, 200, 231, 140, 158, 101, 132, 162, 20, 214, 89, 132, 144, 2, 45, 206, 161, 228,
+            31, 197, 107, 84, 171, 48, 231, 66, 103, 57, 182, 100, 148, 9,
+        ],
+        [
+            91, 239, 228, 202, 109, 58, 224, 173, 255, 33, 238, 51, 252, 38, 7, 104, 68, 71, 61,
+            50, 61, 234, 52, 125, 225, 246, 120, 198, 204, 251, 42, 21,
+        ],
+    ],
+    [
+        [
+            227, 156, 120, 101, 157, 6, 24, 17, 138, 120, 0, 7, 99, 255, 30, 170, 247, 10, 28, 78,
+            237, 183, 120, 0, 36, 150, 114, 5, 52, 27, 118, 43,
+        ],
+        [
+            89, 179, 59, 45, 37, 224, 161, 148, 170, 242, 21, 93, 17, 112, 56, 87, 146, 224, 32,
+            16, 205, 72, 120, 24, 201, 226, 101, 138, 140, 191, 35, 60,
+        ],
+        [
+            101, 246, 160, 36, 45, 192, 37, 250, 141, 131, 166, 105, 246, 253, 183, 78, 45, 17,
+            224, 198, 219, 4, 184, 41, 159, 25, 227, 42, 184, 110, 168, 47,
+        ],
+        [
+            254, 68, 240, 20, 227, 67, 252, 227, 74, 173, 78, 4, 237, 230, 36, 46, 168, 242, 97,
+            165, 41, 179, 234, 114, 25, 118, 188, 115, 134, 176, 144, 56,
+        ],
+        [
+            136, 19, 168, 231, 61, 23, 128, 30, 218, 186, 214, 182, 64, 202, 240, 242, 242, 27,
+            190, 68, 139, 239, 118, 209, 45, 102, 252, 42, 203, 47, 190, 46,
+        ],
+        [
+            43, 185, 227, 112, 96, 91, 133, 107, 201, 158, 93, 223, 207, 3, 3, 113, 129, 81, 103,
+            112, 200, 142, 133, 213, 205, 249, 61, 35, 223, 149, 94, 46,
+        ],
+        [
+            21, 9, 170, 210, 27, 219, 51, 217, 231, 84, 155, 179, 113, 211, 235, 30, 198, 178, 115,
+            212, 243, 76, 239, 4, 80, 205, 216, 210, 216, 162, 54, 16,
+        ],
+        [
+            241, 46, 223, 153, 180, 201, 195, 235, 159, 17, 89, 184, 132, 27, 147, 66, 9, 118, 156,
+            32, 63, 60, 231, 176, 17, 181, 136, 199, 185, 156, 85, 49,
+        ],
+    ],
+    [
+        [
+            16, 63, 29, 234, 36, 248, 169, 46, 117, 122, 16, 213, 80, 112, 195, 180, 35, 236, 79,
+            11, 161, 39, 231, 149, 76, 182, 68, 223, 211, 132, 105, 60,
+        ],
+        [
+            90, 185, 155, 250, 193, 255, 242, 96, 46, 32, 211, 85, 104, 146, 242, 203, 136, 215,
+            207, 249, 156, 165, 186, 101, 172, 94, 196, 196, 215, 90, 242, 18,
+        ],
+        [
+            197, 35, 232, 78, 110, 178, 187, 0, 86, 140, 77, 150, 2, 34, 10, 28, 36, 222, 5, 126,
+            195, 84, 209, 117, 171, 224, 207, 178, 246, 55, 19, 23,
+        ],
+        [
+            7, 92, 45, 201, 159, 244, 184, 81, 84, 15, 16, 47, 29, 88, 220, 15, 84, 114, 193, 25,
+            178, 137, 226, 153, 49, 173, 132, 75, 132, 245, 35, 46,
+        ],
+        [
+            72, 45, 4, 235, 41, 35, 82, 6, 47, 12, 192, 121, 4, 244, 109, 216, 187, 189, 132, 96,
+            53, 230, 169, 219, 247, 118, 128, 25, 76, 227, 229, 21,
+        ],
+        [
+            11, 120, 128, 125, 181, 136, 90, 219, 125, 105, 13, 176, 160, 59, 54, 96, 25, 244, 122,
+            151, 1, 182, 7, 118, 193, 158, 96, 250, 212, 93, 136, 17,
+        ],
+        [
+            133, 10, 151, 153, 67, 142, 158, 17, 179, 30, 169, 96, 248, 213, 174, 250, 243, 228,
+            222, 11, 57, 109, 208, 34, 21, 91, 222, 40, 95, 116, 158, 42,
+        ],
+        [
+            144, 89, 121, 13, 187, 123, 87, 232, 28, 81, 15, 255, 80, 167, 8, 245, 134, 94, 176,
+            29, 69, 112, 191, 43, 174, 0, 147, 222, 94, 154, 107, 31,
+        ],
+    ],
+    [
+        [
+            30, 133, 165, 235, 190, 92, 40, 23, 196, 48, 17, 234, 31, 38, 10, 244, 66, 89, 244, 71,
+            136, 178, 252, 70, 108, 251, 8, 218, 62, 6, 12, 13,
+        ],
+        [
+            181, 217, 82, 12, 171, 165, 231, 168, 153, 34, 248, 106, 105, 24, 128, 34, 58, 33, 186,
+            213, 180, 153, 142, 141, 191, 219, 10, 88, 38, 80, 62, 2,
+        ],
+        [
+            3, 56, 194, 11, 68, 15, 132, 139, 250, 136, 196, 236, 244, 49, 232, 78, 78, 146, 217,
+            164, 195, 179, 210, 41, 198, 109, 232, 241, 142, 158, 120, 60,
+        ],
+        [
+            253, 122, 255, 208, 56, 178, 103, 118, 227, 193, 99, 164, 224, 85, 254, 159, 53, 45,
+            22, 186, 84, 156, 59, 10, 161, 181, 242, 40, 37, 167, 101, 14,
+        ],
+        [
+            170, 6, 86, 213, 88, 160, 229, 166, 21, 23, 82, 239, 180, 219, 65, 204, 51, 125, 82,
+            37, 217, 255, 248, 143, 97, 148, 22, 63, 59, 77, 172, 52,
+        ],
+        [
+            7, 111, 62, 154, 249, 48, 164, 29, 197, 139, 4, 132, 101, 228, 166, 111, 64, 212, 112,
+            92, 112, 133, 134, 100, 31, 126, 163, 217, 28, 154, 7, 10,
+        ],
+        [
+            16, 149, 13, 107, 255, 13, 114, 211, 25, 178, 249, 249, 126, 248, 167, 165, 239, 25,
+            152, 131, 140, 1, 109, 226, 30, 201, 210, 45, 192, 187, 195, 60,
+        ],
+        [
+            61, 150, 128, 112, 101, 124, 178, 16, 66, 126, 64, 241, 36, 2, 50, 130, 115, 227, 191,
+            51, 67, 137, 99, 202, 20, 115, 217, 8, 39, 161, 233, 10,
+        ],
+    ],
+    [
+        [
+            7, 91, 172, 227, 110, 194, 188, 240, 45, 58, 80, 180, 3, 254, 196, 195, 236, 211, 65,
+            120, 5, 170, 255, 3, 147, 252, 203, 94, 252, 67, 122, 45,
+        ],
+        [
+            101, 45, 123, 17, 211, 232, 240, 59, 210, 231, 30, 102, 247, 0, 185, 30, 255, 221, 153,
+            5, 173, 39, 166, 43, 26, 10, 173, 70, 17, 22, 169, 37,
+        ],
+        [
+            244, 80, 93, 226, 138, 172, 42, 204, 223, 176, 65, 190, 234, 140, 110, 167, 78, 238,
+            121, 100, 83, 24, 22, 229, 43, 230, 35, 182, 193, 93, 241, 13,
+        ],
+        [
+            40, 243, 125, 169, 93, 224, 111, 219, 8, 17, 241, 43, 153, 177, 12, 105, 193, 98, 163,
+            245, 54, 245, 241, 129, 42, 96, 240, 40, 196, 125, 248, 24,
+        ],
+        [
+            222, 158, 22, 92, 0, 102, 141, 6, 180, 153, 231, 232, 45, 5, 103, 172, 163, 27, 143,
+            240, 1, 243, 81, 122, 56, 142, 106, 205, 104, 219, 225, 40,
+        ],
+        [
+            113, 135, 24, 191, 205, 226, 63, 197, 101, 190, 0, 172, 160, 174, 236, 156, 179, 148,
+            128, 21, 127, 99, 19, 124, 27, 134, 120, 87, 48, 237, 244, 8,
+        ],
+        [
+            165, 118, 169, 41, 44, 57, 144, 54, 148, 117, 151, 165, 73, 209, 197, 162, 122, 129,
+            197, 73, 137, 248, 65, 137, 77, 187, 30, 54, 229, 62, 134, 9,
+        ],
+        [
+            235, 36, 130, 170, 81, 34, 149, 86, 235, 75, 240, 162, 216, 136, 174, 84, 169, 62, 208,
+            43, 212, 112, 204, 11, 242, 100, 111, 183, 20, 81, 103, 21,
+        ],
+    ],
+    [
+        [
+            69, 81, 105, 6, 179, 69, 132, 229, 251, 152, 83, 207, 7, 150, 148, 76, 118, 19, 77,
+            127, 197, 153, 52, 135, 5, 173, 199, 50, 172, 148, 240, 6,
+        ],
+        [
+            169, 73, 220, 22, 85, 117, 145, 40, 30, 80, 252, 140, 241, 71, 106, 187, 255, 19, 109,
+            24, 119, 194, 152, 102, 216, 102, 146, 61, 127, 23, 154, 8,
+        ],
+        [
+            67, 230, 84, 76, 200, 132, 151, 89, 246, 255, 51, 98, 217, 150, 32, 12, 179, 115, 164,
+            159, 240, 221, 100, 73, 215, 168, 61, 234, 33, 105, 80, 53,
+        ],
+        [
+            155, 123, 14, 229, 134, 242, 1, 66, 61, 136, 191, 36, 194, 117, 41, 185, 52, 239, 241,
+            89, 111, 60, 84, 126, 97, 45, 52, 194, 115, 90, 244, 41,
+        ],
+        [
+            47, 224, 100, 95, 184, 27, 152, 43, 14, 105, 24, 229, 40, 94, 231, 253, 136, 67, 97,
+            19, 139, 79, 52, 55, 208, 164, 206, 103, 93, 179, 49, 37,
+        ],
+        [
+            137, 28, 107, 166, 19, 3, 10, 137, 179, 248, 144, 129, 62, 138, 174, 40, 237, 112, 154,
+            187, 244, 126, 56, 209, 254, 195, 153, 32, 248, 146, 55, 25,
+        ],
+        [
+            28, 146, 146, 196, 134, 69, 193, 92, 102, 51, 189, 99, 24, 109, 22, 88, 189, 170, 218,
+            201, 146, 81, 245, 19, 95, 168, 181, 193, 4, 35, 77, 13,
+        ],
+        [
+            231, 152, 17, 26, 137, 49, 95, 140, 143, 240, 151, 215, 118, 240, 153, 94, 214, 99, 17,
+            203, 166, 250, 120, 226, 231, 74, 141, 20, 212, 20, 198, 10,
+        ],
+    ],
+    [
+        [
+            201, 36, 247, 251, 228, 99, 121, 198, 220, 187, 83, 50, 200, 54, 242, 88, 65, 214, 227,
+            76, 161, 238, 84, 184, 149, 41, 12, 124, 34, 236, 97, 59,
+        ],
+        [
+            126, 74, 151, 14, 16, 110, 166, 2, 235, 52, 43, 240, 222, 178, 145, 101, 104, 153, 171,
+            153, 93, 82, 21, 76, 37, 55, 5, 176, 118, 67, 19, 27,
+        ],
+        [
+            208, 113, 45, 31, 250, 171, 238, 119, 191, 57, 114, 133, 71, 167, 168, 207, 97, 125,
+            235, 44, 135, 224, 75, 206, 215, 143, 56, 111, 117, 215, 25, 21,
+        ],
+        [
+            247, 158, 25, 107, 7, 121, 254, 119, 228, 136, 246, 2, 15, 160, 69, 180, 190, 134, 179,
+            204, 64, 242, 118, 216, 121, 118, 35, 55, 57, 95, 110, 25,
+        ],
+        [
+            149, 84, 210, 56, 93, 110, 28, 177, 219, 155, 235, 168, 137, 141, 71, 114, 129, 55,
+            141, 177, 20, 180, 47, 26, 123, 157, 159, 133, 225, 81, 103, 47,
+        ],
+        [
+            215, 28, 126, 174, 218, 158, 19, 78, 226, 193, 168, 64, 223, 102, 211, 44, 25, 205, 14,
+            129, 65, 95, 189, 107, 107, 229, 97, 5, 86, 67, 37, 60,
+        ],
+        [
+            23, 91, 47, 107, 133, 237, 134, 217, 123, 232, 136, 140, 222, 76, 114, 80, 248, 160,
+            164, 212, 125, 157, 97, 81, 215, 159, 52, 135, 100, 153, 7, 26,
+        ],
+        [
+            192, 235, 48, 8, 201, 70, 70, 145, 16, 213, 165, 6, 236, 57, 71, 204, 39, 134, 61, 192,
+            139, 24, 175, 21, 108, 244, 90, 67, 206, 102, 17, 20,
+        ],
+    ],
+    [
+        [
+            59, 227, 100, 216, 15, 248, 10, 182, 89, 182, 173, 216, 232, 218, 171, 125, 44, 162,
+            99, 204, 165, 177, 157, 62, 219, 33, 124, 190, 160, 248, 193, 60,
+        ],
+        [
+            138, 137, 214, 237, 224, 227, 132, 212, 18, 215, 128, 173, 12, 134, 162, 2, 89, 17, 69,
+            88, 50, 193, 21, 158, 85, 194, 228, 207, 209, 15, 48, 56,
+        ],
+        [
+            235, 131, 4, 17, 94, 133, 194, 205, 154, 120, 81, 80, 60, 240, 201, 125, 250, 1, 149,
+            179, 58, 228, 68, 71, 224, 15, 212, 181, 170, 9, 135, 47,
+        ],
+        [
+            30, 162, 68, 164, 134, 183, 89, 52, 42, 138, 32, 99, 53, 176, 204, 80, 128, 32, 205,
+            64, 177, 197, 186, 93, 239, 127, 63, 219, 19, 200, 132, 5,
+        ],
+        [
+            255, 30, 56, 241, 97, 130, 220, 188, 77, 45, 179, 149, 97, 23, 65, 112, 235, 24, 127,
+            22, 204, 191, 181, 164, 28, 238, 158, 188, 52, 52, 239, 9,
+        ],
+        [
+            117, 70, 55, 141, 159, 39, 198, 73, 18, 25, 171, 142, 26, 7, 61, 178, 86, 181, 136, 11,
+            80, 110, 226, 235, 152, 116, 119, 80, 9, 77, 171, 1,
+        ],
+        [
+            145, 166, 166, 110, 183, 126, 211, 28, 74, 99, 88, 1, 60, 143, 245, 37, 61, 107, 94,
+            172, 101, 87, 64, 150, 89, 87, 23, 159, 223, 49, 13, 22,
+        ],
+        [
+            102, 212, 116, 255, 19, 29, 250, 185, 75, 229, 219, 55, 220, 164, 195, 61, 45, 46, 245,
+            119, 79, 113, 47, 229, 242, 74, 172, 24, 189, 248, 222, 35,
+        ],
+    ],
+    [
+        [
+            178, 128, 66, 22, 136, 89, 154, 163, 11, 60, 6, 113, 119, 121, 188, 80, 127, 170, 10,
+            61, 221, 229, 163, 217, 4, 206, 79, 88, 105, 222, 53, 9,
+        ],
+        [
+            185, 239, 123, 80, 135, 216, 219, 192, 225, 181, 44, 19, 223, 11, 150, 61, 21, 13, 170,
+            149, 8, 147, 248, 57, 43, 1, 222, 231, 81, 172, 49, 31,
+        ],
+        [
+            88, 32, 154, 70, 204, 46, 188, 217, 185, 179, 122, 163, 239, 139, 136, 119, 231, 117,
+            199, 74, 239, 108, 234, 25, 21, 246, 75, 183, 71, 172, 247, 25,
+        ],
+        [
+            143, 4, 10, 225, 34, 215, 168, 147, 44, 185, 131, 183, 230, 6, 125, 173, 71, 57, 255,
+            57, 45, 203, 159, 231, 97, 15, 80, 248, 189, 162, 230, 32,
+        ],
+        [
+            166, 187, 119, 117, 197, 168, 67, 253, 47, 170, 125, 165, 17, 15, 149, 44, 146, 58,
+            198, 97, 128, 144, 7, 40, 95, 143, 147, 172, 152, 219, 236, 28,
+        ],
+        [
+            28, 176, 50, 123, 16, 49, 98, 25, 185, 200, 78, 192, 135, 9, 17, 249, 80, 80, 148, 70,
+            197, 44, 151, 13, 252, 245, 170, 173, 184, 192, 179, 50,
+        ],
+        [
+            7, 203, 97, 103, 251, 87, 201, 89, 46, 123, 27, 243, 73, 93, 22, 209, 139, 173, 145,
+            228, 215, 23, 133, 50, 142, 179, 0, 115, 169, 54, 54, 36,
+        ],
+        [
+            103, 67, 224, 228, 216, 51, 67, 191, 241, 190, 231, 167, 239, 122, 145, 135, 27, 27,
+            121, 169, 32, 249, 121, 157, 76, 209, 1, 125, 128, 109, 122, 9,
+        ],
+    ],
+    [
+        [
+            148, 192, 149, 231, 219, 175, 220, 161, 114, 143, 131, 199, 122, 47, 237, 202, 210,
+            139, 29, 217, 170, 108, 115, 249, 68, 146, 176, 108, 222, 159, 233, 14,
+        ],
+        [
+            85, 172, 51, 155, 179, 59, 252, 236, 149, 163, 120, 147, 116, 175, 86, 1, 40, 81, 47,
+            133, 109, 255, 74, 131, 19, 129, 194, 4, 159, 185, 31, 3,
+        ],
+        [
+            209, 194, 182, 196, 5, 180, 67, 30, 36, 61, 3, 166, 211, 15, 123, 155, 128, 13, 120,
+            142, 137, 166, 245, 147, 78, 249, 140, 255, 203, 212, 85, 6,
+        ],
+        [
+            127, 131, 57, 200, 151, 146, 45, 152, 85, 62, 96, 86, 213, 36, 238, 237, 132, 44, 127,
+            149, 182, 216, 127, 58, 114, 211, 189, 141, 202, 194, 62, 62,
+        ],
+        [
+            99, 71, 21, 6, 166, 145, 151, 160, 236, 240, 86, 161, 124, 186, 117, 20, 238, 65, 92,
+            94, 164, 101, 27, 72, 90, 199, 127, 238, 171, 190, 35, 55,
+        ],
+        [
+            3, 197, 168, 159, 131, 53, 238, 255, 128, 42, 6, 120, 7, 172, 39, 108, 174, 46, 155,
+            47, 131, 151, 235, 200, 222, 175, 119, 50, 78, 128, 153, 3,
+        ],
+        [
+            116, 66, 37, 31, 30, 169, 73, 64, 193, 70, 88, 219, 59, 172, 96, 110, 243, 160, 105,
+            191, 2, 226, 190, 27, 52, 202, 22, 33, 25, 38, 220, 31,
+        ],
+        [
+            49, 200, 93, 193, 225, 104, 64, 102, 3, 223, 45, 31, 211, 145, 210, 114, 132, 27, 240,
+            232, 189, 127, 87, 226, 125, 18, 170, 133, 195, 198, 153, 16,
+        ],
+    ],
+    [
+        [
+            121, 53, 200, 131, 196, 84, 198, 124, 113, 102, 142, 218, 224, 247, 145, 131, 186, 103,
+            190, 167, 247, 147, 224, 16, 99, 39, 56, 226, 46, 1, 49, 59,
+        ],
+        [
+            22, 50, 40, 200, 159, 100, 214, 73, 77, 69, 163, 2, 110, 139, 27, 106, 154, 229, 182,
+            137, 7, 168, 187, 202, 17, 19, 160, 25, 162, 17, 89, 48,
+        ],
+        [
+            164, 44, 83, 249, 124, 41, 132, 94, 96, 167, 55, 81, 204, 189, 223, 195, 250, 225, 16,
+            205, 0, 3, 130, 36, 165, 36, 166, 132, 92, 91, 67, 63,
+        ],
+        [
+            74, 250, 76, 30, 147, 188, 232, 26, 69, 89, 236, 235, 117, 199, 87, 31, 17, 223, 161,
+            198, 244, 125, 157, 12, 237, 115, 191, 191, 71, 169, 248, 8,
+        ],
+        [
+            199, 31, 247, 17, 166, 210, 80, 23, 60, 82, 40, 177, 153, 123, 9, 176, 227, 228, 80,
+            110, 191, 176, 172, 159, 234, 227, 133, 97, 160, 201, 8, 45,
+        ],
+        [
+            76, 132, 117, 193, 103, 234, 31, 11, 42, 125, 132, 21, 248, 178, 136, 13, 191, 20, 46,
+            6, 95, 231, 230, 95, 29, 223, 70, 180, 205, 75, 70, 29,
+        ],
+        [
+            252, 10, 50, 84, 120, 20, 243, 48, 252, 113, 112, 249, 255, 250, 144, 178, 245, 108,
+            209, 169, 102, 254, 1, 34, 254, 141, 201, 39, 18, 66, 213, 37,
+        ],
+        [
+            216, 43, 15, 51, 184, 164, 7, 189, 92, 219, 230, 192, 138, 49, 17, 116, 209, 106, 26,
+            208, 1, 207, 209, 130, 200, 28, 194, 68, 159, 151, 92, 59,
+        ],
+    ],
+    [
+        [
+            130, 227, 156, 234, 103, 13, 183, 24, 209, 108, 219, 46, 240, 126, 63, 210, 226, 125,
+            54, 73, 152, 148, 106, 3, 165, 179, 217, 171, 135, 178, 187, 25,
+        ],
+        [
+            249, 123, 230, 251, 192, 186, 61, 109, 88, 101, 236, 21, 188, 172, 133, 102, 200, 159,
+            0, 83, 252, 97, 5, 193, 171, 41, 51, 40, 232, 17, 197, 47,
+        ],
+        [
+            230, 209, 96, 28, 233, 75, 176, 21, 83, 187, 216, 27, 42, 240, 129, 127, 124, 226, 24,
+            47, 194, 225, 110, 93, 108, 50, 169, 242, 24, 163, 130, 38,
+        ],
+        [
+            133, 62, 95, 11, 93, 161, 179, 247, 32, 25, 89, 217, 173, 147, 63, 62, 162, 228, 178,
+            45, 146, 101, 13, 17, 171, 246, 125, 143, 194, 108, 30, 58,
+        ],
+        [
+            246, 216, 189, 144, 11, 240, 154, 125, 249, 154, 103, 59, 40, 198, 29, 207, 162, 186,
+            17, 160, 63, 218, 136, 217, 105, 228, 71, 36, 45, 244, 135, 30,
+        ],
+        [
+            219, 147, 219, 20, 99, 77, 100, 59, 113, 73, 90, 255, 236, 117, 72, 139, 43, 36, 149,
+            4, 112, 41, 98, 157, 60, 2, 220, 9, 118, 181, 189, 46,
+        ],
+        [
+            4, 109, 33, 143, 207, 231, 44, 77, 113, 223, 222, 247, 110, 52, 82, 202, 123, 213, 168,
+            77, 249, 194, 9, 158, 7, 158, 246, 204, 165, 198, 9, 63,
+        ],
+        [
+            84, 44, 128, 238, 129, 148, 169, 143, 203, 17, 195, 37, 152, 129, 162, 175, 39, 140,
+            217, 131, 143, 238, 67, 49, 14, 235, 52, 228, 147, 63, 54, 35,
+        ],
+    ],
+    [
+        [
+            191, 200, 71, 7, 129, 246, 124, 225, 156, 59, 22, 9, 148, 195, 71, 78, 147, 151, 234,
+            102, 64, 121, 202, 224, 245, 27, 80, 223, 176, 227, 26, 17,
+        ],
+        [
+            157, 66, 240, 109, 254, 70, 22, 27, 239, 237, 53, 115, 128, 155, 233, 187, 164, 148,
+            232, 0, 41, 157, 202, 126, 95, 253, 77, 150, 3, 247, 218, 58,
+        ],
+        [
+            228, 151, 252, 188, 162, 217, 229, 108, 43, 184, 35, 147, 108, 83, 94, 28, 151, 48,
+            103, 150, 181, 98, 147, 212, 14, 134, 229, 37, 192, 112, 24, 16,
+        ],
+        [
+            83, 208, 193, 201, 178, 111, 198, 23, 126, 42, 70, 132, 206, 197, 226, 122, 89, 140,
+            131, 139, 135, 216, 52, 136, 76, 217, 147, 230, 129, 245, 176, 59,
+        ],
+        [
+            244, 45, 69, 232, 83, 171, 220, 246, 253, 139, 1, 48, 15, 253, 251, 59, 222, 181, 17,
+            129, 4, 237, 150, 59, 232, 244, 106, 254, 81, 244, 254, 18,
+        ],
+        [
+            188, 199, 14, 197, 255, 152, 21, 31, 227, 236, 205, 79, 82, 104, 52, 214, 2, 218, 180,
+            90, 116, 189, 195, 244, 167, 62, 194, 36, 107, 184, 11, 43,
+        ],
+        [
+            91, 136, 16, 71, 244, 127, 17, 108, 158, 203, 244, 225, 158, 108, 74, 143, 209, 88,
+            216, 76, 60, 162, 103, 218, 6, 86, 220, 238, 109, 6, 112, 28,
+        ],
+        [
+            210, 145, 15, 69, 76, 180, 168, 134, 197, 134, 121, 248, 13, 45, 162, 58, 191, 117,
+            233, 85, 161, 132, 243, 111, 26, 158, 207, 5, 173, 101, 203, 39,
+        ],
+    ],
+    [
+        [
+            91, 229, 184, 51, 211, 97, 48, 184, 113, 20, 161, 108, 173, 224, 151, 36, 98, 116, 190,
+            236, 239, 208, 45, 65, 41, 218, 22, 78, 21, 159, 68, 26,
+        ],
+        [
+            154, 217, 229, 180, 214, 167, 164, 163, 231, 131, 232, 179, 73, 218, 83, 161, 164, 155,
+            38, 217, 38, 83, 173, 123, 185, 195, 136, 28, 222, 105, 248, 44,
+        ],
+        [
+            239, 18, 84, 25, 24, 214, 58, 20, 152, 95, 143, 93, 97, 219, 36, 109, 132, 217, 17, 55,
+            49, 1, 18, 121, 131, 145, 4, 217, 250, 134, 88, 14,
+        ],
+        [
+            253, 67, 150, 157, 135, 33, 201, 53, 183, 45, 159, 132, 171, 98, 41, 58, 140, 134, 11,
+            145, 25, 241, 71, 213, 88, 135, 55, 47, 244, 112, 235, 43,
+        ],
+        [
+            203, 78, 141, 190, 49, 209, 195, 175, 45, 64, 143, 120, 102, 235, 159, 161, 245, 198,
+            29, 126, 9, 86, 92, 60, 63, 99, 217, 169, 217, 25, 97, 57,
+        ],
+        [
+            233, 223, 245, 147, 242, 164, 19, 19, 137, 245, 19, 241, 36, 159, 136, 111, 211, 191,
+            185, 125, 216, 176, 166, 33, 218, 175, 100, 57, 180, 168, 33, 21,
+        ],
+        [
+            191, 125, 108, 252, 109, 113, 20, 141, 133, 231, 150, 20, 101, 219, 222, 38, 99, 160,
+            59, 92, 97, 181, 71, 115, 51, 165, 119, 92, 118, 44, 127, 60,
+        ],
+        [
+            113, 88, 23, 85, 9, 181, 218, 205, 196, 189, 218, 69, 235, 215, 199, 177, 88, 46, 80,
+            177, 124, 126, 188, 209, 80, 154, 254, 177, 249, 6, 34, 45,
+        ],
+    ],
+    [
+        [
+            49, 171, 43, 141, 243, 56, 203, 14, 8, 164, 117, 204, 211, 2, 98, 215, 247, 219, 40,
+            10, 65, 77, 198, 28, 168, 165, 187, 204, 93, 58, 182, 38,
+        ],
+        [
+            76, 41, 75, 64, 104, 7, 90, 39, 75, 212, 84, 97, 109, 16, 221, 105, 175, 57, 203, 170,
+            160, 193, 20, 250, 41, 48, 135, 95, 210, 60, 239, 18,
+        ],
+        [
+            11, 48, 231, 185, 24, 69, 14, 2, 119, 209, 228, 104, 103, 135, 156, 250, 144, 116, 172,
+            233, 164, 53, 176, 174, 97, 86, 41, 34, 69, 64, 80, 45,
+        ],
+        [
+            206, 62, 81, 203, 222, 175, 138, 11, 37, 103, 16, 242, 2, 233, 61, 206, 100, 119, 153,
+            92, 27, 168, 76, 186, 61, 115, 161, 236, 188, 105, 53, 39,
+        ],
+        [
+            184, 121, 255, 112, 144, 174, 21, 210, 228, 37, 104, 55, 37, 190, 74, 219, 138, 97,
+            143, 89, 102, 179, 145, 166, 45, 48, 254, 158, 171, 154, 179, 29,
+        ],
+        [
+            6, 225, 64, 102, 192, 218, 125, 198, 151, 71, 85, 123, 214, 160, 161, 13, 126, 187,
+            146, 117, 142, 61, 67, 33, 247, 101, 92, 227, 237, 171, 178, 46,
+        ],
+        [
+            214, 175, 191, 1, 36, 44, 95, 190, 226, 11, 238, 183, 89, 58, 32, 159, 7, 43, 143, 126,
+            30, 154, 77, 11, 225, 220, 100, 206, 57, 69, 147, 59,
+        ],
+        [
+            132, 71, 64, 13, 36, 95, 197, 166, 181, 130, 188, 161, 21, 134, 156, 60, 229, 202, 115,
+            252, 142, 193, 144, 9, 148, 49, 152, 217, 94, 10, 200, 16,
+        ],
+    ],
+    [
+        [
+            169, 185, 107, 159, 236, 0, 234, 249, 163, 24, 243, 22, 89, 24, 72, 31, 99, 20, 210,
+            52, 203, 224, 58, 131, 135, 126, 139, 241, 11, 223, 180, 41,
+        ],
+        [
+            100, 111, 163, 64, 52, 18, 196, 37, 86, 14, 150, 151, 192, 192, 213, 66, 5, 175, 208,
+            15, 99, 225, 99, 23, 255, 115, 41, 53, 244, 241, 232, 62,
+        ],
+        [
+            203, 172, 162, 221, 207, 144, 7, 120, 39, 125, 39, 231, 4, 167, 167, 147, 197, 4, 221,
+            168, 11, 32, 252, 185, 253, 56, 198, 125, 180, 217, 48, 14,
+        ],
+        [
+            151, 198, 41, 131, 85, 85, 153, 167, 214, 190, 207, 57, 232, 116, 153, 110, 242, 143,
+            87, 149, 148, 79, 202, 50, 254, 93, 181, 118, 241, 36, 47, 30,
+        ],
+        [
+            169, 132, 214, 252, 163, 226, 40, 236, 102, 76, 39, 197, 196, 64, 76, 131, 131, 239,
+            125, 186, 226, 201, 133, 168, 63, 255, 217, 34, 32, 14, 87, 27,
+        ],
+        [
+            152, 171, 139, 173, 78, 7, 26, 26, 41, 52, 127, 102, 29, 98, 192, 1, 192, 245, 215,
+            144, 80, 63, 44, 223, 64, 223, 246, 42, 138, 196, 82, 56,
+        ],
+        [
+            181, 29, 217, 137, 178, 103, 44, 244, 146, 108, 167, 194, 209, 98, 153, 191, 200, 209,
+            197, 121, 30, 99, 180, 251, 16, 70, 185, 48, 28, 225, 29, 4,
+        ],
+        [
+            6, 12, 109, 251, 112, 60, 35, 12, 42, 207, 70, 3, 142, 241, 196, 126, 220, 203, 68,
+            249, 158, 166, 46, 67, 32, 23, 192, 239, 36, 44, 206, 25,
+        ],
+    ],
+    [
+        [
+            94, 19, 121, 58, 184, 157, 237, 59, 227, 107, 130, 65, 168, 219, 76, 58, 226, 235, 146,
+            109, 35, 2, 8, 52, 110, 145, 135, 173, 45, 18, 40, 18,
+        ],
+        [
+            73, 20, 152, 96, 153, 114, 82, 42, 234, 214, 83, 47, 117, 62, 120, 141, 43, 72, 95, 94,
+            222, 242, 227, 94, 53, 78, 58, 66, 227, 164, 108, 36,
+        ],
+        [
+            15, 203, 0, 206, 129, 153, 3, 46, 221, 28, 232, 197, 225, 202, 69, 64, 15, 85, 203, 4,
+            165, 83, 252, 98, 130, 126, 118, 166, 132, 113, 254, 3,
+        ],
+        [
+            27, 247, 153, 83, 213, 195, 61, 103, 248, 197, 36, 170, 167, 29, 42, 61, 58, 108, 9,
+            162, 63, 63, 78, 234, 102, 112, 223, 115, 109, 89, 205, 11,
+        ],
+        [
+            230, 87, 100, 238, 166, 118, 76, 72, 206, 16, 128, 19, 196, 235, 19, 85, 25, 180, 143,
+            88, 79, 67, 74, 18, 42, 0, 182, 167, 5, 82, 141, 58,
+        ],
+        [
+            242, 225, 221, 181, 10, 42, 4, 246, 169, 149, 20, 171, 248, 249, 181, 206, 171, 85,
+            200, 89, 186, 144, 18, 113, 211, 76, 54, 13, 175, 5, 23, 57,
+        ],
+        [
+            124, 90, 7, 105, 198, 10, 101, 152, 215, 14, 162, 242, 28, 138, 77, 181, 216, 134, 209,
+            125, 207, 40, 23, 247, 132, 101, 202, 184, 108, 234, 30, 23,
+        ],
+        [
+            113, 101, 162, 46, 79, 205, 213, 191, 24, 206, 128, 228, 42, 66, 147, 106, 8, 211, 6,
+            57, 131, 108, 24, 46, 80, 206, 180, 58, 149, 204, 118, 61,
+        ],
+    ],
+    [
+        [
+            251, 19, 185, 65, 96, 235, 128, 183, 255, 41, 247, 142, 148, 237, 175, 76, 168, 5, 48,
+            90, 246, 162, 79, 83, 10, 170, 36, 227, 89, 13, 167, 62,
+        ],
+        [
+            56, 166, 248, 151, 90, 187, 224, 187, 156, 41, 254, 99, 77, 25, 30, 149, 121, 164, 64,
+            17, 55, 129, 219, 217, 125, 235, 138, 13, 220, 168, 152, 1,
+        ],
+        [
+            165, 106, 214, 186, 223, 37, 21, 54, 151, 110, 55, 189, 197, 11, 61, 209, 156, 123,
+            169, 180, 84, 10, 149, 134, 72, 186, 24, 177, 182, 246, 164, 19,
+        ],
+        [
+            73, 95, 93, 223, 114, 216, 130, 77, 25, 212, 228, 134, 143, 89, 68, 90, 11, 213, 48,
+            205, 242, 51, 247, 151, 216, 45, 159, 152, 184, 225, 221, 41,
+        ],
+        [
+            40, 171, 76, 37, 66, 223, 82, 113, 211, 247, 233, 118, 209, 240, 160, 244, 13, 51, 194,
+            152, 58, 168, 231, 12, 185, 25, 186, 175, 64, 12, 231, 6,
+        ],
+        [
+            179, 90, 55, 174, 72, 152, 204, 148, 24, 250, 29, 50, 143, 98, 133, 199, 241, 225, 133,
+            171, 33, 49, 178, 167, 35, 162, 79, 159, 26, 232, 0, 8,
+        ],
+        [
+            125, 6, 204, 17, 50, 201, 101, 165, 28, 107, 109, 206, 143, 215, 105, 123, 175, 164,
+            63, 159, 21, 11, 234, 96, 159, 43, 88, 18, 159, 33, 88, 38,
+        ],
+        [
+            221, 140, 167, 49, 28, 116, 206, 121, 79, 136, 80, 60, 181, 7, 95, 177, 32, 126, 87,
+            128, 168, 124, 129, 166, 189, 214, 255, 44, 221, 83, 103, 48,
+        ],
+    ],
+    [
+        [
+            100, 19, 245, 99, 127, 23, 39, 14, 128, 145, 57, 217, 20, 253, 209, 74, 223, 24, 220,
+            142, 19, 167, 130, 239, 220, 226, 211, 66, 177, 44, 34, 25,
+        ],
+        [
+            253, 114, 38, 89, 223, 86, 164, 50, 35, 154, 30, 159, 194, 152, 119, 36, 118, 25, 244,
+            85, 63, 29, 152, 56, 150, 14, 250, 231, 157, 94, 53, 1,
+        ],
+        [
+            122, 133, 104, 47, 162, 156, 2, 203, 65, 211, 188, 21, 95, 196, 233, 189, 85, 11, 82,
+            62, 121, 185, 128, 178, 117, 221, 41, 246, 177, 224, 168, 53,
+        ],
+        [
+            15, 47, 113, 92, 78, 129, 107, 39, 106, 27, 10, 4, 193, 207, 48, 209, 184, 128, 128,
+            54, 167, 37, 99, 169, 88, 131, 209, 43, 191, 232, 246, 43,
+        ],
+        [
+            151, 100, 55, 80, 35, 25, 142, 78, 150, 69, 94, 12, 237, 225, 126, 108, 106, 133, 11,
+            118, 58, 8, 195, 87, 124, 129, 2, 8, 228, 8, 235, 41,
+        ],
+        [
+            154, 75, 9, 198, 211, 209, 244, 131, 49, 126, 187, 157, 54, 92, 229, 166, 249, 72, 229,
+            168, 92, 24, 17, 154, 4, 213, 211, 179, 26, 60, 115, 57,
+        ],
+        [
+            148, 168, 89, 36, 108, 105, 22, 194, 209, 232, 199, 64, 79, 100, 96, 148, 205, 137, 20,
+            98, 107, 79, 12, 200, 56, 4, 93, 151, 129, 18, 90, 2,
+        ],
+        [
+            173, 118, 232, 220, 163, 182, 149, 237, 184, 151, 108, 87, 139, 99, 14, 144, 174, 120,
+            101, 207, 198, 189, 108, 99, 145, 73, 114, 141, 90, 97, 136, 36,
+        ],
+    ],
+];
+
+pub fn generator() -> pallas::Affine {
+    pallas::Affine::from_xy(
+        pallas::Base::from_bytes(&GENERATOR.0).unwrap(),
+        pallas::Base::from_bytes(&GENERATOR.1).unwrap(),
+    )
+    .unwrap()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::super::{
+        test_lagrange_coeffs, test_zs_and_us, NUM_WINDOWS, ORCHARD_PERSONALIZATION,
+    };
+    use super::*;
+    use group::Curve;
+    use pasta_curves::{
+        arithmetic::{CurveAffine, CurveExt, FieldExt},
+        pallas,
+    };
+
+    #[test]
+    fn generator() {
+        let hasher = pallas::Point::hash_to_curve(ORCHARD_PERSONALIZATION);
+        let point = hasher(b"G");
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(*coords.x(), pallas::Base::from_bytes(&GENERATOR.0).unwrap());
+        assert_eq!(*coords.y(), pallas::Base::from_bytes(&GENERATOR.1).unwrap());
+    }
+
+    #[test]
+    fn lagrange_coeffs() {
+        let base = super::generator();
+        test_lagrange_coeffs(base, NUM_WINDOWS);
+    }
+
+    #[test]
+    fn z() {
+        let base = super::generator();
+        test_zs_and_us(base, &Z, &U, NUM_WINDOWS);
+    }
+}

+ 2965 - 0
src/crypto/constants/fixed_bases/value_commit_r.rs

@@ -0,0 +1,2965 @@
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    pallas,
+};
+
+/// The value commitment is used to check balance between inputs and outputs. The value is
+/// placed over this generator.
+pub const GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        145, 90, 60, 136, 104, 198, 195, 14, 47, 128, 144, 238, 69, 215, 110, 64, 72, 32, 141, 234,
+        91, 35, 102, 79, 187, 9, 164, 15, 85, 68, 244, 7,
+    ],
+    [
+        202, 217, 114, 167, 200, 70, 47, 14, 70, 129, 146, 243, 241, 41, 146, 39, 194, 183, 111,
+        228, 201, 44, 86, 33, 140, 98, 38, 175, 119, 103, 19, 36,
+    ],
+);
+
+/// Full-width z-values for GENERATOR
+pub const Z: [u64; super::NUM_WINDOWS] = [
+    181916, 22148, 340526, 80718, 104958, 86894, 43381, 1060, 82130, 4741, 55897, 4304, 114469,
+    20503, 25001, 62408, 52978, 35893, 72071, 154369, 67304, 7299, 27960, 42929, 51869, 89967,
+    62210, 59433, 47868, 32536, 105000, 1546, 2116, 18717, 50694, 22864, 254428, 54966, 108762,
+    46706, 65730, 45555, 7376, 50051, 24773, 74636, 44806, 23223, 78561, 50668, 7380, 13697,
+    171970, 269484, 25534, 5098, 79584, 6889, 21432, 73095, 36745, 37350, 6274, 5179, 50216, 12007,
+    44029, 88199, 70401, 14120, 19017, 2423, 26494, 34954, 126293, 167379, 136922, 45619, 30331,
+    22632, 163228, 12997, 4461, 32320, 13430,
+];
+
+/// Full-width u-values for GENERATOR
+pub const U: [[[u8; 32]; super::H]; super::NUM_WINDOWS] = [
+    [
+        [
+            139, 239, 3, 113, 200, 111, 72, 118, 105, 23, 186, 243, 234, 10, 173, 186, 53, 143,
+            244, 250, 24, 189, 161, 158, 43, 13, 143, 252, 82, 104, 150, 55,
+        ],
+        [
+            102, 10, 45, 173, 93, 142, 120, 21, 105, 140, 183, 3, 198, 201, 198, 184, 15, 206, 177,
+            131, 9, 25, 103, 232, 162, 26, 45, 202, 9, 125, 93, 49,
+        ],
+        [
+            7, 184, 84, 133, 195, 104, 173, 245, 198, 202, 50, 197, 58, 26, 187, 116, 72, 224, 153,
+            67, 200, 174, 32, 60, 195, 80, 152, 192, 131, 168, 208, 13,
+        ],
+        [
+            62, 23, 97, 17, 76, 95, 147, 158, 244, 165, 111, 203, 162, 25, 80, 235, 63, 80, 45, 12,
+            254, 236, 154, 135, 211, 75, 44, 122, 125, 197, 9, 41,
+        ],
+        [
+            99, 80, 223, 192, 185, 128, 95, 248, 127, 225, 142, 107, 179, 40, 8, 112, 59, 60, 81,
+            89, 87, 153, 126, 140, 190, 187, 139, 9, 24, 21, 104, 5,
+        ],
+        [
+            39, 201, 225, 147, 38, 14, 83, 216, 168, 53, 60, 41, 194, 52, 37, 141, 20, 20, 10, 242,
+            173, 169, 194, 72, 182, 95, 173, 186, 229, 115, 178, 37,
+        ],
+        [
+            234, 29, 76, 124, 112, 42, 82, 57, 181, 205, 61, 90, 58, 224, 227, 21, 83, 58, 30, 216,
+            161, 10, 104, 83, 34, 113, 192, 146, 141, 215, 219, 44,
+        ],
+        [
+            218, 183, 114, 168, 64, 166, 144, 113, 219, 75, 64, 32, 252, 13, 10, 111, 244, 194, 79,
+            70, 7, 209, 129, 66, 232, 180, 217, 248, 61, 191, 59, 51,
+        ],
+    ],
+    [
+        [
+            96, 67, 69, 38, 122, 193, 223, 87, 223, 138, 202, 119, 235, 141, 70, 229, 166, 135,
+            208, 39, 220, 143, 203, 102, 106, 99, 115, 39, 8, 60, 31, 30,
+        ],
+        [
+            207, 136, 59, 50, 178, 209, 184, 137, 238, 170, 63, 147, 102, 56, 194, 30, 152, 87,
+            165, 250, 203, 71, 154, 64, 41, 216, 239, 143, 9, 94, 33, 52,
+        ],
+        [
+            158, 74, 177, 224, 26, 70, 115, 103, 211, 95, 237, 92, 72, 210, 216, 225, 165, 20, 251,
+            241, 200, 140, 178, 182, 154, 65, 105, 144, 85, 65, 240, 46,
+        ],
+        [
+            11, 99, 19, 189, 201, 13, 110, 245, 240, 219, 4, 55, 24, 81, 54, 2, 82, 54, 171, 29,
+            203, 99, 234, 64, 175, 154, 87, 112, 249, 29, 20, 30,
+        ],
+        [
+            213, 177, 148, 202, 251, 114, 75, 8, 198, 148, 44, 102, 185, 120, 226, 222, 251, 65,
+            206, 38, 99, 180, 62, 13, 221, 122, 206, 148, 10, 212, 234, 4,
+        ],
+        [
+            191, 60, 118, 185, 153, 148, 200, 78, 50, 10, 66, 97, 26, 79, 240, 136, 20, 115, 39,
+            240, 166, 237, 87, 98, 223, 84, 197, 151, 230, 139, 235, 7,
+        ],
+        [
+            170, 86, 142, 224, 231, 59, 184, 35, 237, 52, 13, 72, 108, 156, 227, 229, 214, 103,
+            175, 139, 231, 148, 146, 51, 195, 157, 221, 189, 122, 27, 227, 37,
+        ],
+        [
+            88, 29, 201, 124, 227, 97, 36, 193, 215, 180, 137, 50, 249, 137, 10, 118, 67, 200, 35,
+            42, 181, 217, 213, 146, 210, 159, 47, 194, 165, 101, 241, 20,
+        ],
+    ],
+    [
+        [
+            147, 4, 192, 237, 120, 223, 231, 71, 128, 237, 0, 110, 243, 11, 132, 152, 102, 150,
+            212, 251, 145, 56, 21, 247, 78, 232, 88, 204, 26, 139, 75, 1,
+        ],
+        [
+            242, 104, 68, 11, 78, 77, 207, 142, 185, 45, 95, 183, 81, 22, 8, 125, 247, 66, 152, 59,
+            191, 118, 51, 215, 85, 0, 51, 170, 147, 239, 110, 17,
+        ],
+        [
+            148, 204, 16, 59, 17, 174, 121, 72, 218, 232, 205, 215, 128, 255, 187, 112, 141, 188,
+            30, 2, 176, 122, 78, 158, 147, 150, 228, 25, 253, 68, 254, 43,
+        ],
+        [
+            30, 207, 11, 138, 80, 55, 51, 156, 139, 83, 138, 33, 115, 159, 197, 188, 79, 31, 104,
+            111, 62, 80, 183, 143, 105, 189, 238, 79, 147, 212, 156, 11,
+        ],
+        [
+            162, 59, 128, 0, 14, 229, 58, 101, 219, 135, 2, 93, 2, 254, 14, 43, 143, 219, 76, 121,
+            233, 148, 54, 51, 227, 115, 38, 253, 95, 103, 191, 21,
+        ],
+        [
+            117, 191, 41, 120, 209, 97, 234, 18, 169, 17, 7, 120, 210, 68, 139, 185, 133, 131, 43,
+            106, 10, 107, 18, 21, 57, 8, 190, 228, 149, 37, 158, 51,
+        ],
+        [
+            31, 174, 69, 213, 168, 110, 159, 179, 18, 94, 76, 220, 112, 128, 252, 184, 236, 100,
+            185, 238, 191, 51, 204, 100, 107, 218, 101, 96, 106, 166, 70, 6,
+        ],
+        [
+            123, 139, 4, 10, 146, 168, 123, 135, 46, 115, 8, 11, 195, 106, 68, 214, 136, 168, 177,
+            1, 184, 13, 51, 185, 184, 187, 68, 26, 157, 183, 41, 62,
+        ],
+    ],
+    [
+        [
+            153, 31, 98, 227, 163, 137, 0, 129, 133, 57, 178, 132, 239, 46, 204, 124, 73, 65, 29,
+            216, 30, 37, 56, 132, 241, 220, 62, 78, 187, 62, 240, 45,
+        ],
+        [
+            125, 116, 131, 117, 46, 193, 254, 93, 79, 76, 177, 57, 31, 200, 120, 132, 186, 53, 66,
+            220, 163, 178, 5, 230, 188, 212, 210, 25, 188, 103, 93, 44,
+        ],
+        [
+            49, 162, 67, 249, 87, 145, 89, 247, 245, 104, 208, 165, 219, 100, 16, 187, 142, 200,
+            66, 47, 38, 77, 245, 3, 108, 74, 62, 106, 50, 208, 84, 52,
+        ],
+        [
+            201, 221, 108, 129, 170, 111, 64, 73, 140, 255, 129, 243, 252, 87, 129, 226, 170, 210,
+            141, 213, 121, 212, 34, 184, 139, 157, 198, 98, 40, 50, 160, 59,
+        ],
+        [
+            238, 218, 145, 5, 148, 79, 125, 6, 93, 100, 166, 138, 241, 213, 11, 178, 96, 251, 113,
+            138, 47, 97, 33, 222, 224, 129, 174, 130, 217, 164, 140, 29,
+        ],
+        [
+            212, 178, 199, 211, 213, 183, 6, 187, 140, 241, 90, 125, 180, 76, 46, 158, 109, 136,
+            103, 168, 66, 53, 177, 127, 32, 212, 197, 52, 144, 147, 136, 45,
+        ],
+        [
+            103, 249, 188, 165, 128, 120, 137, 119, 158, 154, 30, 17, 38, 169, 19, 33, 53, 148, 37,
+            218, 95, 85, 148, 115, 41, 250, 150, 226, 101, 212, 163, 30,
+        ],
+        [
+            230, 249, 111, 35, 125, 100, 99, 9, 198, 41, 46, 115, 83, 8, 31, 196, 164, 188, 94, 8,
+            109, 175, 164, 169, 64, 5, 78, 121, 162, 246, 59, 53,
+        ],
+    ],
+    [
+        [
+            64, 172, 254, 150, 194, 0, 229, 126, 227, 156, 144, 238, 66, 221, 251, 17, 212, 189,
+            75, 173, 183, 141, 105, 90, 211, 214, 215, 190, 220, 218, 32, 2,
+        ],
+        [
+            250, 142, 28, 190, 160, 225, 213, 205, 14, 211, 102, 52, 153, 255, 151, 209, 225, 2,
+            33, 25, 213, 238, 238, 198, 18, 154, 228, 241, 241, 54, 157, 60,
+        ],
+        [
+            75, 214, 166, 211, 115, 128, 32, 28, 77, 81, 147, 56, 39, 155, 109, 112, 10, 160, 98,
+            103, 72, 95, 27, 59, 207, 229, 174, 25, 4, 251, 92, 60,
+        ],
+        [
+            34, 113, 137, 237, 47, 68, 116, 169, 227, 218, 209, 74, 23, 162, 182, 147, 221, 151,
+            145, 79, 131, 95, 193, 132, 143, 130, 130, 227, 245, 198, 206, 27,
+        ],
+        [
+            127, 167, 50, 210, 223, 36, 251, 32, 21, 244, 240, 170, 220, 7, 86, 197, 230, 237, 222,
+            25, 156, 33, 93, 227, 95, 118, 148, 123, 226, 170, 189, 62,
+        ],
+        [
+            172, 190, 180, 238, 11, 198, 98, 110, 7, 7, 137, 152, 215, 206, 40, 220, 218, 85, 9,
+            52, 172, 74, 5, 214, 152, 191, 17, 48, 100, 173, 54, 26,
+        ],
+        [
+            247, 12, 146, 226, 110, 132, 132, 139, 243, 207, 204, 228, 47, 186, 231, 240, 231, 176,
+            133, 36, 206, 22, 119, 135, 22, 145, 197, 100, 20, 199, 15, 58,
+        ],
+        [
+            175, 19, 90, 7, 34, 58, 172, 219, 22, 67, 115, 16, 50, 51, 173, 31, 133, 161, 1, 229,
+            178, 133, 102, 152, 55, 78, 45, 110, 75, 239, 234, 38,
+        ],
+    ],
+    [
+        [
+            145, 188, 217, 28, 211, 109, 158, 69, 114, 242, 67, 177, 86, 231, 235, 110, 226, 248,
+            92, 192, 231, 217, 250, 30, 54, 110, 42, 17, 4, 123, 63, 41,
+        ],
+        [
+            239, 149, 56, 141, 40, 202, 6, 176, 150, 138, 225, 8, 95, 21, 41, 149, 135, 163, 132,
+            41, 2, 43, 139, 171, 27, 196, 102, 64, 33, 218, 153, 59,
+        ],
+        [
+            203, 34, 210, 53, 46, 172, 48, 78, 145, 63, 217, 49, 77, 236, 1, 154, 200, 72, 24, 2,
+            222, 189, 166, 166, 132, 245, 177, 199, 89, 54, 126, 25,
+        ],
+        [
+            86, 6, 180, 69, 62, 170, 243, 248, 240, 30, 241, 155, 22, 79, 11, 110, 178, 64, 195,
+            62, 30, 75, 182, 14, 113, 220, 96, 15, 168, 107, 37, 60,
+        ],
+        [
+            119, 113, 192, 238, 13, 95, 60, 229, 22, 93, 102, 163, 170, 144, 188, 6, 194, 160, 69,
+            116, 94, 199, 26, 192, 249, 116, 128, 72, 184, 45, 162, 35,
+        ],
+        [
+            94, 223, 14, 35, 38, 97, 179, 224, 57, 126, 170, 251, 91, 103, 84, 23, 224, 151, 106,
+            199, 236, 106, 163, 141, 58, 175, 81, 80, 40, 214, 201, 59,
+        ],
+        [
+            132, 112, 204, 9, 226, 55, 185, 75, 231, 21, 48, 249, 198, 110, 57, 82, 123, 164, 91,
+            16, 85, 246, 121, 57, 4, 132, 38, 133, 2, 196, 123, 63,
+        ],
+        [
+            10, 232, 165, 228, 159, 111, 77, 10, 124, 168, 59, 111, 134, 139, 175, 115, 181, 41,
+            195, 207, 122, 3, 181, 1, 233, 171, 144, 20, 209, 170, 250, 28,
+        ],
+    ],
+    [
+        [
+            31, 220, 178, 109, 251, 49, 176, 112, 11, 205, 236, 79, 93, 93, 209, 18, 54, 37, 19,
+            194, 83, 223, 91, 242, 233, 83, 141, 144, 135, 244, 105, 56,
+        ],
+        [
+            81, 231, 94, 170, 107, 127, 203, 163, 10, 183, 25, 198, 4, 61, 67, 154, 163, 90, 74, 9,
+            200, 29, 145, 141, 166, 123, 62, 13, 104, 194, 93, 50,
+        ],
+        [
+            172, 180, 2, 27, 47, 80, 235, 164, 224, 160, 254, 247, 147, 236, 137, 122, 237, 65, 98,
+            174, 224, 209, 61, 144, 152, 43, 50, 80, 206, 128, 29, 7,
+        ],
+        [
+            96, 37, 53, 71, 220, 216, 77, 204, 62, 14, 73, 192, 136, 118, 209, 107, 116, 89, 247,
+            117, 41, 254, 157, 253, 146, 83, 61, 134, 172, 217, 167, 61,
+        ],
+        [
+            104, 117, 19, 237, 94, 120, 199, 136, 125, 131, 228, 144, 28, 10, 148, 119, 106, 17,
+            250, 90, 94, 194, 167, 240, 113, 247, 183, 253, 160, 184, 27, 9,
+        ],
+        [
+            192, 24, 53, 127, 235, 143, 177, 125, 190, 143, 56, 228, 130, 68, 241, 104, 203, 233,
+            225, 7, 148, 95, 154, 210, 22, 127, 67, 100, 19, 0, 18, 49,
+        ],
+        [
+            236, 129, 24, 57, 236, 189, 67, 7, 7, 189, 46, 125, 107, 150, 52, 83, 225, 198, 101,
+            47, 123, 198, 8, 88, 198, 83, 121, 40, 186, 113, 242, 42,
+        ],
+        [
+            120, 71, 188, 215, 73, 12, 233, 32, 183, 162, 175, 38, 132, 27, 32, 249, 176, 102, 92,
+            123, 174, 249, 228, 134, 124, 231, 187, 191, 240, 9, 236, 25,
+        ],
+    ],
+    [
+        [
+            44, 238, 221, 171, 60, 205, 205, 235, 28, 12, 166, 250, 253, 81, 171, 208, 182, 24, 91,
+            210, 129, 225, 102, 183, 208, 189, 114, 152, 151, 157, 226, 51,
+        ],
+        [
+            103, 138, 231, 149, 85, 124, 78, 82, 40, 17, 231, 154, 156, 3, 30, 222, 245, 52, 94,
+            21, 104, 35, 253, 234, 63, 93, 118, 157, 170, 22, 250, 37,
+        ],
+        [
+            40, 91, 164, 160, 164, 242, 12, 226, 36, 210, 221, 128, 70, 87, 209, 36, 35, 189, 44,
+            85, 110, 100, 212, 166, 132, 244, 106, 243, 103, 75, 243, 20,
+        ],
+        [
+            159, 108, 152, 218, 145, 14, 59, 25, 174, 120, 118, 20, 221, 214, 134, 127, 8, 84, 14,
+            151, 206, 249, 43, 127, 219, 205, 103, 185, 160, 23, 8, 55,
+        ],
+        [
+            248, 129, 230, 218, 151, 177, 113, 167, 115, 89, 111, 199, 44, 100, 229, 186, 76, 136,
+            78, 174, 14, 239, 223, 152, 0, 35, 134, 159, 69, 198, 100, 37,
+        ],
+        [
+            86, 62, 241, 104, 218, 62, 10, 203, 109, 39, 47, 242, 110, 34, 17, 62, 188, 251, 109,
+            224, 224, 49, 232, 249, 158, 44, 131, 184, 232, 169, 151, 11,
+        ],
+        [
+            230, 160, 217, 171, 53, 116, 55, 143, 30, 111, 3, 92, 203, 224, 216, 180, 33, 218, 240,
+            25, 183, 233, 55, 238, 165, 146, 168, 141, 40, 92, 37, 22,
+        ],
+        [
+            209, 112, 179, 95, 105, 7, 163, 138, 141, 97, 118, 174, 120, 237, 72, 230, 79, 172, 90,
+            219, 26, 192, 38, 228, 122, 28, 72, 80, 235, 193, 127, 34,
+        ],
+    ],
+    [
+        [
+            254, 28, 193, 110, 41, 72, 172, 152, 87, 109, 233, 222, 140, 147, 159, 124, 148, 182,
+            94, 179, 206, 34, 33, 50, 172, 30, 12, 199, 87, 72, 165, 41,
+        ],
+        [
+            245, 173, 241, 93, 248, 176, 51, 64, 144, 104, 208, 216, 16, 206, 94, 152, 167, 89,
+            137, 196, 246, 240, 87, 167, 171, 104, 27, 116, 108, 217, 22, 9,
+        ],
+        [
+            132, 156, 222, 191, 17, 62, 197, 49, 34, 216, 214, 33, 47, 82, 224, 216, 170, 239, 241,
+            126, 234, 212, 199, 91, 138, 110, 27, 128, 117, 50, 242, 32,
+        ],
+        [
+            64, 5, 181, 26, 70, 28, 184, 194, 87, 116, 43, 93, 67, 92, 174, 29, 11, 79, 243, 240,
+            11, 121, 157, 62, 58, 33, 181, 90, 211, 131, 7, 8,
+        ],
+        [
+            230, 49, 144, 6, 195, 18, 172, 214, 238, 213, 186, 116, 144, 69, 231, 252, 84, 102, 91,
+            94, 200, 169, 229, 178, 99, 245, 15, 119, 190, 194, 95, 54,
+        ],
+        [
+            41, 252, 108, 140, 207, 174, 78, 195, 183, 186, 125, 24, 131, 106, 216, 108, 184, 153,
+            249, 79, 94, 210, 124, 195, 115, 224, 63, 192, 184, 83, 30, 26,
+        ],
+        [
+            208, 125, 51, 179, 127, 202, 37, 211, 44, 72, 27, 164, 254, 137, 58, 148, 0, 63, 41,
+            234, 1, 158, 72, 25, 169, 132, 1, 189, 215, 2, 64, 14,
+        ],
+        [
+            46, 111, 37, 127, 176, 137, 50, 89, 246, 138, 208, 203, 106, 195, 157, 231, 240, 144,
+            240, 225, 64, 198, 233, 167, 127, 40, 231, 104, 82, 155, 45, 18,
+        ],
+    ],
+    [
+        [
+            25, 54, 51, 222, 26, 219, 162, 250, 134, 244, 11, 167, 206, 151, 28, 254, 63, 143, 163,
+            169, 151, 94, 5, 207, 253, 137, 198, 25, 88, 102, 129, 24,
+        ],
+        [
+            173, 42, 240, 164, 55, 124, 163, 247, 2, 94, 188, 244, 114, 36, 131, 79, 243, 126, 25,
+            60, 70, 209, 150, 121, 9, 44, 80, 224, 183, 131, 133, 40,
+        ],
+        [
+            246, 58, 162, 49, 244, 161, 222, 142, 77, 187, 24, 76, 41, 16, 76, 147, 43, 143, 173,
+            142, 112, 194, 31, 105, 27, 195, 126, 227, 23, 231, 208, 8,
+        ],
+        [
+            35, 200, 84, 68, 62, 127, 102, 254, 54, 172, 151, 193, 222, 181, 190, 204, 95, 57, 33,
+            225, 15, 79, 237, 101, 28, 239, 186, 29, 41, 69, 98, 21,
+        ],
+        [
+            100, 64, 24, 112, 156, 153, 245, 233, 166, 182, 114, 120, 185, 207, 43, 155, 145, 73,
+            64, 215, 81, 169, 35, 240, 69, 116, 5, 34, 240, 79, 105, 1,
+        ],
+        [
+            226, 59, 11, 185, 102, 13, 42, 109, 44, 163, 130, 161, 218, 147, 189, 18, 60, 61, 123,
+            242, 172, 208, 131, 138, 118, 95, 21, 111, 46, 74, 82, 1,
+        ],
+        [
+            217, 244, 22, 128, 132, 230, 210, 181, 187, 251, 65, 195, 81, 129, 222, 206, 97, 14,
+            178, 243, 19, 113, 209, 11, 142, 86, 248, 246, 229, 152, 162, 17,
+        ],
+        [
+            59, 102, 139, 93, 161, 101, 23, 36, 218, 70, 246, 128, 98, 147, 174, 207, 84, 139, 39,
+            67, 227, 7, 130, 64, 37, 22, 194, 218, 191, 43, 34, 45,
+        ],
+    ],
+    [
+        [
+            243, 215, 252, 180, 108, 191, 218, 211, 153, 49, 144, 152, 90, 95, 76, 233, 106, 222,
+            156, 245, 61, 172, 45, 242, 58, 167, 202, 227, 245, 236, 247, 20,
+        ],
+        [
+            2, 213, 207, 34, 65, 186, 12, 228, 150, 46, 40, 66, 72, 196, 244, 151, 80, 62, 116,
+            141, 36, 52, 180, 11, 184, 13, 175, 50, 172, 66, 85, 29,
+        ],
+        [
+            185, 172, 242, 99, 188, 15, 56, 93, 53, 83, 208, 174, 10, 71, 76, 36, 98, 173, 159, 81,
+            53, 129, 157, 220, 61, 93, 12, 123, 21, 2, 123, 46,
+        ],
+        [
+            195, 200, 168, 165, 148, 30, 154, 31, 130, 39, 105, 199, 45, 122, 208, 75, 43, 40, 223,
+            149, 143, 209, 121, 207, 176, 192, 237, 254, 133, 131, 212, 14,
+        ],
+        [
+            243, 120, 106, 116, 193, 82, 61, 254, 19, 211, 26, 13, 30, 197, 160, 76, 142, 143, 228,
+            54, 49, 114, 253, 198, 190, 58, 118, 175, 105, 244, 57, 1,
+        ],
+        [
+            187, 65, 118, 89, 48, 103, 234, 64, 137, 212, 20, 130, 63, 41, 167, 40, 204, 105, 151,
+            188, 106, 116, 212, 8, 33, 220, 86, 126, 174, 117, 241, 11,
+        ],
+        [
+            23, 36, 152, 55, 25, 64, 51, 241, 153, 94, 53, 240, 244, 26, 191, 249, 76, 47, 167, 53,
+            103, 179, 87, 200, 85, 57, 187, 73, 87, 186, 71, 5,
+        ],
+        [
+            3, 245, 6, 142, 151, 192, 17, 62, 8, 136, 223, 178, 122, 228, 234, 192, 18, 12, 162,
+            186, 249, 173, 183, 20, 190, 238, 56, 35, 142, 237, 243, 2,
+        ],
+    ],
+    [
+        [
+            214, 249, 38, 19, 194, 4, 20, 205, 62, 197, 25, 3, 103, 4, 128, 12, 222, 100, 14, 15,
+            9, 188, 229, 54, 182, 46, 18, 0, 53, 137, 27, 32,
+        ],
+        [
+            1, 248, 42, 1, 186, 186, 208, 3, 200, 86, 156, 177, 16, 214, 197, 100, 46, 136, 45,
+            186, 221, 12, 30, 122, 141, 141, 242, 37, 9, 23, 50, 31,
+        ],
+        [
+            30, 193, 71, 240, 123, 34, 96, 160, 159, 81, 65, 89, 85, 224, 39, 182, 188, 43, 148, 4,
+            178, 136, 230, 179, 120, 157, 237, 153, 144, 203, 166, 18,
+        ],
+        [
+            23, 153, 154, 149, 96, 81, 58, 206, 78, 42, 131, 36, 180, 230, 152, 240, 188, 196, 75,
+            191, 187, 191, 201, 29, 248, 169, 1, 249, 194, 90, 146, 13,
+        ],
+        [
+            172, 165, 50, 18, 118, 97, 254, 130, 3, 56, 196, 176, 230, 203, 95, 140, 114, 140, 53,
+            45, 184, 55, 58, 243, 32, 82, 182, 61, 121, 144, 156, 59,
+        ],
+        [
+            117, 176, 227, 84, 115, 78, 150, 191, 31, 133, 143, 105, 89, 128, 249, 146, 113, 16,
+            24, 46, 121, 132, 4, 240, 59, 5, 228, 223, 10, 28, 17, 45,
+        ],
+        [
+            90, 222, 163, 229, 143, 243, 155, 195, 207, 44, 38, 111, 136, 71, 10, 65, 141, 20, 56,
+            224, 173, 128, 45, 220, 236, 250, 2, 212, 132, 245, 86, 20,
+        ],
+        [
+            132, 121, 145, 157, 175, 243, 206, 52, 195, 75, 219, 105, 139, 21, 43, 111, 235, 75,
+            244, 41, 179, 111, 142, 241, 56, 139, 199, 215, 155, 155, 24, 3,
+        ],
+    ],
+    [
+        [
+            170, 160, 77, 190, 31, 71, 130, 150, 13, 82, 166, 134, 114, 218, 143, 234, 103, 193,
+            31, 79, 160, 143, 224, 137, 153, 223, 83, 95, 86, 15, 224, 44,
+        ],
+        [
+            247, 66, 144, 180, 80, 213, 107, 248, 33, 247, 21, 40, 162, 43, 229, 130, 164, 122,
+            155, 92, 221, 188, 252, 170, 102, 151, 54, 204, 150, 59, 194, 56,
+        ],
+        [
+            99, 55, 144, 231, 101, 168, 114, 245, 137, 185, 40, 155, 159, 157, 78, 143, 41, 227,
+            125, 81, 209, 82, 71, 23, 225, 95, 242, 152, 61, 106, 114, 58,
+        ],
+        [
+            251, 171, 20, 73, 200, 63, 174, 145, 92, 225, 76, 78, 213, 212, 87, 243, 42, 186, 194,
+            98, 80, 131, 184, 206, 237, 248, 143, 235, 185, 66, 225, 15,
+        ],
+        [
+            41, 63, 235, 60, 242, 30, 193, 127, 243, 81, 133, 103, 18, 74, 224, 246, 14, 15, 81,
+            128, 139, 171, 164, 159, 217, 64, 66, 253, 203, 171, 90, 44,
+        ],
+        [
+            107, 47, 2, 101, 9, 174, 191, 51, 206, 178, 45, 59, 2, 48, 86, 193, 88, 190, 79, 94,
+            255, 5, 32, 137, 160, 237, 0, 50, 20, 131, 108, 8,
+        ],
+        [
+            149, 251, 115, 8, 57, 217, 50, 3, 163, 192, 38, 199, 174, 92, 109, 92, 246, 242, 44,
+            56, 193, 10, 51, 113, 130, 201, 253, 190, 30, 240, 63, 40,
+        ],
+        [
+            110, 22, 68, 198, 134, 118, 180, 38, 89, 200, 93, 253, 239, 27, 222, 170, 177, 213, 83,
+            119, 187, 33, 203, 82, 158, 22, 19, 215, 138, 247, 189, 51,
+        ],
+    ],
+    [
+        [
+            117, 125, 50, 157, 49, 226, 157, 252, 37, 2, 218, 196, 79, 208, 204, 122, 201, 107,
+            136, 149, 22, 194, 213, 162, 66, 123, 132, 115, 191, 180, 83, 48,
+        ],
+        [
+            210, 19, 161, 243, 101, 177, 187, 16, 121, 148, 102, 119, 222, 135, 3, 199, 122, 151,
+            166, 149, 140, 235, 66, 227, 102, 181, 160, 237, 201, 144, 179, 11,
+        ],
+        [
+            62, 110, 127, 32, 13, 245, 200, 232, 109, 85, 27, 78, 90, 105, 51, 16, 209, 176, 250,
+            162, 217, 67, 168, 73, 143, 84, 9, 68, 225, 83, 207, 18,
+        ],
+        [
+            178, 159, 32, 19, 97, 131, 45, 209, 170, 100, 118, 101, 225, 22, 117, 148, 47, 171,
+            123, 52, 52, 31, 197, 175, 63, 62, 53, 66, 159, 86, 101, 18,
+        ],
+        [
+            32, 79, 44, 69, 64, 154, 0, 68, 192, 225, 40, 51, 90, 68, 250, 187, 184, 212, 134, 241,
+            224, 157, 188, 102, 132, 155, 170, 242, 5, 149, 109, 41,
+        ],
+        [
+            37, 1, 13, 187, 23, 69, 249, 107, 244, 132, 14, 31, 32, 38, 13, 196, 203, 148, 105, 80,
+            38, 185, 27, 200, 4, 42, 54, 47, 69, 35, 139, 47,
+        ],
+        [
+            59, 145, 155, 161, 230, 222, 9, 75, 18, 137, 208, 130, 222, 156, 205, 35, 60, 164, 30,
+            87, 239, 251, 197, 42, 175, 198, 243, 52, 153, 33, 82, 6,
+        ],
+        [
+            114, 241, 55, 63, 242, 105, 93, 232, 30, 144, 103, 214, 145, 231, 247, 5, 39, 81, 213,
+            224, 233, 54, 143, 86, 24, 239, 152, 241, 22, 3, 88, 48,
+        ],
+    ],
+    [
+        [
+            183, 73, 223, 229, 216, 181, 22, 14, 160, 107, 224, 122, 232, 129, 32, 164, 185, 28,
+            237, 169, 30, 220, 109, 105, 222, 16, 150, 199, 169, 98, 178, 63,
+        ],
+        [
+            254, 59, 102, 135, 221, 217, 120, 25, 70, 142, 180, 143, 18, 32, 76, 155, 27, 126, 85,
+            209, 54, 41, 226, 146, 61, 60, 90, 93, 148, 65, 13, 54,
+        ],
+        [
+            45, 111, 189, 160, 179, 174, 50, 59, 44, 37, 174, 101, 210, 22, 94, 248, 230, 247, 218,
+            200, 245, 206, 106, 137, 52, 245, 230, 142, 169, 163, 134, 18,
+        ],
+        [
+            217, 173, 14, 202, 213, 119, 164, 85, 177, 132, 83, 40, 249, 158, 172, 93, 210, 45,
+            244, 253, 247, 227, 38, 252, 226, 240, 65, 163, 106, 29, 22, 19,
+        ],
+        [
+            249, 69, 144, 252, 245, 20, 125, 73, 213, 219, 120, 12, 11, 216, 108, 111, 107, 17, 24,
+            126, 242, 50, 77, 245, 180, 66, 194, 195, 136, 0, 179, 36,
+        ],
+        [
+            110, 175, 70, 254, 167, 151, 104, 91, 126, 243, 201, 150, 21, 231, 172, 247, 188, 206,
+            194, 88, 239, 32, 83, 81, 239, 114, 164, 154, 166, 82, 47, 46,
+        ],
+        [
+            1, 177, 232, 3, 140, 36, 220, 195, 191, 180, 103, 48, 18, 19, 97, 145, 66, 252, 19,
+            194, 79, 177, 227, 57, 214, 205, 227, 144, 105, 243, 49, 52,
+        ],
+        [
+            3, 30, 79, 200, 159, 73, 74, 224, 211, 118, 77, 119, 49, 6, 200, 123, 189, 29, 240, 75,
+            143, 113, 248, 126, 157, 34, 181, 40, 71, 104, 40, 29,
+        ],
+    ],
+    [
+        [
+            72, 187, 142, 33, 65, 74, 73, 237, 236, 55, 32, 61, 31, 150, 208, 1, 154, 10, 254, 203,
+            12, 136, 113, 130, 120, 149, 192, 62, 188, 20, 167, 15,
+        ],
+        [
+            34, 157, 37, 82, 105, 170, 4, 202, 92, 83, 161, 163, 61, 113, 24, 211, 35, 231, 97, 61,
+            163, 180, 214, 182, 24, 32, 57, 234, 100, 78, 115, 10,
+        ],
+        [
+            222, 232, 162, 244, 15, 70, 7, 177, 125, 48, 236, 76, 215, 103, 30, 192, 174, 174, 204,
+            26, 189, 219, 24, 120, 164, 196, 186, 112, 232, 17, 41, 50,
+        ],
+        [
+            55, 110, 18, 103, 80, 146, 54, 15, 36, 53, 114, 18, 77, 124, 197, 206, 106, 215, 86,
+            197, 102, 199, 200, 42, 27, 9, 93, 246, 79, 0, 67, 25,
+        ],
+        [
+            121, 169, 86, 133, 108, 129, 219, 189, 34, 211, 101, 130, 74, 34, 13, 81, 14, 110, 214,
+            84, 27, 61, 84, 26, 29, 50, 181, 52, 167, 142, 120, 34,
+        ],
+        [
+            124, 171, 39, 168, 104, 172, 63, 79, 108, 178, 191, 149, 140, 79, 124, 216, 131, 183,
+            186, 128, 242, 182, 167, 255, 103, 148, 242, 122, 64, 230, 71, 7,
+        ],
+        [
+            56, 174, 182, 231, 135, 215, 66, 103, 46, 120, 92, 118, 249, 203, 107, 149, 58, 138,
+            148, 91, 58, 39, 142, 88, 196, 91, 44, 213, 184, 39, 132, 40,
+        ],
+        [
+            185, 195, 19, 33, 60, 2, 123, 172, 104, 179, 183, 244, 19, 202, 190, 127, 167, 133,
+            136, 102, 193, 29, 212, 214, 123, 183, 156, 205, 192, 198, 35, 43,
+        ],
+    ],
+    [
+        [
+            205, 83, 71, 183, 1, 24, 115, 206, 228, 111, 5, 241, 177, 42, 216, 40, 155, 197, 81,
+            205, 133, 76, 236, 36, 117, 185, 253, 103, 120, 35, 65, 21,
+        ],
+        [
+            166, 215, 18, 12, 156, 184, 129, 59, 129, 189, 191, 109, 255, 117, 116, 255, 94, 69,
+            20, 76, 50, 5, 87, 157, 165, 64, 83, 3, 196, 27, 19, 22,
+        ],
+        [
+            140, 139, 130, 83, 133, 157, 114, 126, 234, 212, 116, 154, 64, 173, 80, 56, 16, 61,
+            108, 202, 102, 96, 21, 247, 144, 174, 45, 27, 201, 147, 225, 41,
+        ],
+        [
+            62, 87, 186, 240, 132, 207, 51, 133, 39, 103, 81, 145, 73, 139, 31, 131, 59, 209, 176,
+            139, 208, 186, 233, 247, 155, 252, 144, 3, 44, 85, 252, 49,
+        ],
+        [
+            138, 130, 218, 32, 216, 172, 47, 195, 15, 48, 92, 183, 94, 116, 144, 79, 223, 127, 155,
+            136, 39, 119, 64, 30, 182, 98, 54, 118, 54, 223, 150, 27,
+        ],
+        [
+            206, 25, 234, 10, 64, 70, 6, 217, 31, 179, 247, 5, 7, 239, 139, 168, 33, 169, 35, 190,
+            246, 31, 225, 27, 22, 85, 217, 211, 42, 112, 105, 39,
+        ],
+        [
+            216, 56, 84, 211, 144, 154, 176, 88, 174, 154, 110, 176, 208, 88, 132, 35, 157, 174,
+            230, 171, 136, 232, 84, 14, 237, 218, 16, 49, 179, 160, 234, 50,
+        ],
+        [
+            183, 99, 245, 70, 190, 152, 145, 87, 35, 163, 196, 71, 172, 58, 205, 155, 160, 103, 8,
+            85, 57, 175, 88, 31, 88, 49, 206, 162, 16, 155, 23, 25,
+        ],
+    ],
+    [
+        [
+            74, 149, 239, 189, 114, 65, 210, 77, 46, 82, 98, 194, 14, 133, 94, 49, 40, 152, 91, 50,
+            5, 164, 18, 226, 135, 94, 2, 125, 175, 41, 120, 51,
+        ],
+        [
+            181, 143, 178, 114, 48, 133, 23, 9, 63, 217, 111, 235, 184, 251, 15, 60, 148, 101, 59,
+            45, 88, 219, 28, 83, 26, 229, 124, 153, 156, 77, 168, 40,
+        ],
+        [
+            171, 22, 216, 53, 16, 224, 251, 108, 191, 93, 174, 150, 237, 239, 25, 5, 125, 60, 159,
+            39, 193, 135, 180, 109, 3, 224, 127, 206, 115, 24, 224, 45,
+        ],
+        [
+            200, 41, 189, 233, 227, 16, 222, 59, 153, 138, 79, 11, 196, 111, 162, 29, 146, 83, 220,
+            255, 1, 10, 130, 58, 243, 8, 93, 230, 33, 87, 48, 41,
+        ],
+        [
+            181, 159, 33, 60, 68, 174, 209, 207, 203, 92, 245, 243, 74, 170, 154, 1, 43, 160, 52,
+            194, 210, 27, 145, 30, 99, 172, 27, 249, 71, 223, 104, 50,
+        ],
+        [
+            175, 5, 60, 58, 189, 14, 246, 123, 78, 49, 84, 221, 109, 65, 185, 93, 36, 88, 96, 86,
+            61, 236, 119, 23, 27, 100, 94, 165, 136, 114, 128, 4,
+        ],
+        [
+            150, 74, 80, 139, 229, 38, 87, 70, 245, 190, 92, 10, 211, 22, 165, 73, 143, 143, 126,
+            177, 23, 53, 219, 247, 31, 38, 25, 182, 158, 244, 20, 50,
+        ],
+        [
+            18, 209, 127, 187, 128, 0, 119, 101, 205, 210, 31, 119, 197, 0, 221, 229, 203, 212, 62,
+            55, 237, 254, 101, 158, 122, 176, 42, 150, 232, 45, 7, 41,
+        ],
+    ],
+    [
+        [
+            36, 137, 204, 219, 0, 154, 63, 247, 215, 165, 137, 105, 28, 105, 38, 4, 193, 135, 137,
+            132, 73, 32, 75, 1, 172, 186, 105, 126, 155, 9, 234, 27,
+        ],
+        [
+            79, 123, 106, 34, 65, 148, 102, 212, 37, 226, 26, 177, 218, 65, 92, 191, 248, 14, 27,
+            239, 91, 204, 175, 13, 75, 172, 17, 69, 134, 139, 96, 52,
+        ],
+        [
+            78, 188, 220, 59, 5, 149, 96, 230, 10, 117, 245, 26, 174, 111, 27, 186, 139, 178, 228,
+            214, 35, 5, 223, 223, 57, 100, 118, 222, 159, 1, 163, 53,
+        ],
+        [
+            73, 71, 233, 100, 247, 29, 45, 142, 28, 138, 200, 24, 17, 39, 182, 140, 255, 159, 152,
+            94, 75, 170, 3, 92, 75, 65, 27, 18, 222, 2, 33, 3,
+        ],
+        [
+            13, 222, 43, 60, 116, 40, 239, 164, 101, 201, 242, 163, 153, 35, 237, 50, 242, 156,
+            223, 180, 148, 126, 6, 177, 165, 110, 139, 226, 231, 8, 145, 59,
+        ],
+        [
+            246, 117, 29, 220, 85, 113, 129, 150, 184, 4, 247, 10, 172, 74, 103, 73, 108, 4, 201,
+            86, 25, 60, 29, 231, 244, 96, 57, 30, 146, 122, 223, 12,
+        ],
+        [
+            23, 172, 62, 0, 141, 188, 233, 62, 34, 177, 96, 95, 247, 236, 50, 170, 113, 178, 151,
+            44, 48, 184, 93, 237, 208, 5, 168, 49, 109, 16, 21, 4,
+        ],
+        [
+            143, 110, 28, 202, 250, 200, 195, 38, 9, 224, 117, 239, 53, 6, 222, 247, 231, 173, 228,
+            210, 251, 2, 14, 133, 86, 139, 194, 14, 184, 178, 31, 42,
+        ],
+    ],
+    [
+        [
+            105, 82, 47, 89, 25, 103, 11, 249, 66, 111, 188, 87, 78, 135, 150, 100, 113, 159, 209,
+            41, 242, 37, 25, 215, 250, 132, 205, 49, 100, 113, 42, 32,
+        ],
+        [
+            124, 198, 51, 229, 215, 184, 224, 251, 79, 26, 84, 35, 213, 164, 170, 39, 215, 255,
+            210, 173, 169, 81, 244, 105, 176, 249, 37, 191, 25, 6, 190, 16,
+        ],
+        [
+            253, 151, 83, 116, 230, 52, 110, 206, 147, 81, 170, 96, 182, 189, 181, 35, 18, 118,
+            175, 63, 93, 201, 248, 55, 129, 200, 104, 11, 160, 47, 4, 30,
+        ],
+        [
+            28, 3, 12, 229, 152, 219, 186, 100, 206, 36, 225, 30, 34, 30, 108, 68, 21, 196, 136,
+            120, 225, 83, 116, 203, 0, 85, 160, 6, 105, 42, 13, 61,
+        ],
+        [
+            191, 116, 153, 77, 233, 2, 241, 126, 83, 78, 152, 251, 93, 112, 49, 221, 130, 19, 135,
+            243, 251, 24, 111, 131, 88, 152, 29, 20, 167, 247, 113, 7,
+        ],
+        [
+            124, 91, 25, 231, 114, 60, 237, 33, 75, 74, 25, 161, 83, 19, 39, 229, 183, 41, 5, 224,
+            4, 248, 170, 42, 77, 249, 106, 245, 84, 62, 169, 48,
+        ],
+        [
+            91, 157, 52, 245, 165, 35, 240, 158, 137, 167, 246, 18, 171, 56, 55, 19, 42, 145, 226,
+            167, 56, 65, 165, 215, 46, 42, 69, 158, 208, 251, 37, 10,
+        ],
+        [
+            89, 198, 136, 103, 162, 233, 140, 72, 172, 240, 202, 112, 189, 124, 240, 96, 250, 141,
+            169, 63, 77, 47, 203, 146, 57, 89, 123, 126, 54, 233, 83, 45,
+        ],
+    ],
+    [
+        [
+            178, 16, 104, 36, 221, 99, 174, 215, 73, 246, 184, 112, 42, 211, 233, 124, 101, 17,
+            215, 164, 187, 122, 244, 216, 15, 188, 20, 190, 255, 89, 108, 13,
+        ],
+        [
+            211, 185, 13, 171, 251, 160, 220, 120, 214, 182, 153, 128, 218, 152, 221, 223, 133,
+            255, 100, 20, 188, 224, 61, 176, 23, 208, 137, 116, 1, 33, 3, 53,
+        ],
+        [
+            39, 18, 157, 171, 253, 120, 243, 71, 172, 2, 132, 76, 83, 210, 103, 104, 67, 120, 60,
+            58, 145, 252, 20, 90, 44, 3, 245, 247, 95, 6, 243, 2,
+        ],
+        [
+            228, 125, 115, 84, 131, 131, 169, 92, 51, 15, 82, 112, 8, 204, 91, 222, 203, 208, 109,
+            111, 14, 59, 28, 244, 46, 35, 144, 69, 212, 66, 200, 44,
+        ],
+        [
+            124, 115, 67, 210, 197, 53, 11, 153, 55, 71, 208, 74, 42, 181, 140, 0, 21, 155, 176,
+            20, 255, 136, 77, 238, 59, 70, 25, 25, 41, 180, 112, 22,
+        ],
+        [
+            124, 61, 201, 115, 14, 189, 176, 115, 124, 24, 53, 163, 232, 123, 121, 50, 30, 56, 161,
+            52, 120, 136, 33, 134, 184, 16, 182, 31, 222, 26, 199, 41,
+        ],
+        [
+            151, 34, 213, 29, 165, 116, 149, 163, 134, 111, 30, 119, 195, 252, 137, 89, 146, 206,
+            18, 82, 141, 247, 3, 130, 205, 69, 224, 189, 21, 55, 114, 62,
+        ],
+        [
+            241, 243, 198, 132, 63, 204, 196, 163, 230, 17, 248, 158, 98, 188, 208, 23, 173, 12,
+            187, 227, 73, 242, 34, 237, 83, 236, 73, 86, 135, 201, 77, 14,
+        ],
+    ],
+    [
+        [
+            80, 161, 16, 201, 18, 107, 180, 237, 109, 13, 229, 253, 142, 231, 128, 185, 249, 180,
+            210, 192, 126, 126, 137, 247, 97, 233, 118, 230, 208, 44, 147, 42,
+        ],
+        [
+            65, 106, 220, 93, 202, 7, 140, 37, 78, 54, 13, 227, 12, 189, 35, 252, 207, 100, 130,
+            146, 10, 104, 219, 121, 127, 229, 170, 22, 88, 108, 181, 14,
+        ],
+        [
+            2, 157, 209, 112, 135, 200, 85, 220, 218, 10, 173, 98, 35, 244, 80, 103, 141, 49, 254,
+            61, 207, 4, 33, 214, 195, 150, 60, 163, 222, 156, 239, 42,
+        ],
+        [
+            37, 211, 37, 147, 184, 166, 133, 18, 236, 217, 52, 134, 76, 157, 193, 88, 141, 231, 1,
+            140, 111, 174, 181, 143, 125, 159, 79, 19, 199, 246, 202, 46,
+        ],
+        [
+            110, 207, 189, 175, 189, 39, 143, 75, 162, 13, 195, 173, 70, 132, 116, 211, 227, 67,
+            222, 87, 179, 3, 179, 208, 95, 26, 97, 57, 79, 162, 109, 4,
+        ],
+        [
+            190, 104, 106, 225, 88, 186, 197, 168, 57, 237, 224, 17, 25, 24, 12, 68, 144, 195, 156,
+            140, 139, 148, 115, 239, 237, 123, 99, 173, 243, 43, 36, 50,
+        ],
+        [
+            195, 129, 0, 72, 233, 178, 136, 47, 186, 117, 240, 197, 103, 82, 186, 53, 108, 10, 230,
+            147, 5, 91, 174, 204, 254, 223, 40, 243, 120, 135, 80, 5,
+        ],
+        [
+            114, 139, 243, 114, 81, 82, 185, 45, 160, 204, 55, 76, 56, 73, 96, 173, 89, 180, 187,
+            248, 217, 29, 209, 242, 49, 222, 223, 187, 79, 31, 171, 18,
+        ],
+    ],
+    [
+        [
+            145, 189, 93, 77, 84, 187, 100, 38, 15, 134, 76, 143, 117, 175, 58, 183, 67, 205, 108,
+            48, 80, 218, 140, 116, 209, 197, 219, 206, 218, 56, 117, 43,
+        ],
+        [
+            109, 207, 168, 80, 126, 16, 71, 172, 63, 120, 145, 32, 80, 61, 208, 2, 58, 77, 68, 17,
+            180, 162, 200, 232, 13, 185, 148, 170, 212, 169, 215, 35,
+        ],
+        [
+            116, 165, 185, 42, 50, 205, 109, 251, 128, 151, 207, 144, 214, 147, 123, 160, 138, 32,
+            10, 144, 97, 19, 182, 103, 58, 146, 207, 54, 85, 210, 161, 37,
+        ],
+        [
+            190, 55, 212, 35, 164, 202, 202, 234, 154, 4, 6, 112, 209, 150, 66, 114, 203, 36, 203,
+            24, 252, 175, 4, 184, 42, 158, 195, 232, 251, 59, 242, 4,
+        ],
+        [
+            204, 229, 51, 68, 126, 85, 72, 53, 106, 2, 172, 19, 37, 238, 62, 101, 89, 96, 245, 177,
+            177, 40, 170, 245, 147, 72, 141, 93, 233, 146, 36, 41,
+        ],
+        [
+            75, 158, 246, 21, 51, 72, 3, 237, 77, 75, 117, 247, 101, 125, 14, 129, 23, 180, 190,
+            49, 57, 32, 223, 224, 65, 205, 113, 48, 119, 203, 73, 13,
+        ],
+        [
+            208, 136, 26, 159, 242, 113, 111, 175, 113, 163, 69, 66, 131, 170, 224, 157, 61, 229,
+            222, 185, 61, 153, 133, 149, 167, 215, 195, 134, 97, 137, 168, 7,
+        ],
+        [
+            35, 33, 104, 95, 155, 119, 101, 133, 53, 48, 169, 224, 62, 138, 152, 3, 245, 213, 187,
+            253, 52, 0, 26, 40, 13, 50, 41, 224, 161, 121, 194, 25,
+        ],
+    ],
+    [
+        [
+            47, 30, 245, 11, 248, 255, 82, 126, 62, 107, 70, 78, 38, 130, 69, 145, 206, 99, 157,
+            171, 184, 143, 155, 226, 182, 81, 109, 192, 179, 104, 10, 5,
+        ],
+        [
+            146, 17, 30, 231, 169, 68, 47, 50, 8, 250, 194, 198, 195, 213, 98, 37, 31, 151, 214,
+            53, 11, 76, 106, 27, 111, 214, 28, 89, 231, 124, 141, 52,
+        ],
+        [
+            95, 57, 186, 20, 37, 9, 249, 188, 111, 199, 138, 164, 67, 210, 204, 91, 242, 253, 155,
+            129, 139, 172, 35, 247, 62, 243, 90, 81, 121, 132, 189, 6,
+        ],
+        [
+            105, 51, 164, 127, 16, 30, 56, 76, 170, 213, 193, 77, 27, 136, 146, 19, 173, 117, 146,
+            9, 37, 22, 57, 185, 117, 113, 162, 145, 197, 99, 233, 17,
+        ],
+        [
+            18, 116, 253, 121, 151, 86, 62, 152, 186, 6, 124, 197, 101, 205, 63, 23, 49, 25, 157,
+            126, 62, 113, 25, 189, 85, 126, 171, 171, 18, 221, 252, 14,
+        ],
+        [
+            220, 42, 220, 82, 18, 237, 116, 250, 56, 130, 90, 202, 56, 16, 179, 88, 145, 64, 230,
+            133, 33, 198, 236, 106, 36, 38, 14, 226, 74, 203, 58, 31,
+        ],
+        [
+            210, 176, 102, 53, 106, 223, 246, 149, 22, 171, 229, 252, 194, 239, 188, 94, 104, 4,
+            85, 107, 98, 2, 197, 254, 9, 22, 10, 5, 27, 190, 151, 23,
+        ],
+        [
+            0, 241, 127, 167, 92, 61, 119, 20, 244, 167, 64, 241, 70, 140, 148, 165, 70, 67, 44,
+            248, 244, 214, 61, 129, 117, 226, 122, 157, 119, 133, 48, 47,
+        ],
+    ],
+    [
+        [
+            4, 166, 155, 39, 140, 2, 252, 205, 171, 177, 125, 47, 117, 177, 191, 55, 138, 148, 78,
+            33, 229, 205, 154, 132, 232, 72, 20, 229, 53, 63, 67, 1,
+        ],
+        [
+            43, 67, 59, 76, 240, 46, 123, 207, 242, 176, 122, 211, 255, 12, 219, 60, 231, 75, 3,
+            190, 18, 41, 212, 251, 73, 151, 103, 120, 1, 191, 0, 61,
+        ],
+        [
+            164, 33, 177, 27, 105, 174, 60, 4, 88, 15, 206, 165, 57, 125, 25, 243, 39, 137, 109,
+            142, 161, 29, 42, 203, 207, 57, 81, 16, 220, 148, 100, 21,
+        ],
+        [
+            86, 4, 190, 246, 52, 129, 210, 172, 1, 30, 55, 220, 143, 98, 235, 140, 53, 209, 102,
+            196, 193, 10, 74, 160, 177, 42, 223, 127, 16, 244, 124, 43,
+        ],
+        [
+            225, 192, 141, 226, 121, 140, 180, 82, 60, 53, 207, 158, 159, 8, 14, 9, 102, 180, 3,
+            194, 72, 45, 23, 138, 183, 92, 239, 11, 125, 218, 124, 43,
+        ],
+        [
+            210, 37, 140, 143, 98, 19, 14, 69, 7, 66, 252, 22, 62, 1, 105, 251, 62, 64, 112, 99,
+            44, 135, 68, 122, 198, 118, 193, 181, 255, 3, 27, 44,
+        ],
+        [
+            109, 112, 251, 144, 181, 127, 116, 134, 187, 207, 207, 1, 197, 252, 45, 76, 205, 109,
+            209, 56, 246, 39, 46, 24, 168, 117, 187, 51, 19, 29, 254, 16,
+        ],
+        [
+            41, 4, 157, 245, 247, 94, 64, 172, 73, 69, 97, 224, 245, 58, 118, 249, 70, 15, 240,
+            218, 103, 192, 63, 244, 57, 65, 17, 184, 101, 73, 54, 23,
+        ],
+    ],
+    [
+        [
+            223, 121, 179, 93, 127, 216, 86, 9, 57, 189, 231, 203, 53, 145, 180, 21, 71, 194, 48,
+            133, 129, 176, 172, 166, 123, 28, 42, 37, 31, 173, 212, 39,
+        ],
+        [
+            97, 252, 223, 243, 58, 160, 128, 88, 43, 185, 8, 44, 130, 103, 177, 237, 69, 157, 111,
+            78, 63, 57, 32, 114, 219, 163, 133, 222, 61, 151, 15, 1,
+        ],
+        [
+            87, 137, 120, 152, 128, 145, 204, 40, 45, 237, 31, 59, 55, 93, 175, 210, 241, 170, 176,
+            158, 7, 255, 88, 212, 241, 219, 18, 54, 48, 199, 196, 44,
+        ],
+        [
+            81, 107, 25, 136, 211, 131, 229, 141, 146, 243, 163, 237, 205, 129, 199, 145, 87, 14,
+            174, 129, 183, 238, 77, 141, 121, 253, 106, 221, 225, 141, 103, 17,
+        ],
+        [
+            120, 243, 252, 105, 134, 235, 87, 145, 113, 190, 201, 93, 193, 90, 249, 234, 193, 81,
+            34, 140, 7, 203, 62, 86, 125, 80, 123, 82, 45, 120, 93, 36,
+        ],
+        [
+            176, 225, 11, 228, 191, 111, 178, 190, 132, 153, 247, 238, 219, 222, 128, 45, 71, 169,
+            21, 91, 143, 139, 185, 103, 36, 80, 67, 247, 92, 81, 114, 60,
+        ],
+        [
+            46, 51, 237, 55, 50, 4, 48, 16, 121, 192, 74, 147, 225, 127, 46, 7, 30, 33, 157, 42,
+            180, 248, 143, 133, 220, 169, 31, 97, 123, 19, 197, 59,
+        ],
+        [
+            53, 95, 71, 61, 252, 230, 199, 192, 101, 235, 194, 218, 126, 23, 13, 236, 119, 146,
+            143, 214, 170, 112, 252, 186, 39, 146, 13, 77, 80, 26, 43, 2,
+        ],
+    ],
+    [
+        [
+            195, 118, 63, 33, 37, 85, 102, 80, 239, 150, 164, 82, 197, 241, 150, 118, 81, 249, 223,
+            22, 176, 48, 64, 204, 129, 146, 89, 37, 67, 13, 74, 58,
+        ],
+        [
+            112, 91, 136, 133, 7, 92, 221, 205, 91, 29, 20, 95, 248, 102, 106, 68, 55, 33, 118,
+            193, 186, 96, 165, 163, 182, 85, 13, 172, 167, 209, 67, 42,
+        ],
+        [
+            185, 151, 20, 57, 185, 10, 140, 226, 229, 3, 62, 149, 145, 79, 245, 205, 231, 76, 63,
+            185, 204, 149, 10, 177, 137, 198, 113, 73, 27, 48, 163, 7,
+        ],
+        [
+            230, 103, 185, 235, 217, 108, 170, 98, 162, 251, 153, 175, 197, 188, 220, 123, 235,
+            208, 223, 14, 130, 63, 50, 43, 131, 150, 88, 170, 22, 35, 87, 0,
+        ],
+        [
+            81, 131, 168, 216, 91, 18, 186, 77, 201, 236, 192, 208, 33, 151, 172, 185, 157, 9, 217,
+            168, 236, 212, 186, 230, 81, 30, 93, 12, 24, 4, 131, 26,
+        ],
+        [
+            64, 149, 92, 20, 249, 203, 232, 169, 227, 78, 195, 114, 204, 188, 117, 59, 24, 140,
+            204, 4, 219, 168, 195, 253, 1, 160, 217, 236, 163, 20, 243, 25,
+        ],
+        [
+            82, 173, 48, 198, 187, 239, 155, 12, 9, 47, 144, 166, 182, 114, 36, 252, 94, 193, 225,
+            248, 141, 255, 176, 14, 91, 174, 31, 140, 18, 42, 62, 3,
+        ],
+        [
+            238, 79, 14, 238, 178, 202, 236, 102, 201, 183, 56, 152, 187, 34, 28, 114, 182, 183,
+            87, 218, 33, 167, 213, 196, 48, 234, 241, 70, 89, 76, 111, 7,
+        ],
+    ],
+    [
+        [
+            37, 232, 202, 95, 118, 254, 243, 205, 180, 127, 216, 17, 97, 148, 112, 42, 250, 84,
+            232, 146, 58, 213, 87, 229, 9, 88, 246, 40, 136, 125, 78, 10,
+        ],
+        [
+            188, 137, 225, 229, 196, 113, 43, 196, 9, 6, 41, 56, 117, 157, 202, 248, 247, 199, 69,
+            162, 105, 147, 9, 112, 133, 64, 224, 1, 2, 62, 174, 51,
+        ],
+        [
+            101, 201, 205, 179, 172, 35, 58, 167, 99, 12, 7, 229, 249, 222, 20, 75, 31, 85, 8, 65,
+            156, 35, 22, 144, 248, 121, 38, 221, 230, 17, 107, 22,
+        ],
+        [
+            210, 64, 16, 86, 168, 14, 161, 143, 205, 219, 249, 21, 227, 148, 168, 102, 248, 119,
+            181, 212, 225, 211, 79, 88, 203, 13, 216, 120, 51, 200, 192, 7,
+        ],
+        [
+            166, 155, 235, 41, 141, 202, 9, 206, 75, 25, 104, 97, 28, 239, 71, 34, 217, 225, 35,
+            10, 104, 30, 83, 184, 227, 67, 76, 14, 117, 11, 49, 4,
+        ],
+        [
+            80, 29, 16, 98, 226, 236, 172, 96, 143, 116, 127, 164, 211, 167, 195, 144, 90, 35, 30,
+            37, 175, 148, 5, 193, 47, 74, 7, 127, 248, 111, 208, 46,
+        ],
+        [
+            222, 13, 22, 172, 64, 195, 247, 45, 137, 255, 220, 206, 106, 138, 183, 118, 8, 57, 185,
+            88, 175, 128, 155, 135, 117, 242, 66, 145, 188, 95, 9, 0,
+        ],
+        [
+            52, 0, 238, 239, 30, 191, 93, 152, 16, 76, 27, 30, 98, 136, 166, 19, 138, 0, 139, 247,
+            149, 8, 220, 50, 201, 182, 229, 239, 136, 191, 87, 4,
+        ],
+    ],
+    [
+        [
+            105, 215, 131, 127, 67, 108, 143, 18, 162, 181, 248, 61, 218, 82, 232, 43, 171, 70,
+            102, 12, 197, 231, 57, 224, 87, 132, 189, 40, 174, 67, 205, 23,
+        ],
+        [
+            193, 35, 208, 49, 156, 76, 127, 125, 37, 174, 206, 28, 23, 74, 214, 223, 88, 221, 47,
+            248, 110, 251, 2, 41, 38, 65, 45, 19, 179, 187, 63, 24,
+        ],
+        [
+            178, 98, 110, 6, 17, 23, 79, 37, 105, 148, 237, 89, 194, 184, 226, 85, 19, 158, 126,
+            112, 157, 16, 240, 153, 60, 195, 46, 172, 150, 229, 162, 31,
+        ],
+        [
+            167, 160, 123, 55, 171, 70, 72, 120, 175, 85, 129, 30, 118, 187, 31, 35, 13, 168, 186,
+            193, 81, 56, 60, 32, 132, 242, 55, 150, 126, 46, 209, 22,
+        ],
+        [
+            216, 130, 207, 144, 87, 74, 175, 79, 231, 2, 123, 17, 64, 227, 169, 21, 190, 76, 35,
+            230, 219, 83, 211, 189, 109, 218, 239, 234, 76, 117, 33, 56,
+        ],
+        [
+            118, 63, 187, 184, 88, 54, 195, 72, 172, 236, 147, 107, 35, 109, 68, 57, 16, 172, 137,
+            76, 60, 158, 232, 92, 36, 25, 85, 135, 175, 81, 53, 26,
+        ],
+        [
+            187, 33, 86, 227, 140, 59, 212, 98, 155, 221, 32, 11, 9, 134, 134, 226, 5, 117, 206,
+            129, 177, 250, 255, 43, 238, 111, 101, 79, 223, 221, 163, 29,
+        ],
+        [
+            77, 49, 10, 237, 205, 191, 201, 163, 163, 225, 93, 46, 239, 70, 220, 239, 203, 63, 156,
+            198, 130, 51, 176, 113, 190, 109, 84, 182, 74, 59, 114, 39,
+        ],
+    ],
+    [
+        [
+            74, 223, 30, 129, 173, 226, 128, 237, 41, 212, 70, 197, 194, 114, 220, 197, 31, 248,
+            240, 233, 234, 74, 76, 155, 238, 120, 92, 217, 121, 41, 54, 37,
+        ],
+        [
+            51, 18, 252, 47, 138, 218, 156, 211, 146, 28, 232, 59, 4, 122, 229, 8, 158, 30, 122,
+            176, 61, 43, 138, 102, 233, 3, 30, 53, 210, 16, 238, 55,
+        ],
+        [
+            13, 204, 107, 141, 43, 181, 190, 161, 141, 7, 221, 249, 6, 181, 19, 141, 27, 119, 205,
+            25, 130, 213, 121, 24, 22, 224, 51, 59, 144, 90, 149, 49,
+        ],
+        [
+            133, 62, 165, 170, 251, 128, 218, 36, 124, 28, 187, 255, 156, 154, 117, 121, 8, 219,
+            124, 166, 67, 248, 133, 158, 87, 87, 170, 11, 207, 38, 240, 58,
+        ],
+        [
+            199, 143, 63, 27, 146, 11, 253, 73, 185, 122, 150, 33, 197, 181, 179, 42, 189, 194,
+            184, 127, 35, 251, 33, 206, 226, 117, 218, 153, 62, 40, 165, 27,
+        ],
+        [
+            221, 43, 193, 158, 219, 220, 86, 127, 115, 33, 220, 90, 187, 231, 111, 152, 51, 78,
+            106, 32, 181, 71, 184, 57, 181, 23, 124, 156, 31, 201, 147, 36,
+        ],
+        [
+            64, 246, 138, 146, 102, 47, 250, 226, 46, 41, 105, 241, 112, 20, 248, 250, 148, 165, 0,
+            187, 7, 146, 141, 190, 104, 164, 180, 143, 101, 173, 100, 1,
+        ],
+        [
+            201, 115, 121, 111, 136, 21, 12, 57, 218, 66, 99, 202, 42, 227, 3, 27, 78, 20, 74, 12,
+            214, 4, 15, 4, 124, 34, 162, 49, 225, 225, 84, 35,
+        ],
+    ],
+    [
+        [
+            159, 111, 158, 169, 189, 141, 8, 1, 137, 192, 3, 165, 87, 99, 174, 203, 182, 162, 63,
+            5, 133, 2, 254, 170, 26, 95, 119, 225, 150, 113, 216, 42,
+        ],
+        [
+            191, 94, 75, 194, 137, 49, 195, 153, 50, 60, 153, 207, 98, 138, 2, 142, 34, 80, 150,
+            253, 239, 160, 29, 220, 153, 59, 121, 254, 188, 74, 125, 24,
+        ],
+        [
+            65, 69, 79, 44, 99, 131, 67, 225, 79, 150, 152, 86, 182, 50, 214, 170, 248, 1, 143,
+            244, 5, 44, 114, 55, 193, 251, 160, 170, 252, 233, 58, 6,
+        ],
+        [
+            125, 12, 108, 193, 44, 207, 226, 157, 243, 134, 14, 10, 152, 189, 13, 84, 231, 189,
+            248, 124, 69, 182, 227, 163, 51, 137, 150, 100, 10, 149, 241, 47,
+        ],
+        [
+            119, 43, 37, 67, 59, 238, 239, 138, 18, 145, 98, 57, 167, 86, 44, 100, 66, 200, 25, 99,
+            156, 250, 80, 209, 18, 132, 112, 85, 118, 64, 126, 52,
+        ],
+        [
+            148, 161, 79, 36, 118, 111, 65, 248, 70, 153, 76, 152, 1, 51, 200, 80, 24, 160, 250,
+            83, 1, 173, 246, 44, 246, 212, 29, 165, 76, 238, 138, 29,
+        ],
+        [
+            224, 67, 53, 101, 225, 107, 169, 247, 117, 223, 10, 22, 162, 0, 68, 71, 8, 158, 253,
+            123, 54, 205, 198, 242, 213, 57, 146, 153, 136, 212, 158, 38,
+        ],
+        [
+            79, 7, 45, 28, 3, 130, 10, 184, 57, 175, 24, 207, 238, 145, 124, 114, 193, 80, 179,
+            205, 12, 85, 182, 192, 23, 119, 23, 39, 77, 105, 242, 1,
+        ],
+    ],
+    [
+        [
+            28, 128, 149, 54, 197, 184, 228, 248, 116, 22, 130, 218, 24, 0, 138, 240, 183, 99, 240,
+            12, 76, 193, 95, 150, 233, 40, 47, 24, 242, 12, 142, 47,
+        ],
+        [
+            123, 40, 155, 92, 163, 34, 144, 128, 132, 10, 205, 21, 139, 110, 152, 94, 154, 247,
+            184, 195, 162, 72, 42, 127, 9, 174, 92, 158, 164, 26, 100, 12,
+        ],
+        [
+            14, 7, 174, 73, 235, 206, 1, 187, 94, 147, 150, 246, 59, 146, 80, 158, 157, 229, 197,
+            155, 62, 159, 22, 78, 40, 29, 26, 202, 230, 40, 230, 13,
+        ],
+        [
+            195, 197, 87, 192, 158, 100, 3, 125, 177, 187, 3, 10, 2, 65, 28, 26, 39, 28, 197, 134,
+            229, 2, 112, 21, 37, 217, 82, 158, 116, 16, 94, 49,
+        ],
+        [
+            172, 162, 178, 197, 3, 150, 82, 223, 22, 71, 179, 84, 232, 56, 180, 151, 162, 65, 162,
+            143, 184, 35, 8, 61, 198, 127, 43, 26, 133, 4, 118, 13,
+        ],
+        [
+            147, 99, 145, 67, 186, 57, 231, 205, 201, 14, 157, 179, 190, 189, 149, 228, 28, 139,
+            204, 174, 82, 37, 211, 157, 181, 226, 62, 7, 23, 186, 132, 9,
+        ],
+        [
+            63, 13, 19, 112, 241, 89, 54, 26, 108, 209, 48, 226, 212, 239, 141, 183, 182, 53, 89,
+            85, 39, 159, 182, 132, 216, 155, 31, 24, 24, 227, 110, 24,
+        ],
+        [
+            132, 212, 75, 16, 39, 54, 191, 5, 93, 187, 110, 211, 100, 141, 231, 28, 174, 152, 111,
+            97, 79, 208, 247, 137, 227, 192, 138, 12, 245, 160, 126, 58,
+        ],
+    ],
+    [
+        [
+            57, 61, 34, 232, 122, 223, 251, 191, 227, 31, 48, 207, 80, 199, 85, 61, 111, 163, 170,
+            122, 178, 118, 171, 213, 158, 236, 149, 204, 21, 247, 230, 45,
+        ],
+        [
+            201, 11, 237, 229, 154, 110, 13, 228, 79, 89, 39, 129, 202, 197, 20, 88, 156, 67, 37,
+            139, 244, 101, 143, 48, 191, 179, 87, 56, 51, 163, 254, 35,
+        ],
+        [
+            189, 59, 221, 156, 135, 170, 47, 88, 37, 153, 124, 23, 240, 241, 143, 128, 239, 84,
+            129, 74, 49, 122, 130, 42, 224, 225, 49, 79, 155, 231, 138, 56,
+        ],
+        [
+            102, 84, 213, 34, 181, 199, 13, 179, 15, 120, 75, 185, 191, 243, 159, 9, 133, 227, 154,
+            101, 229, 174, 195, 60, 255, 132, 107, 167, 95, 69, 33, 4,
+        ],
+        [
+            25, 164, 67, 51, 123, 35, 90, 91, 146, 113, 171, 160, 223, 19, 224, 92, 86, 80, 199,
+            245, 3, 142, 211, 254, 49, 213, 47, 192, 189, 203, 38, 25,
+        ],
+        [
+            182, 20, 78, 172, 95, 91, 88, 232, 255, 5, 234, 10, 37, 83, 71, 199, 185, 253, 140, 85,
+            3, 212, 11, 220, 17, 49, 139, 176, 192, 166, 204, 20,
+        ],
+        [
+            45, 29, 246, 97, 225, 42, 223, 183, 126, 52, 58, 176, 37, 70, 206, 18, 3, 164, 120,
+            116, 79, 221, 183, 150, 196, 254, 148, 43, 137, 252, 28, 38,
+        ],
+        [
+            227, 92, 88, 54, 209, 207, 103, 86, 224, 243, 183, 129, 108, 83, 157, 39, 226, 85, 248,
+            33, 168, 76, 25, 24, 108, 14, 210, 193, 108, 94, 200, 37,
+        ],
+    ],
+    [
+        [
+            38, 187, 218, 84, 238, 63, 122, 136, 4, 166, 244, 7, 44, 171, 39, 199, 254, 104, 13,
+            76, 206, 106, 51, 146, 31, 98, 45, 93, 157, 232, 88, 24,
+        ],
+        [
+            50, 151, 220, 232, 125, 38, 99, 189, 183, 233, 229, 180, 209, 248, 94, 202, 124, 98,
+            68, 113, 182, 128, 225, 187, 104, 97, 240, 97, 23, 2, 78, 40,
+        ],
+        [
+            185, 234, 164, 16, 117, 218, 213, 138, 219, 251, 188, 24, 130, 13, 8, 132, 114, 179,
+            127, 8, 199, 15, 108, 123, 248, 125, 98, 114, 199, 49, 151, 29,
+        ],
+        [
+            197, 33, 58, 236, 135, 100, 72, 143, 82, 48, 152, 244, 244, 128, 244, 135, 11, 49, 99,
+            223, 13, 28, 192, 60, 14, 249, 122, 63, 10, 229, 13, 48,
+        ],
+        [
+            34, 105, 164, 85, 31, 66, 87, 61, 158, 209, 230, 70, 247, 84, 104, 45, 105, 105, 183,
+            10, 12, 208, 229, 125, 81, 87, 184, 49, 231, 76, 2, 0,
+        ],
+        [
+            203, 119, 128, 246, 182, 199, 111, 67, 47, 244, 4, 182, 195, 130, 47, 70, 1, 125, 199,
+            21, 58, 32, 136, 148, 237, 67, 244, 121, 78, 17, 162, 62,
+        ],
+        [
+            168, 51, 187, 80, 154, 99, 32, 100, 2, 198, 3, 45, 40, 246, 36, 220, 72, 108, 194, 78,
+            218, 158, 38, 131, 247, 253, 100, 240, 49, 249, 198, 23,
+        ],
+        [
+            229, 127, 250, 99, 148, 180, 224, 70, 25, 12, 182, 194, 5, 32, 145, 6, 168, 60, 183,
+            43, 56, 235, 99, 57, 251, 84, 71, 154, 221, 208, 35, 17,
+        ],
+    ],
+    [
+        [
+            135, 144, 34, 253, 72, 230, 20, 130, 152, 143, 241, 69, 97, 189, 237, 136, 2, 47, 52,
+            84, 89, 203, 68, 175, 237, 219, 177, 177, 133, 204, 76, 38,
+        ],
+        [
+            77, 97, 144, 253, 187, 106, 149, 179, 219, 51, 135, 69, 243, 163, 159, 228, 37, 201,
+            106, 187, 166, 131, 150, 20, 114, 178, 182, 177, 70, 99, 99, 53,
+        ],
+        [
+            147, 219, 248, 110, 243, 241, 185, 70, 69, 79, 14, 33, 101, 231, 193, 76, 65, 21, 253,
+            231, 70, 24, 233, 13, 131, 80, 209, 106, 209, 167, 92, 9,
+        ],
+        [
+            53, 151, 111, 202, 18, 147, 183, 105, 4, 44, 90, 43, 95, 62, 49, 201, 64, 71, 81, 226,
+            235, 224, 82, 105, 110, 95, 41, 230, 242, 67, 234, 60,
+        ],
+        [
+            175, 101, 205, 91, 4, 241, 57, 85, 193, 202, 5, 102, 39, 134, 177, 26, 219, 161, 126,
+            10, 101, 104, 156, 171, 95, 235, 65, 35, 42, 178, 106, 14,
+        ],
+        [
+            111, 115, 75, 121, 96, 212, 237, 44, 87, 85, 98, 147, 98, 58, 146, 199, 151, 7, 148,
+            211, 251, 253, 34, 26, 119, 43, 225, 118, 17, 152, 137, 4,
+        ],
+        [
+            94, 127, 124, 42, 65, 235, 150, 132, 214, 217, 183, 223, 216, 49, 160, 129, 91, 51,
+            108, 194, 1, 248, 216, 206, 78, 155, 58, 141, 66, 191, 240, 52,
+        ],
+        [
+            243, 42, 140, 79, 233, 110, 28, 104, 82, 74, 76, 228, 123, 35, 55, 147, 149, 179, 155,
+            6, 149, 83, 50, 91, 175, 204, 211, 53, 217, 190, 246, 54,
+        ],
+    ],
+    [
+        [
+            102, 58, 156, 115, 172, 173, 89, 128, 136, 214, 38, 179, 183, 156, 21, 250, 113, 241,
+            164, 127, 126, 160, 49, 210, 173, 235, 100, 32, 139, 122, 165, 35,
+        ],
+        [
+            214, 61, 123, 53, 199, 34, 204, 112, 236, 150, 157, 131, 97, 109, 159, 184, 204, 152,
+            112, 42, 171, 10, 229, 65, 150, 74, 199, 231, 228, 205, 18, 17,
+        ],
+        [
+            143, 44, 3, 188, 135, 28, 111, 222, 202, 125, 214, 208, 209, 38, 114, 207, 38, 62, 183,
+            254, 238, 120, 166, 219, 143, 85, 84, 37, 103, 96, 97, 21,
+        ],
+        [
+            148, 177, 168, 127, 63, 64, 150, 26, 15, 73, 199, 97, 136, 44, 223, 51, 113, 222, 76,
+            61, 194, 129, 250, 38, 142, 42, 116, 132, 186, 150, 171, 36,
+        ],
+        [
+            174, 26, 21, 203, 190, 33, 43, 56, 157, 185, 148, 218, 225, 226, 57, 196, 252, 222, 33,
+            9, 77, 119, 244, 185, 160, 238, 70, 231, 143, 213, 138, 23,
+        ],
+        [
+            101, 125, 198, 161, 7, 227, 60, 17, 249, 182, 87, 179, 32, 124, 66, 138, 40, 159, 28,
+            75, 177, 137, 158, 141, 246, 1, 191, 232, 164, 198, 247, 21,
+        ],
+        [
+            71, 82, 237, 89, 81, 217, 75, 98, 104, 141, 129, 130, 83, 240, 123, 156, 241, 48, 199,
+            246, 16, 136, 10, 104, 198, 185, 106, 103, 17, 47, 82, 26,
+        ],
+        [
+            129, 197, 126, 12, 63, 25, 235, 35, 94, 93, 239, 89, 127, 214, 155, 151, 103, 54, 34,
+            189, 143, 198, 178, 1, 201, 250, 74, 210, 69, 22, 148, 39,
+        ],
+    ],
+    [
+        [
+            53, 13, 65, 249, 224, 244, 4, 181, 148, 177, 238, 124, 28, 105, 189, 23, 127, 239, 162,
+            120, 47, 162, 0, 111, 49, 187, 200, 30, 158, 169, 27, 4,
+        ],
+        [
+            248, 118, 85, 63, 106, 89, 195, 84, 176, 202, 161, 63, 252, 62, 59, 40, 88, 158, 170,
+            94, 6, 72, 41, 21, 123, 85, 249, 32, 173, 229, 161, 2,
+        ],
+        [
+            103, 42, 197, 89, 189, 15, 89, 67, 61, 197, 214, 87, 86, 184, 14, 73, 217, 129, 96,
+            108, 150, 253, 197, 204, 243, 238, 213, 142, 181, 53, 122, 49,
+        ],
+        [
+            53, 243, 169, 200, 115, 180, 90, 42, 194, 45, 81, 249, 67, 229, 85, 242, 10, 164, 168,
+            32, 190, 172, 71, 122, 128, 240, 32, 64, 163, 92, 204, 18,
+        ],
+        [
+            96, 253, 241, 14, 76, 21, 60, 76, 38, 190, 1, 3, 132, 19, 108, 102, 203, 218, 19, 35,
+            233, 105, 192, 81, 249, 230, 216, 144, 18, 105, 20, 4,
+        ],
+        [
+            238, 144, 36, 34, 174, 202, 176, 61, 148, 100, 1, 105, 59, 86, 166, 59, 95, 28, 8, 172,
+            145, 46, 63, 159, 175, 159, 77, 231, 12, 155, 103, 3,
+        ],
+        [
+            201, 112, 31, 187, 183, 207, 186, 133, 24, 209, 163, 240, 219, 228, 133, 40, 55, 195,
+            146, 4, 32, 38, 192, 110, 182, 143, 71, 136, 27, 200, 108, 34,
+        ],
+        [
+            254, 24, 24, 47, 115, 110, 172, 93, 17, 177, 4, 93, 201, 121, 119, 183, 19, 248, 52,
+            86, 115, 74, 223, 106, 119, 22, 187, 194, 36, 41, 19, 57,
+        ],
+    ],
+    [
+        [
+            173, 129, 213, 38, 131, 94, 122, 115, 246, 58, 95, 40, 216, 85, 100, 239, 194, 10, 35,
+            101, 93, 146, 185, 130, 211, 233, 3, 128, 56, 90, 21, 49,
+        ],
+        [
+            86, 52, 235, 254, 233, 233, 159, 162, 150, 66, 178, 36, 195, 157, 26, 251, 29, 233,
+            171, 56, 147, 154, 194, 16, 174, 161, 56, 198, 46, 150, 78, 10,
+        ],
+        [
+            155, 220, 126, 74, 39, 181, 166, 17, 12, 176, 143, 186, 34, 74, 38, 241, 35, 77, 7, 66,
+            90, 91, 119, 241, 235, 16, 35, 188, 240, 12, 225, 44,
+        ],
+        [
+            26, 128, 31, 93, 94, 250, 172, 66, 207, 87, 203, 139, 18, 19, 180, 251, 45, 132, 118,
+            214, 142, 184, 170, 6, 129, 111, 154, 229, 206, 93, 43, 62,
+        ],
+        [
+            74, 234, 78, 87, 247, 140, 239, 158, 208, 124, 182, 64, 135, 123, 226, 208, 143, 9, 28,
+            47, 76, 49, 147, 165, 163, 173, 186, 221, 64, 18, 242, 4,
+        ],
+        [
+            102, 15, 228, 6, 109, 75, 103, 53, 235, 105, 148, 112, 14, 209, 118, 15, 206, 38, 211,
+            191, 45, 59, 17, 164, 5, 97, 207, 172, 113, 174, 151, 12,
+        ],
+        [
+            182, 198, 44, 72, 215, 80, 214, 74, 36, 187, 96, 36, 75, 122, 251, 79, 111, 141, 104,
+            211, 96, 27, 154, 137, 81, 155, 237, 118, 198, 220, 240, 36,
+        ],
+        [
+            210, 226, 153, 190, 119, 238, 200, 137, 186, 126, 198, 229, 234, 35, 61, 181, 214, 235,
+            147, 87, 205, 50, 66, 220, 36, 197, 22, 203, 224, 11, 10, 60,
+        ],
+    ],
+    [
+        [
+            9, 195, 159, 120, 189, 176, 219, 20, 99, 101, 117, 114, 93, 166, 142, 90, 52, 200, 98,
+            114, 97, 126, 34, 96, 118, 185, 215, 251, 148, 77, 87, 19,
+        ],
+        [
+            50, 130, 54, 156, 8, 243, 245, 21, 115, 243, 141, 50, 57, 163, 190, 162, 186, 254, 96,
+            21, 221, 183, 159, 19, 150, 49, 249, 178, 169, 131, 75, 56,
+        ],
+        [
+            109, 254, 22, 3, 199, 134, 177, 80, 204, 161, 10, 173, 237, 126, 178, 229, 70, 30, 3,
+            246, 202, 161, 90, 229, 160, 16, 169, 202, 104, 39, 197, 1,
+        ],
+        [
+            95, 179, 233, 6, 144, 172, 174, 142, 67, 4, 33, 137, 72, 48, 108, 152, 88, 201, 234,
+            221, 234, 154, 179, 39, 209, 113, 0, 188, 222, 32, 97, 9,
+        ],
+        [
+            175, 222, 53, 19, 156, 69, 205, 48, 91, 68, 159, 242, 127, 200, 159, 55, 242, 116, 13,
+            2, 159, 225, 193, 234, 222, 33, 114, 12, 105, 215, 17, 51,
+        ],
+        [
+            123, 223, 171, 72, 167, 121, 200, 176, 52, 160, 97, 178, 109, 5, 35, 224, 48, 106, 237,
+            8, 72, 160, 22, 211, 106, 246, 196, 217, 48, 220, 133, 7,
+        ],
+        [
+            179, 44, 209, 79, 15, 63, 82, 9, 228, 138, 76, 79, 216, 127, 147, 79, 251, 107, 235,
+            27, 89, 218, 138, 32, 150, 255, 58, 171, 187, 54, 11, 59,
+        ],
+        [
+            135, 219, 120, 88, 47, 222, 125, 235, 159, 179, 137, 207, 239, 76, 254, 182, 26, 255,
+            137, 9, 114, 170, 242, 59, 147, 178, 82, 105, 120, 163, 165, 56,
+        ],
+    ],
+    [
+        [
+            49, 245, 74, 15, 79, 151, 114, 223, 88, 204, 54, 17, 223, 211, 56, 243, 140, 147, 231,
+            194, 145, 209, 115, 122, 133, 53, 65, 38, 227, 232, 194, 1,
+        ],
+        [
+            139, 234, 196, 211, 16, 253, 195, 182, 204, 43, 70, 215, 131, 12, 156, 176, 1, 181,
+            206, 180, 185, 145, 168, 245, 102, 147, 163, 131, 54, 15, 80, 23,
+        ],
+        [
+            165, 107, 0, 13, 216, 120, 63, 220, 127, 136, 126, 22, 114, 49, 104, 34, 144, 83, 117,
+            103, 73, 69, 67, 4, 94, 122, 92, 49, 45, 19, 203, 1,
+        ],
+        [
+            57, 67, 199, 232, 154, 171, 244, 107, 180, 16, 176, 181, 58, 191, 139, 1, 236, 109,
+            133, 154, 204, 81, 197, 250, 102, 135, 191, 107, 255, 138, 122, 2,
+        ],
+        [
+            131, 246, 101, 113, 122, 177, 203, 36, 187, 253, 75, 137, 138, 91, 125, 116, 201, 131,
+            188, 164, 176, 158, 228, 168, 44, 79, 52, 106, 14, 190, 26, 15,
+        ],
+        [
+            151, 24, 233, 35, 43, 183, 63, 142, 143, 124, 217, 64, 36, 225, 65, 100, 127, 232, 86,
+            46, 96, 33, 120, 128, 99, 189, 77, 103, 75, 50, 238, 6,
+        ],
+        [
+            34, 188, 40, 2, 222, 186, 165, 32, 19, 108, 101, 182, 124, 106, 225, 221, 244, 29, 251,
+            184, 252, 107, 39, 20, 41, 194, 2, 225, 147, 17, 254, 11,
+        ],
+        [
+            163, 210, 154, 39, 136, 44, 144, 169, 139, 196, 107, 36, 58, 100, 18, 249, 234, 224,
+            179, 133, 22, 54, 204, 86, 254, 146, 34, 170, 164, 208, 141, 21,
+        ],
+    ],
+    [
+        [
+            212, 57, 196, 255, 116, 10, 198, 162, 235, 70, 204, 155, 155, 252, 182, 251, 108, 89,
+            15, 66, 200, 235, 157, 30, 193, 55, 170, 25, 48, 150, 174, 46,
+        ],
+        [
+            73, 15, 246, 147, 31, 114, 184, 23, 189, 135, 237, 223, 46, 217, 219, 63, 199, 115,
+            114, 227, 255, 93, 219, 162, 47, 89, 95, 196, 97, 180, 109, 13,
+        ],
+        [
+            45, 49, 142, 52, 248, 150, 56, 109, 99, 149, 25, 160, 166, 240, 96, 241, 94, 77, 44,
+            217, 50, 231, 124, 213, 185, 3, 125, 168, 173, 6, 149, 32,
+        ],
+        [
+            244, 199, 196, 141, 35, 8, 94, 117, 100, 81, 106, 254, 233, 180, 12, 237, 206, 142,
+            228, 141, 79, 50, 119, 16, 94, 134, 158, 85, 242, 31, 30, 28,
+        ],
+        [
+            250, 118, 28, 156, 124, 151, 194, 243, 252, 135, 49, 133, 184, 151, 1, 52, 72, 62, 209,
+            219, 159, 239, 199, 118, 233, 81, 13, 246, 154, 95, 91, 43,
+        ],
+        [
+            148, 41, 120, 124, 79, 58, 248, 13, 19, 168, 125, 163, 96, 7, 180, 190, 86, 81, 43,
+            249, 183, 109, 169, 50, 192, 65, 153, 58, 251, 95, 239, 21,
+        ],
+        [
+            5, 221, 39, 209, 61, 5, 170, 169, 239, 185, 230, 104, 97, 144, 169, 124, 53, 203, 90,
+            37, 53, 149, 7, 245, 142, 65, 195, 158, 58, 92, 201, 37,
+        ],
+        [
+            109, 213, 234, 137, 252, 160, 129, 210, 249, 154, 254, 3, 240, 28, 166, 22, 170, 196,
+            203, 240, 186, 131, 234, 216, 184, 66, 6, 144, 171, 241, 92, 1,
+        ],
+    ],
+    [
+        [
+            146, 223, 54, 195, 85, 234, 248, 34, 125, 125, 215, 25, 174, 180, 216, 60, 247, 5, 128,
+            182, 151, 217, 164, 205, 118, 170, 184, 236, 149, 62, 161, 31,
+        ],
+        [
+            158, 58, 122, 20, 197, 199, 64, 124, 63, 206, 24, 117, 236, 141, 106, 97, 204, 4, 166,
+            196, 2, 159, 166, 146, 177, 180, 47, 37, 223, 86, 168, 50,
+        ],
+        [
+            191, 163, 218, 160, 251, 127, 243, 25, 144, 88, 178, 19, 43, 249, 66, 139, 164, 15,
+            131, 116, 254, 213, 218, 126, 7, 46, 54, 49, 182, 86, 54, 49,
+        ],
+        [
+            176, 149, 25, 128, 24, 242, 7, 223, 3, 207, 221, 176, 138, 82, 192, 185, 45, 4, 156,
+            186, 96, 62, 244, 74, 238, 175, 172, 183, 208, 96, 65, 23,
+        ],
+        [
+            134, 58, 211, 81, 238, 63, 222, 132, 104, 11, 49, 26, 146, 71, 92, 37, 4, 252, 51, 65,
+            9, 121, 189, 239, 11, 47, 203, 247, 143, 50, 132, 54,
+        ],
+        [
+            7, 85, 156, 94, 147, 75, 20, 40, 58, 92, 141, 16, 69, 205, 224, 177, 209, 40, 15, 100,
+            7, 13, 58, 29, 145, 223, 215, 21, 191, 226, 26, 26,
+        ],
+        [
+            105, 133, 138, 132, 202, 221, 113, 164, 179, 179, 245, 43, 54, 164, 13, 169, 7, 52,
+            252, 75, 143, 31, 125, 18, 194, 160, 85, 116, 60, 199, 14, 15,
+        ],
+        [
+            222, 114, 216, 202, 53, 243, 194, 143, 86, 50, 1, 196, 113, 133, 21, 229, 241, 197,
+            143, 128, 57, 76, 134, 162, 241, 28, 204, 249, 86, 196, 47, 10,
+        ],
+    ],
+    [
+        [
+            140, 34, 41, 75, 234, 68, 6, 132, 20, 133, 22, 50, 10, 116, 214, 160, 101, 67, 255,
+            164, 173, 182, 183, 76, 45, 64, 169, 10, 74, 111, 151, 52,
+        ],
+        [
+            71, 77, 105, 249, 106, 189, 164, 179, 236, 36, 83, 6, 53, 110, 222, 110, 253, 41, 11,
+            117, 83, 57, 16, 185, 170, 25, 13, 28, 45, 60, 212, 15,
+        ],
+        [
+            0, 204, 125, 241, 248, 116, 213, 191, 28, 250, 46, 137, 128, 107, 187, 108, 190, 128,
+            27, 164, 49, 254, 86, 174, 177, 238, 60, 155, 114, 217, 225, 5,
+        ],
+        [
+            5, 158, 38, 49, 215, 186, 131, 56, 21, 200, 199, 31, 227, 172, 45, 39, 28, 45, 55, 159,
+            55, 126, 34, 40, 255, 233, 126, 173, 178, 210, 125, 17,
+        ],
+        [
+            113, 248, 161, 198, 225, 135, 51, 248, 203, 94, 37, 238, 150, 41, 243, 222, 105, 48,
+            92, 81, 134, 6, 41, 57, 203, 211, 57, 112, 143, 221, 240, 31,
+        ],
+        [
+            82, 243, 29, 216, 118, 139, 147, 98, 208, 80, 146, 98, 142, 127, 201, 193, 94, 5, 240,
+            169, 154, 187, 169, 187, 181, 108, 16, 176, 52, 153, 185, 40,
+        ],
+        [
+            180, 4, 216, 113, 228, 196, 165, 187, 181, 24, 182, 129, 143, 90, 54, 102, 39, 216,
+            246, 28, 202, 130, 130, 164, 164, 23, 204, 3, 93, 252, 160, 19,
+        ],
+        [
+            236, 183, 190, 138, 148, 47, 164, 106, 37, 140, 60, 83, 100, 87, 25, 94, 3, 155, 36,
+            217, 2, 9, 122, 48, 59, 74, 238, 62, 235, 254, 76, 63,
+        ],
+    ],
+    [
+        [
+            145, 2, 88, 168, 72, 120, 32, 138, 82, 71, 120, 197, 202, 217, 99, 230, 103, 161, 20,
+            69, 139, 231, 10, 20, 223, 19, 104, 101, 97, 42, 121, 13,
+        ],
+        [
+            249, 255, 74, 127, 202, 45, 113, 91, 135, 69, 14, 75, 180, 46, 26, 41, 213, 68, 168,
+            203, 107, 4, 15, 223, 81, 162, 37, 185, 230, 130, 218, 24,
+        ],
+        [
+            229, 23, 249, 95, 149, 172, 105, 186, 130, 22, 109, 90, 114, 118, 91, 227, 63, 199,
+            106, 119, 238, 16, 55, 220, 45, 208, 52, 63, 237, 194, 126, 22,
+        ],
+        [
+            236, 224, 208, 190, 253, 62, 123, 39, 67, 207, 40, 133, 104, 99, 14, 59, 29, 45, 212,
+            230, 238, 156, 59, 211, 201, 28, 6, 135, 6, 170, 41, 2,
+        ],
+        [
+            117, 186, 35, 47, 195, 87, 43, 185, 50, 136, 121, 104, 52, 109, 241, 221, 160, 100, 34,
+            72, 217, 36, 69, 240, 185, 82, 33, 24, 82, 146, 129, 22,
+        ],
+        [
+            40, 216, 70, 160, 218, 185, 168, 230, 67, 74, 241, 72, 30, 56, 73, 212, 29, 131, 210,
+            56, 61, 138, 16, 72, 74, 208, 175, 95, 233, 23, 68, 50,
+        ],
+        [
+            250, 249, 247, 170, 88, 230, 224, 198, 25, 123, 18, 15, 231, 56, 213, 167, 70, 89, 25,
+            233, 30, 104, 240, 125, 246, 136, 189, 24, 2, 217, 184, 57,
+        ],
+        [
+            80, 221, 4, 106, 97, 0, 93, 65, 187, 49, 74, 27, 59, 42, 216, 255, 178, 111, 209, 168,
+            148, 213, 149, 222, 244, 237, 45, 14, 247, 140, 147, 24,
+        ],
+    ],
+    [
+        [
+            103, 89, 59, 35, 57, 15, 73, 153, 88, 110, 137, 148, 85, 109, 160, 59, 21, 153, 234,
+            11, 211, 42, 66, 211, 68, 38, 15, 82, 233, 242, 246, 56,
+        ],
+        [
+            96, 192, 241, 71, 162, 188, 189, 54, 176, 170, 74, 155, 210, 182, 205, 213, 187, 53,
+            60, 231, 143, 251, 199, 78, 247, 216, 140, 90, 128, 175, 11, 44,
+        ],
+        [
+            10, 136, 130, 80, 243, 131, 6, 45, 149, 177, 198, 249, 148, 33, 121, 208, 241, 179,
+            254, 129, 63, 128, 87, 98, 82, 74, 178, 206, 136, 237, 177, 54,
+        ],
+        [
+            140, 174, 124, 27, 24, 16, 89, 115, 91, 12, 227, 201, 107, 37, 48, 219, 159, 96, 137,
+            160, 17, 96, 226, 109, 216, 54, 158, 68, 1, 57, 62, 21,
+        ],
+        [
+            184, 104, 44, 147, 115, 104, 146, 195, 48, 83, 156, 79, 62, 14, 137, 213, 20, 2, 64,
+            71, 19, 82, 188, 223, 162, 170, 239, 238, 32, 92, 100, 27,
+        ],
+        [
+            207, 172, 15, 212, 186, 64, 30, 3, 26, 41, 32, 48, 108, 230, 73, 168, 130, 44, 140,
+            210, 212, 140, 38, 79, 89, 154, 72, 38, 234, 29, 111, 46,
+        ],
+        [
+            169, 251, 74, 195, 182, 161, 15, 245, 9, 175, 45, 68, 112, 77, 254, 175, 101, 57, 117,
+            229, 114, 240, 162, 49, 79, 195, 76, 222, 24, 29, 205, 49,
+        ],
+        [
+            66, 42, 240, 58, 215, 243, 13, 29, 121, 8, 251, 212, 227, 43, 108, 116, 167, 146, 112,
+            29, 157, 28, 232, 63, 40, 136, 60, 181, 113, 116, 136, 9,
+        ],
+    ],
+    [
+        [
+            222, 250, 15, 159, 22, 192, 63, 242, 244, 9, 170, 199, 36, 12, 22, 135, 36, 103, 27,
+            30, 210, 19, 220, 227, 198, 202, 170, 11, 171, 226, 120, 36,
+        ],
+        [
+            13, 233, 60, 66, 94, 62, 80, 17, 51, 96, 92, 52, 194, 151, 201, 43, 145, 244, 136, 54,
+            62, 228, 178, 17, 237, 50, 43, 86, 226, 186, 205, 39,
+        ],
+        [
+            17, 178, 141, 143, 150, 198, 188, 109, 202, 15, 246, 81, 81, 23, 194, 33, 100, 215, 33,
+            38, 128, 94, 173, 211, 250, 255, 185, 53, 26, 15, 100, 1,
+        ],
+        [
+            29, 13, 207, 26, 98, 99, 13, 249, 166, 223, 134, 57, 202, 243, 56, 134, 47, 86, 77,
+            174, 126, 82, 11, 136, 206, 200, 80, 142, 133, 59, 226, 45,
+        ],
+        [
+            30, 246, 189, 45, 47, 225, 241, 181, 46, 77, 149, 202, 125, 19, 150, 189, 61, 110, 166,
+            235, 18, 47, 82, 23, 31, 253, 45, 168, 199, 197, 100, 13,
+        ],
+        [
+            163, 144, 73, 57, 237, 138, 87, 249, 81, 92, 134, 158, 7, 198, 181, 121, 235, 165, 27,
+            22, 195, 193, 81, 182, 82, 147, 125, 185, 230, 127, 212, 41,
+        ],
+        [
+            99, 53, 81, 32, 186, 67, 123, 181, 118, 216, 51, 213, 48, 132, 99, 168, 17, 212, 8,
+            180, 183, 132, 100, 75, 201, 55, 13, 103, 31, 134, 12, 29,
+        ],
+        [
+            204, 31, 149, 83, 95, 245, 53, 231, 200, 193, 124, 32, 42, 222, 91, 84, 37, 117, 53,
+            116, 166, 28, 165, 6, 7, 88, 156, 0, 217, 37, 205, 21,
+        ],
+    ],
+    [
+        [
+            133, 125, 183, 101, 61, 147, 72, 149, 191, 124, 2, 158, 189, 180, 148, 247, 242, 130,
+            157, 154, 138, 32, 39, 113, 18, 103, 212, 2, 52, 42, 150, 9,
+        ],
+        [
+            155, 153, 34, 249, 57, 253, 43, 212, 131, 227, 138, 238, 250, 38, 95, 115, 158, 179,
+            220, 114, 87, 215, 143, 24, 139, 211, 161, 25, 165, 127, 26, 46,
+        ],
+        [
+            248, 24, 188, 125, 43, 117, 180, 162, 154, 30, 111, 77, 63, 80, 222, 213, 39, 94, 105,
+            244, 205, 160, 240, 125, 127, 22, 68, 60, 4, 159, 101, 12,
+        ],
+        [
+            202, 182, 101, 247, 202, 184, 249, 165, 48, 157, 78, 244, 161, 129, 213, 241, 85, 55,
+            1, 148, 152, 20, 217, 134, 226, 216, 98, 32, 63, 115, 205, 2,
+        ],
+        [
+            12, 227, 112, 199, 148, 87, 71, 67, 63, 109, 117, 99, 32, 35, 55, 108, 13, 99, 205,
+            173, 201, 27, 223, 79, 14, 136, 251, 75, 29, 113, 7, 9,
+        ],
+        [
+            53, 122, 33, 1, 148, 172, 48, 164, 95, 139, 231, 211, 62, 152, 233, 208, 6, 67, 40,
+            162, 85, 247, 207, 27, 71, 148, 238, 1, 166, 101, 154, 35,
+        ],
+        [
+            161, 30, 55, 238, 200, 130, 23, 62, 183, 234, 222, 236, 186, 80, 177, 71, 226, 12, 18,
+            136, 149, 181, 12, 186, 197, 176, 30, 124, 178, 222, 31, 26,
+        ],
+        [
+            220, 42, 168, 151, 75, 170, 70, 232, 113, 157, 111, 72, 209, 182, 214, 18, 203, 62,
+            193, 190, 220, 44, 144, 225, 236, 250, 122, 80, 83, 193, 125, 22,
+        ],
+    ],
+    [
+        [
+            170, 49, 110, 163, 118, 15, 74, 16, 140, 62, 228, 247, 212, 253, 62, 59, 14, 30, 160,
+            139, 165, 77, 221, 157, 50, 217, 113, 202, 56, 132, 252, 23,
+        ],
+        [
+            204, 248, 203, 88, 186, 179, 102, 131, 176, 162, 204, 93, 132, 134, 140, 44, 190, 111,
+            170, 182, 182, 154, 34, 182, 72, 145, 249, 218, 227, 222, 127, 57,
+        ],
+        [
+            243, 181, 217, 123, 251, 210, 151, 17, 234, 18, 151, 41, 199, 190, 68, 25, 143, 119,
+            47, 117, 196, 126, 170, 4, 2, 92, 76, 45, 165, 7, 67, 32,
+        ],
+        [
+            78, 151, 250, 251, 145, 247, 127, 21, 8, 78, 75, 203, 87, 88, 88, 192, 254, 127, 173,
+            160, 123, 221, 115, 242, 177, 65, 250, 109, 60, 243, 66, 50,
+        ],
+        [
+            163, 204, 67, 168, 29, 250, 242, 18, 179, 78, 156, 63, 83, 213, 155, 169, 201, 141,
+            147, 39, 67, 201, 27, 185, 12, 136, 169, 136, 90, 250, 59, 61,
+        ],
+        [
+            217, 130, 254, 58, 106, 222, 13, 57, 188, 196, 184, 159, 16, 125, 101, 76, 237, 202,
+            20, 154, 36, 171, 17, 203, 30, 174, 71, 28, 49, 14, 11, 40,
+        ],
+        [
+            103, 104, 113, 172, 174, 8, 232, 248, 176, 114, 142, 202, 124, 57, 147, 248, 183, 13,
+            100, 169, 5, 175, 203, 142, 150, 76, 116, 217, 74, 87, 193, 61,
+        ],
+        [
+            106, 70, 255, 164, 171, 32, 41, 157, 50, 76, 235, 158, 79, 146, 163, 103, 55, 210, 247,
+            65, 12, 143, 226, 228, 134, 223, 111, 57, 117, 0, 158, 19,
+        ],
+    ],
+    [
+        [
+            209, 91, 126, 65, 66, 75, 243, 162, 155, 127, 161, 141, 1, 207, 59, 241, 167, 100, 208,
+            242, 202, 136, 148, 80, 250, 199, 246, 122, 195, 21, 17, 50,
+        ],
+        [
+            160, 23, 252, 146, 181, 244, 35, 83, 49, 80, 175, 137, 187, 14, 153, 154, 210, 170,
+            253, 239, 189, 159, 66, 83, 46, 47, 203, 221, 74, 96, 231, 31,
+        ],
+        [
+            255, 28, 169, 35, 131, 9, 128, 83, 53, 153, 78, 112, 201, 215, 113, 204, 14, 161, 70,
+            21, 43, 234, 162, 8, 50, 202, 178, 229, 163, 231, 75, 0,
+        ],
+        [
+            151, 7, 75, 95, 206, 3, 186, 193, 10, 216, 191, 56, 5, 241, 211, 41, 176, 163, 112,
+            226, 119, 198, 67, 29, 86, 77, 125, 189, 42, 244, 37, 63,
+        ],
+        [
+            22, 69, 53, 55, 24, 217, 190, 106, 17, 30, 46, 219, 19, 13, 91, 88, 52, 239, 230, 65,
+            172, 249, 117, 14, 212, 76, 50, 219, 63, 85, 85, 44,
+        ],
+        [
+            95, 67, 36, 155, 161, 152, 90, 49, 98, 250, 31, 40, 227, 83, 13, 63, 152, 78, 52, 55,
+            179, 174, 109, 115, 237, 188, 143, 119, 39, 205, 240, 52,
+        ],
+        [
+            191, 218, 230, 242, 222, 153, 9, 6, 184, 144, 39, 153, 17, 47, 235, 11, 156, 237, 106,
+            25, 226, 22, 204, 91, 174, 13, 118, 159, 67, 192, 180, 11,
+        ],
+        [
+            64, 139, 49, 104, 152, 44, 115, 188, 115, 244, 108, 247, 152, 36, 76, 87, 197, 145,
+            122, 252, 164, 179, 33, 139, 178, 33, 91, 180, 55, 198, 116, 28,
+        ],
+    ],
+    [
+        [
+            121, 138, 217, 165, 137, 32, 102, 122, 2, 132, 235, 209, 189, 143, 126, 154, 255, 192,
+            11, 18, 192, 180, 141, 158, 58, 213, 167, 150, 144, 12, 137, 32,
+        ],
+        [
+            37, 68, 105, 192, 246, 223, 110, 73, 212, 170, 113, 192, 94, 48, 75, 145, 180, 144, 57,
+            168, 175, 175, 116, 14, 144, 230, 2, 71, 231, 227, 93, 22,
+        ],
+        [
+            55, 239, 250, 161, 54, 154, 33, 206, 228, 249, 45, 126, 12, 187, 171, 233, 179, 141,
+            113, 128, 26, 208, 66, 163, 119, 5, 134, 70, 212, 91, 126, 25,
+        ],
+        [
+            211, 218, 167, 184, 136, 234, 50, 153, 235, 240, 121, 105, 75, 92, 134, 203, 54, 9,
+            240, 37, 132, 51, 94, 62, 227, 206, 227, 26, 232, 80, 50, 58,
+        ],
+        [
+            247, 153, 165, 91, 186, 187, 160, 101, 181, 94, 109, 64, 195, 54, 10, 53, 122, 95, 94,
+            223, 224, 187, 3, 166, 202, 12, 226, 250, 194, 230, 14, 14,
+        ],
+        [
+            84, 40, 61, 75, 7, 180, 84, 252, 149, 110, 235, 145, 230, 102, 43, 59, 84, 177, 15, 72,
+            245, 45, 100, 181, 159, 135, 73, 70, 45, 130, 23, 15,
+        ],
+        [
+            176, 95, 212, 132, 225, 23, 127, 234, 119, 13, 97, 153, 63, 184, 203, 20, 158, 129, 71,
+            212, 187, 114, 5, 66, 8, 255, 197, 184, 58, 87, 53, 46,
+        ],
+        [
+            16, 127, 94, 241, 202, 213, 70, 104, 66, 253, 252, 251, 32, 90, 82, 235, 212, 171, 176,
+            158, 111, 171, 170, 223, 21, 135, 124, 8, 2, 163, 132, 60,
+        ],
+    ],
+    [
+        [
+            227, 106, 232, 144, 99, 103, 224, 175, 110, 11, 138, 168, 36, 37, 51, 178, 223, 20,
+            214, 254, 112, 70, 96, 185, 211, 87, 83, 197, 104, 243, 216, 52,
+        ],
+        [
+            130, 229, 53, 255, 238, 87, 247, 194, 175, 43, 49, 133, 15, 9, 230, 116, 200, 212, 229,
+            179, 231, 4, 15, 203, 110, 47, 4, 130, 136, 86, 48, 49,
+        ],
+        [
+            47, 243, 195, 44, 235, 13, 162, 169, 83, 152, 125, 54, 110, 131, 234, 38, 185, 159,
+            162, 155, 244, 43, 221, 221, 205, 171, 95, 242, 148, 151, 11, 35,
+        ],
+        [
+            167, 90, 16, 27, 245, 22, 86, 47, 185, 27, 129, 85, 243, 61, 176, 192, 183, 132, 79,
+            230, 218, 19, 237, 23, 105, 124, 208, 38, 178, 255, 128, 42,
+        ],
+        [
+            254, 42, 152, 192, 222, 80, 229, 159, 80, 221, 180, 50, 154, 115, 132, 186, 232, 133,
+            81, 52, 49, 138, 192, 67, 159, 157, 6, 159, 63, 244, 18, 39,
+        ],
+        [
+            82, 238, 44, 142, 105, 250, 102, 225, 160, 86, 185, 241, 244, 228, 45, 98, 14, 6, 186,
+            3, 103, 72, 115, 129, 220, 107, 87, 25, 18, 239, 41, 61,
+        ],
+        [
+            38, 96, 137, 193, 31, 196, 122, 212, 249, 106, 137, 240, 9, 1, 244, 43, 246, 195, 28,
+            79, 40, 193, 249, 111, 177, 171, 178, 146, 5, 130, 199, 38,
+        ],
+        [
+            49, 138, 50, 43, 88, 47, 129, 40, 253, 221, 234, 179, 108, 110, 16, 164, 236, 146, 134,
+            226, 92, 142, 158, 18, 75, 148, 196, 99, 142, 193, 32, 32,
+        ],
+    ],
+    [
+        [
+            136, 222, 31, 32, 158, 114, 150, 51, 255, 249, 195, 251, 49, 203, 33, 38, 143, 117,
+            158, 139, 35, 54, 168, 163, 36, 5, 4, 24, 21, 107, 32, 8,
+        ],
+        [
+            139, 142, 184, 112, 128, 119, 77, 133, 53, 144, 84, 23, 177, 2, 187, 179, 30, 93, 90,
+            138, 73, 70, 129, 214, 185, 249, 38, 44, 114, 66, 31, 60,
+        ],
+        [
+            70, 234, 44, 237, 63, 86, 138, 80, 38, 77, 0, 237, 105, 160, 161, 106, 73, 199, 70,
+            235, 14, 227, 136, 202, 144, 196, 163, 81, 111, 106, 82, 47,
+        ],
+        [
+            40, 88, 203, 143, 239, 58, 0, 59, 249, 62, 40, 239, 19, 92, 207, 51, 252, 63, 205, 29,
+            238, 11, 59, 181, 106, 136, 22, 181, 36, 21, 177, 16,
+        ],
+        [
+            75, 228, 4, 173, 170, 140, 175, 235, 102, 195, 159, 243, 64, 41, 21, 2, 246, 29, 242,
+            42, 219, 89, 14, 181, 195, 64, 36, 206, 219, 19, 201, 43,
+        ],
+        [
+            99, 70, 84, 229, 213, 64, 250, 175, 183, 122, 91, 174, 129, 41, 175, 77, 133, 253, 111,
+            83, 20, 196, 125, 248, 230, 8, 189, 219, 198, 132, 117, 49,
+        ],
+        [
+            146, 31, 155, 47, 167, 160, 234, 249, 196, 38, 83, 35, 96, 191, 69, 232, 164, 232, 241,
+            225, 121, 189, 98, 1, 45, 228, 7, 52, 137, 87, 156, 55,
+        ],
+        [
+            160, 123, 219, 27, 246, 32, 134, 120, 16, 76, 98, 152, 240, 140, 17, 236, 43, 181, 91,
+            154, 12, 80, 78, 141, 209, 68, 179, 131, 134, 238, 214, 29,
+        ],
+    ],
+    [
+        [
+            79, 127, 50, 0, 17, 192, 72, 76, 17, 57, 216, 82, 157, 95, 86, 152, 6, 69, 246, 36,
+            130, 33, 231, 72, 62, 180, 179, 180, 172, 195, 145, 54,
+        ],
+        [
+            218, 244, 56, 14, 177, 227, 196, 223, 249, 8, 61, 252, 143, 208, 236, 117, 16, 219, 26,
+            78, 111, 76, 253, 21, 89, 97, 133, 31, 219, 214, 130, 53,
+        ],
+        [
+            224, 191, 66, 62, 230, 117, 56, 49, 22, 179, 57, 155, 161, 72, 246, 216, 122, 170, 226,
+            178, 168, 99, 213, 40, 172, 104, 214, 235, 100, 7, 215, 26,
+        ],
+        [
+            97, 165, 191, 166, 199, 215, 159, 154, 9, 200, 98, 51, 193, 16, 119, 135, 8, 248, 235,
+            220, 91, 233, 56, 169, 209, 80, 67, 28, 187, 214, 7, 1,
+        ],
+        [
+            164, 25, 209, 61, 23, 143, 33, 36, 199, 146, 9, 119, 86, 130, 161, 162, 230, 143, 172,
+            107, 133, 19, 27, 111, 25, 73, 186, 44, 49, 170, 143, 4,
+        ],
+        [
+            127, 165, 126, 108, 249, 181, 86, 104, 103, 188, 164, 130, 127, 57, 191, 189, 34, 108,
+            230, 187, 61, 35, 37, 253, 242, 59, 58, 175, 13, 120, 254, 56,
+        ],
+        [
+            29, 179, 113, 204, 88, 62, 212, 46, 48, 15, 107, 28, 234, 136, 13, 178, 148, 96, 68,
+            217, 137, 66, 14, 78, 65, 58, 220, 221, 241, 155, 202, 12,
+        ],
+        [
+            104, 142, 48, 244, 1, 124, 44, 185, 200, 192, 86, 131, 156, 158, 4, 187, 199, 14, 236,
+            54, 44, 245, 21, 182, 113, 231, 13, 142, 135, 88, 169, 36,
+        ],
+    ],
+    [
+        [
+            179, 250, 191, 143, 76, 85, 98, 204, 132, 233, 251, 175, 209, 74, 137, 39, 203, 149,
+            63, 252, 246, 49, 40, 30, 148, 93, 65, 201, 161, 49, 187, 27,
+        ],
+        [
+            203, 211, 179, 86, 16, 67, 209, 167, 214, 211, 109, 229, 33, 25, 211, 188, 130, 46,
+            186, 119, 41, 173, 245, 62, 7, 55, 108, 180, 101, 115, 125, 40,
+        ],
+        [
+            107, 22, 94, 96, 173, 204, 250, 22, 118, 142, 197, 250, 65, 193, 108, 142, 129, 40, 6,
+            13, 218, 17, 207, 193, 75, 1, 195, 27, 7, 231, 199, 17,
+        ],
+        [
+            167, 104, 62, 170, 140, 224, 10, 224, 33, 72, 34, 192, 184, 14, 139, 230, 42, 70, 2,
+            10, 88, 218, 169, 123, 65, 198, 119, 16, 205, 62, 64, 8,
+        ],
+        [
+            222, 193, 21, 182, 77, 38, 168, 6, 156, 213, 49, 108, 180, 47, 54, 151, 129, 51, 137,
+            226, 103, 85, 108, 252, 94, 11, 25, 7, 56, 87, 205, 46,
+        ],
+        [
+            55, 109, 243, 206, 205, 71, 42, 29, 223, 73, 27, 225, 255, 37, 205, 42, 134, 63, 249,
+            2, 91, 152, 44, 111, 202, 23, 173, 135, 200, 207, 39, 48,
+        ],
+        [
+            80, 30, 91, 2, 97, 101, 54, 60, 211, 197, 233, 83, 35, 26, 41, 184, 198, 11, 20, 81,
+            130, 203, 153, 178, 149, 187, 189, 223, 113, 175, 177, 27,
+        ],
+        [
+            215, 49, 5, 95, 100, 130, 208, 94, 159, 34, 242, 80, 221, 34, 75, 165, 167, 184, 118,
+            14, 8, 33, 83, 229, 192, 200, 102, 128, 209, 220, 60, 27,
+        ],
+    ],
+    [
+        [
+            19, 126, 36, 206, 173, 162, 196, 15, 59, 89, 70, 64, 231, 230, 176, 226, 171, 99, 59,
+            85, 145, 57, 65, 100, 8, 220, 66, 151, 211, 189, 26, 60,
+        ],
+        [
+            115, 58, 171, 209, 149, 12, 201, 125, 168, 145, 30, 99, 185, 185, 212, 83, 153, 170,
+            149, 248, 139, 170, 213, 67, 185, 31, 106, 163, 137, 210, 53, 40,
+        ],
+        [
+            34, 169, 41, 154, 168, 16, 208, 29, 254, 75, 80, 21, 20, 65, 127, 18, 19, 245, 106,
+            199, 144, 115, 206, 170, 49, 72, 36, 89, 242, 157, 222, 24,
+        ],
+        [
+            10, 164, 200, 254, 5, 101, 144, 74, 139, 202, 71, 210, 151, 43, 63, 228, 174, 239, 5,
+            186, 214, 250, 6, 184, 96, 120, 9, 180, 157, 21, 232, 36,
+        ],
+        [
+            75, 221, 109, 210, 3, 45, 141, 250, 189, 180, 105, 1, 74, 134, 4, 161, 180, 240, 1, 39,
+            29, 186, 183, 100, 136, 177, 251, 3, 22, 195, 45, 33,
+        ],
+        [
+            38, 154, 140, 7, 121, 70, 69, 229, 20, 92, 70, 49, 117, 230, 240, 101, 67, 40, 78, 8,
+            39, 107, 90, 224, 243, 224, 223, 88, 164, 130, 120, 59,
+        ],
+        [
+            160, 144, 216, 94, 228, 217, 167, 0, 168, 204, 30, 88, 222, 158, 9, 43, 233, 216, 234,
+            64, 127, 232, 242, 72, 60, 34, 181, 252, 16, 95, 161, 14,
+        ],
+        [
+            195, 165, 176, 79, 109, 182, 190, 127, 55, 224, 143, 82, 207, 108, 164, 169, 220, 92,
+            27, 213, 76, 95, 22, 114, 127, 200, 126, 188, 126, 178, 102, 63,
+        ],
+    ],
+    [
+        [
+            20, 117, 67, 54, 142, 82, 77, 181, 169, 181, 133, 0, 187, 243, 217, 179, 224, 159, 213,
+            10, 96, 54, 130, 18, 6, 84, 239, 195, 151, 65, 242, 59,
+        ],
+        [
+            66, 142, 85, 142, 44, 64, 147, 62, 104, 65, 106, 202, 192, 153, 90, 55, 96, 24, 20, 38,
+            217, 213, 123, 31, 237, 188, 139, 9, 182, 167, 141, 41,
+        ],
+        [
+            207, 161, 20, 7, 36, 203, 12, 135, 141, 208, 187, 91, 21, 156, 252, 230, 93, 132, 146,
+            151, 159, 100, 206, 7, 135, 147, 64, 130, 252, 100, 23, 60,
+        ],
+        [
+            228, 233, 251, 200, 117, 97, 78, 30, 62, 137, 82, 213, 118, 245, 200, 117, 106, 9, 38,
+            253, 58, 144, 26, 79, 166, 109, 144, 198, 249, 23, 101, 28,
+        ],
+        [
+            21, 198, 96, 23, 63, 237, 51, 143, 1, 191, 95, 232, 147, 215, 221, 203, 87, 163, 194,
+            245, 250, 167, 167, 1, 180, 181, 225, 154, 151, 182, 130, 37,
+        ],
+        [
+            162, 42, 88, 75, 53, 39, 117, 224, 28, 248, 100, 248, 181, 211, 65, 195, 192, 24, 84,
+            43, 12, 6, 16, 188, 98, 89, 177, 228, 205, 219, 60, 15,
+        ],
+        [
+            197, 110, 140, 5, 162, 128, 77, 192, 185, 62, 133, 220, 126, 39, 219, 148, 75, 228, 59,
+            187, 14, 230, 2, 226, 221, 103, 44, 215, 203, 191, 70, 37,
+        ],
+        [
+            212, 74, 149, 23, 162, 38, 156, 114, 238, 30, 148, 201, 74, 99, 236, 44, 254, 224, 30,
+            239, 35, 57, 37, 65, 27, 132, 100, 122, 31, 58, 109, 27,
+        ],
+    ],
+    [
+        [
+            103, 60, 139, 126, 17, 213, 197, 175, 109, 73, 72, 103, 183, 2, 168, 147, 229, 146,
+            163, 240, 237, 251, 74, 204, 173, 237, 2, 81, 217, 38, 198, 26,
+        ],
+        [
+            148, 142, 217, 114, 107, 45, 140, 245, 45, 85, 63, 184, 18, 254, 33, 98, 248, 215, 31,
+            13, 147, 228, 90, 147, 57, 118, 190, 54, 109, 166, 232, 40,
+        ],
+        [
+            111, 126, 218, 163, 215, 86, 243, 206, 178, 189, 67, 107, 168, 148, 148, 150, 207, 229,
+            162, 190, 99, 21, 204, 46, 137, 115, 14, 38, 124, 45, 7, 31,
+        ],
+        [
+            120, 94, 71, 150, 58, 223, 76, 228, 24, 222, 106, 138, 131, 141, 201, 114, 133, 81,
+            208, 146, 222, 53, 190, 188, 243, 101, 130, 69, 176, 0, 144, 19,
+        ],
+        [
+            75, 62, 208, 13, 106, 100, 175, 135, 189, 103, 31, 136, 188, 184, 155, 122, 111, 105,
+            240, 140, 7, 105, 177, 110, 64, 11, 23, 49, 104, 166, 225, 29,
+        ],
+        [
+            221, 18, 92, 158, 90, 112, 188, 28, 106, 101, 91, 243, 93, 143, 20, 223, 203, 242, 47,
+            39, 63, 111, 126, 205, 146, 55, 207, 185, 179, 128, 14, 17,
+        ],
+        [
+            120, 22, 161, 120, 221, 121, 204, 161, 46, 187, 5, 183, 89, 114, 196, 224, 8, 38, 101,
+            86, 52, 196, 8, 105, 71, 97, 245, 117, 232, 101, 1, 35,
+        ],
+        [
+            97, 176, 100, 220, 11, 5, 167, 93, 125, 197, 189, 160, 99, 38, 156, 187, 219, 103, 121,
+            132, 60, 6, 17, 51, 131, 182, 75, 89, 53, 115, 247, 33,
+        ],
+    ],
+    [
+        [
+            207, 159, 115, 155, 49, 140, 88, 106, 204, 148, 127, 110, 102, 239, 71, 50, 116, 241,
+            161, 21, 115, 188, 195, 172, 48, 25, 135, 77, 103, 11, 250, 8,
+        ],
+        [
+            53, 226, 49, 81, 131, 154, 93, 210, 99, 6, 241, 86, 41, 242, 116, 183, 23, 71, 226,
+            225, 139, 35, 254, 155, 10, 61, 253, 220, 96, 27, 229, 44,
+        ],
+        [
+            86, 73, 95, 110, 144, 237, 118, 227, 89, 133, 209, 162, 107, 24, 108, 6, 152, 8, 73,
+            47, 239, 83, 251, 156, 36, 137, 65, 184, 20, 7, 184, 25,
+        ],
+        [
+            73, 67, 2, 194, 3, 175, 147, 62, 215, 31, 179, 37, 248, 247, 228, 219, 86, 172, 138,
+            78, 149, 151, 231, 210, 135, 83, 48, 88, 17, 243, 157, 19,
+        ],
+        [
+            119, 233, 103, 230, 0, 17, 17, 12, 79, 202, 7, 142, 66, 32, 12, 216, 107, 223, 194, 82,
+            131, 194, 68, 181, 60, 242, 17, 198, 45, 147, 255, 22,
+        ],
+        [
+            13, 69, 173, 185, 175, 48, 175, 137, 106, 63, 5, 27, 54, 95, 201, 207, 229, 228, 54,
+            164, 143, 58, 78, 64, 12, 51, 195, 210, 204, 146, 64, 18,
+        ],
+        [
+            234, 84, 133, 114, 188, 84, 22, 238, 15, 80, 147, 93, 113, 197, 232, 9, 61, 181, 84, 9,
+            100, 102, 8, 232, 54, 143, 11, 7, 152, 206, 5, 40,
+        ],
+        [
+            57, 77, 249, 157, 194, 147, 228, 76, 88, 15, 59, 18, 116, 226, 216, 213, 113, 122, 13,
+            119, 238, 232, 215, 176, 140, 152, 158, 170, 241, 251, 236, 22,
+        ],
+    ],
+    [
+        [
+            254, 181, 68, 223, 236, 39, 90, 99, 37, 74, 79, 37, 4, 69, 15, 85, 227, 255, 6, 143,
+            164, 197, 83, 0, 74, 59, 37, 114, 82, 160, 183, 3,
+        ],
+        [
+            205, 219, 115, 69, 73, 42, 198, 241, 206, 18, 124, 136, 252, 166, 211, 154, 58, 167,
+            23, 6, 57, 205, 200, 210, 73, 181, 175, 33, 118, 232, 152, 61,
+        ],
+        [
+            131, 71, 36, 249, 192, 54, 50, 65, 9, 141, 95, 165, 255, 154, 54, 217, 250, 127, 68,
+            177, 131, 207, 66, 187, 46, 48, 135, 44, 198, 173, 172, 20,
+        ],
+        [
+            22, 128, 64, 66, 38, 59, 150, 29, 112, 190, 217, 120, 239, 211, 204, 253, 122, 62, 11,
+            237, 33, 29, 119, 205, 235, 253, 180, 87, 199, 230, 183, 60,
+        ],
+        [
+            122, 104, 29, 128, 154, 86, 116, 112, 241, 40, 109, 16, 144, 82, 222, 122, 172, 201,
+            75, 214, 205, 168, 32, 91, 203, 28, 46, 114, 218, 82, 18, 48,
+        ],
+        [
+            221, 10, 12, 130, 141, 9, 26, 13, 195, 232, 15, 60, 197, 192, 117, 229, 184, 110, 170,
+            92, 191, 138, 41, 66, 27, 60, 210, 156, 199, 115, 164, 56,
+        ],
+        [
+            121, 35, 54, 98, 55, 143, 52, 179, 2, 61, 161, 109, 169, 148, 239, 238, 9, 164, 231,
+            216, 160, 162, 173, 134, 231, 226, 130, 102, 239, 169, 44, 16,
+        ],
+        [
+            198, 57, 213, 12, 44, 150, 213, 163, 167, 39, 246, 18, 39, 137, 192, 35, 136, 231, 107,
+            189, 61, 27, 163, 87, 214, 83, 119, 127, 246, 239, 39, 52,
+        ],
+    ],
+    [
+        [
+            185, 73, 33, 65, 211, 14, 33, 86, 138, 6, 164, 187, 255, 69, 78, 253, 83, 184, 44, 255,
+            21, 48, 149, 155, 121, 24, 91, 115, 54, 24, 84, 62,
+        ],
+        [
+            105, 91, 120, 139, 39, 32, 121, 140, 89, 109, 59, 171, 95, 234, 21, 41, 12, 240, 246,
+            153, 66, 6, 226, 31, 80, 147, 53, 111, 250, 209, 72, 46,
+        ],
+        [
+            218, 148, 82, 157, 209, 222, 86, 248, 254, 4, 160, 225, 150, 222, 127, 75, 233, 239,
+            136, 156, 200, 19, 170, 55, 117, 74, 48, 67, 43, 33, 174, 19,
+        ],
+        [
+            182, 8, 141, 160, 94, 156, 111, 237, 26, 83, 42, 26, 164, 150, 120, 210, 90, 32, 233,
+            151, 101, 230, 235, 243, 79, 180, 152, 117, 104, 105, 2, 2,
+        ],
+        [
+            226, 88, 147, 59, 28, 120, 10, 106, 17, 3, 181, 165, 169, 42, 157, 103, 86, 16, 57, 32,
+            242, 38, 118, 199, 209, 132, 108, 29, 13, 36, 66, 45,
+        ],
+        [
+            59, 134, 13, 128, 49, 120, 104, 220, 205, 203, 247, 211, 109, 54, 2, 104, 55, 55, 174,
+            137, 145, 197, 13, 223, 14, 212, 158, 87, 174, 226, 202, 2,
+        ],
+        [
+            80, 17, 130, 225, 209, 179, 88, 96, 37, 152, 203, 70, 100, 161, 154, 37, 135, 123, 176,
+            148, 25, 121, 9, 199, 73, 179, 219, 18, 85, 186, 178, 39,
+        ],
+        [
+            20, 29, 148, 97, 111, 108, 49, 113, 63, 110, 194, 53, 35, 251, 5, 121, 46, 86, 171,
+            199, 5, 203, 87, 40, 199, 71, 83, 96, 64, 218, 212, 60,
+        ],
+    ],
+    [
+        [
+            6, 109, 206, 92, 9, 160, 131, 155, 216, 126, 46, 253, 160, 152, 216, 161, 49, 172, 17,
+            0, 184, 177, 139, 130, 101, 15, 177, 181, 10, 38, 241, 31,
+        ],
+        [
+            126, 33, 243, 169, 172, 127, 107, 116, 0, 75, 122, 15, 4, 153, 153, 58, 56, 252, 29,
+            237, 214, 219, 218, 7, 246, 151, 151, 130, 54, 99, 251, 49,
+        ],
+        [
+            111, 55, 110, 109, 255, 254, 236, 86, 100, 82, 150, 127, 142, 198, 80, 148, 106, 154,
+            232, 11, 60, 246, 170, 188, 81, 74, 56, 104, 71, 90, 205, 20,
+        ],
+        [
+            173, 19, 142, 233, 210, 176, 247, 226, 195, 87, 177, 70, 135, 96, 23, 240, 206, 171,
+            84, 205, 110, 227, 148, 138, 6, 249, 91, 77, 147, 33, 177, 45,
+        ],
+        [
+            128, 134, 78, 206, 171, 42, 66, 88, 247, 175, 4, 234, 240, 38, 148, 150, 88, 191, 245,
+            50, 103, 223, 60, 37, 82, 65, 44, 217, 181, 245, 124, 5,
+        ],
+        [
+            115, 230, 148, 128, 84, 122, 60, 46, 27, 232, 127, 51, 8, 133, 215, 66, 89, 222, 154,
+            252, 9, 233, 194, 58, 174, 236, 197, 21, 44, 241, 241, 38,
+        ],
+        [
+            67, 214, 36, 107, 4, 73, 244, 168, 44, 72, 167, 224, 3, 55, 62, 70, 237, 129, 75, 17,
+            125, 236, 204, 239, 239, 10, 117, 243, 61, 71, 202, 56,
+        ],
+        [
+            202, 195, 57, 169, 77, 192, 73, 210, 151, 66, 40, 168, 248, 195, 215, 133, 244, 89,
+            224, 48, 36, 108, 160, 23, 179, 91, 99, 229, 93, 44, 20, 45,
+        ],
+    ],
+    [
+        [
+            163, 121, 71, 96, 36, 196, 194, 47, 226, 26, 109, 145, 34, 27, 140, 139, 12, 15, 202,
+            197, 210, 27, 46, 82, 159, 203, 189, 65, 158, 83, 130, 46,
+        ],
+        [
+            253, 14, 139, 66, 95, 63, 237, 107, 113, 207, 46, 231, 223, 172, 187, 60, 60, 219, 175,
+            123, 1, 152, 96, 201, 148, 199, 2, 178, 151, 212, 109, 35,
+        ],
+        [
+            88, 58, 174, 25, 43, 75, 80, 228, 87, 94, 26, 207, 255, 176, 227, 78, 203, 97, 202,
+            141, 70, 72, 158, 251, 237, 140, 156, 1, 12, 219, 235, 44,
+        ],
+        [
+            159, 231, 8, 161, 182, 250, 9, 245, 215, 155, 99, 201, 83, 210, 129, 2, 164, 67, 100,
+            189, 238, 22, 210, 69, 176, 190, 243, 205, 207, 56, 14, 41,
+        ],
+        [
+            55, 189, 29, 92, 22, 22, 208, 205, 64, 236, 5, 66, 118, 71, 45, 43, 21, 173, 195, 90,
+            197, 129, 14, 33, 18, 29, 222, 45, 46, 196, 207, 7,
+        ],
+        [
+            82, 104, 247, 77, 232, 36, 116, 179, 196, 226, 64, 108, 3, 127, 74, 9, 64, 70, 35, 252,
+            216, 18, 8, 100, 90, 47, 119, 210, 178, 45, 195, 42,
+        ],
+        [
+            186, 14, 254, 60, 145, 38, 37, 216, 115, 22, 239, 124, 112, 128, 82, 62, 32, 124, 198,
+            228, 53, 1, 153, 169, 177, 68, 208, 228, 211, 95, 7, 9,
+        ],
+        [
+            43, 127, 253, 68, 34, 27, 115, 203, 227, 127, 190, 105, 183, 240, 215, 39, 180, 235,
+            52, 211, 22, 217, 143, 62, 206, 95, 95, 21, 179, 173, 187, 40,
+        ],
+    ],
+    [
+        [
+            131, 114, 135, 36, 105, 222, 23, 214, 185, 164, 251, 205, 92, 193, 72, 141, 238, 95,
+            30, 7, 205, 137, 109, 67, 6, 211, 254, 238, 205, 93, 248, 8,
+        ],
+        [
+            84, 246, 47, 201, 191, 63, 93, 82, 192, 92, 116, 175, 63, 184, 93, 178, 218, 82, 132,
+            246, 186, 116, 87, 8, 183, 49, 227, 163, 38, 253, 108, 26,
+        ],
+        [
+            6, 251, 41, 69, 223, 49, 29, 206, 58, 21, 142, 51, 233, 183, 17, 7, 217, 0, 81, 233,
+            202, 48, 47, 101, 165, 192, 221, 106, 85, 1, 119, 47,
+        ],
+        [
+            155, 201, 217, 190, 29, 250, 17, 180, 157, 67, 107, 96, 78, 170, 220, 10, 105, 107, 45,
+            150, 231, 202, 86, 245, 215, 155, 214, 166, 248, 64, 145, 30,
+        ],
+        [
+            83, 7, 177, 230, 141, 158, 93, 202, 158, 43, 163, 0, 254, 82, 139, 239, 126, 115, 210,
+            50, 149, 165, 220, 201, 209, 48, 24, 226, 159, 173, 118, 48,
+        ],
+        [
+            82, 210, 142, 117, 9, 95, 90, 109, 253, 87, 151, 157, 67, 189, 66, 204, 182, 59, 48,
+            38, 145, 140, 176, 206, 55, 97, 116, 204, 28, 205, 89, 24,
+        ],
+        [
+            220, 202, 253, 28, 242, 130, 86, 193, 187, 216, 73, 198, 231, 44, 233, 93, 247, 37,
+            224, 33, 48, 43, 155, 204, 152, 21, 118, 161, 73, 135, 91, 39,
+        ],
+        [
+            187, 254, 171, 174, 249, 248, 213, 106, 175, 179, 210, 131, 184, 126, 37, 35, 202, 9,
+            240, 29, 24, 239, 213, 132, 138, 116, 32, 156, 7, 113, 226, 25,
+        ],
+    ],
+    [
+        [
+            156, 164, 8, 226, 97, 207, 91, 167, 225, 181, 182, 160, 132, 78, 236, 30, 215, 20, 95,
+            9, 227, 77, 117, 68, 12, 178, 75, 43, 119, 151, 125, 3,
+        ],
+        [
+            88, 89, 242, 116, 112, 190, 26, 203, 76, 128, 41, 80, 241, 253, 69, 188, 11, 123, 28,
+            138, 47, 217, 131, 246, 104, 174, 71, 39, 91, 137, 238, 27,
+        ],
+        [
+            6, 243, 135, 48, 85, 60, 99, 53, 2, 117, 68, 224, 154, 116, 145, 216, 177, 236, 240,
+            177, 21, 13, 251, 225, 143, 176, 93, 143, 112, 171, 130, 11,
+        ],
+        [
+            165, 207, 217, 234, 178, 110, 151, 80, 150, 134, 43, 61, 131, 99, 184, 162, 158, 113,
+            155, 239, 130, 171, 157, 168, 231, 45, 113, 248, 80, 213, 51, 2,
+        ],
+        [
+            128, 168, 127, 174, 75, 22, 175, 44, 133, 227, 50, 26, 252, 142, 227, 90, 32, 56, 94,
+            252, 53, 254, 0, 174, 65, 18, 199, 215, 241, 120, 110, 55,
+        ],
+        [
+            211, 242, 54, 2, 188, 143, 153, 96, 178, 248, 47, 63, 90, 109, 94, 60, 8, 61, 25, 205,
+            123, 32, 217, 91, 125, 237, 195, 199, 225, 228, 97, 59,
+        ],
+        [
+            208, 167, 59, 171, 42, 184, 236, 23, 17, 52, 52, 174, 35, 212, 29, 143, 18, 174, 99,
+            48, 179, 44, 237, 46, 119, 4, 170, 48, 30, 79, 182, 10,
+        ],
+        [
+            106, 121, 190, 22, 158, 183, 33, 248, 175, 196, 212, 4, 160, 136, 121, 1, 110, 225,
+            143, 145, 248, 216, 225, 198, 45, 119, 247, 143, 160, 247, 172, 61,
+        ],
+    ],
+    [
+        [
+            170, 197, 210, 231, 188, 33, 170, 201, 233, 126, 60, 21, 94, 154, 254, 1, 196, 112, 19,
+            33, 164, 39, 47, 136, 105, 87, 42, 209, 126, 179, 4, 53,
+        ],
+        [
+            188, 4, 106, 142, 39, 183, 58, 78, 91, 77, 33, 182, 34, 195, 233, 151, 102, 209, 51,
+            195, 23, 95, 51, 237, 30, 112, 16, 207, 245, 125, 187, 59,
+        ],
+        [
+            15, 242, 145, 233, 209, 153, 20, 138, 166, 217, 11, 161, 243, 43, 241, 80, 125, 65, 1,
+            235, 179, 76, 8, 72, 23, 184, 85, 248, 167, 133, 69, 2,
+        ],
+        [
+            225, 27, 224, 155, 142, 0, 95, 230, 169, 31, 72, 118, 204, 184, 84, 219, 150, 161, 137,
+            193, 136, 180, 112, 183, 197, 184, 226, 97, 174, 180, 24, 11,
+        ],
+        [
+            199, 134, 139, 145, 225, 180, 173, 107, 79, 68, 52, 186, 212, 235, 203, 133, 237, 28,
+            129, 57, 178, 111, 10, 128, 182, 15, 240, 22, 78, 20, 144, 37,
+        ],
+        [
+            124, 87, 4, 136, 241, 14, 185, 35, 104, 27, 231, 201, 32, 180, 69, 222, 208, 122, 144,
+            183, 68, 218, 190, 211, 97, 52, 193, 1, 239, 155, 129, 35,
+        ],
+        [
+            196, 160, 5, 223, 59, 150, 79, 242, 92, 80, 44, 206, 218, 37, 78, 177, 242, 104, 141,
+            77, 227, 103, 140, 229, 134, 180, 34, 11, 45, 120, 81, 53,
+        ],
+        [
+            99, 157, 16, 77, 119, 202, 154, 196, 15, 121, 133, 20, 68, 176, 29, 23, 176, 41, 217,
+            190, 25, 99, 134, 214, 160, 62, 79, 119, 238, 131, 33, 36,
+        ],
+    ],
+    [
+        [
+            82, 63, 89, 161, 22, 25, 171, 246, 76, 224, 209, 2, 192, 99, 241, 215, 61, 51, 46, 111,
+            168, 154, 99, 217, 0, 4, 43, 53, 18, 209, 229, 54,
+        ],
+        [
+            167, 96, 77, 229, 175, 88, 227, 207, 122, 115, 183, 68, 181, 58, 37, 192, 5, 113, 227,
+            193, 160, 30, 159, 155, 194, 116, 35, 238, 138, 4, 110, 1,
+        ],
+        [
+            208, 142, 104, 151, 195, 118, 201, 104, 233, 25, 4, 134, 154, 101, 184, 186, 176, 240,
+            88, 47, 60, 63, 85, 49, 28, 180, 85, 205, 229, 172, 224, 23,
+        ],
+        [
+            225, 179, 202, 188, 22, 119, 248, 74, 28, 29, 26, 29, 213, 85, 201, 119, 250, 208, 90,
+            186, 188, 163, 67, 225, 7, 105, 115, 238, 100, 73, 15, 43,
+        ],
+        [
+            94, 130, 151, 41, 5, 147, 117, 3, 249, 79, 58, 213, 193, 248, 185, 183, 10, 21, 35, 63,
+            25, 84, 177, 253, 165, 102, 91, 81, 138, 219, 39, 54,
+        ],
+        [
+            176, 233, 181, 59, 196, 247, 219, 24, 149, 28, 113, 113, 133, 66, 180, 213, 204, 65,
+            88, 21, 171, 131, 99, 218, 15, 224, 29, 102, 207, 240, 157, 40,
+        ],
+        [
+            148, 66, 102, 220, 47, 53, 236, 254, 85, 226, 162, 110, 94, 77, 10, 149, 173, 16, 70,
+            31, 31, 87, 110, 6, 57, 165, 232, 79, 119, 39, 176, 12,
+        ],
+        [
+            23, 109, 174, 136, 38, 90, 212, 253, 239, 204, 23, 11, 76, 147, 151, 42, 129, 24, 229,
+            90, 202, 179, 169, 199, 57, 95, 105, 207, 109, 231, 64, 23,
+        ],
+    ],
+    [
+        [
+            210, 218, 63, 9, 74, 89, 145, 23, 196, 76, 249, 167, 105, 125, 253, 20, 49, 203, 12,
+            184, 203, 120, 138, 93, 91, 46, 186, 251, 218, 25, 70, 4,
+        ],
+        [
+            139, 120, 71, 74, 206, 5, 119, 147, 208, 109, 12, 36, 182, 63, 104, 121, 35, 248, 122,
+            36, 26, 179, 98, 242, 96, 103, 157, 145, 215, 160, 238, 37,
+        ],
+        [
+            119, 7, 93, 55, 33, 255, 127, 106, 216, 22, 144, 55, 139, 80, 136, 132, 240, 202, 42,
+            225, 208, 127, 220, 53, 244, 237, 71, 189, 88, 189, 163, 5,
+        ],
+        [
+            170, 190, 180, 72, 134, 101, 250, 194, 105, 240, 171, 146, 156, 166, 210, 64, 172, 238,
+            90, 149, 94, 59, 190, 252, 76, 134, 126, 243, 154, 205, 102, 13,
+        ],
+        [
+            61, 238, 119, 250, 17, 114, 41, 23, 62, 28, 235, 146, 48, 100, 181, 149, 254, 237, 241,
+            138, 188, 225, 84, 16, 184, 30, 56, 107, 147, 250, 66, 2,
+        ],
+        [
+            28, 109, 249, 181, 203, 172, 134, 246, 128, 130, 89, 122, 40, 47, 34, 151, 64, 90, 103,
+            136, 81, 219, 41, 175, 233, 47, 111, 72, 168, 30, 5, 56,
+        ],
+        [
+            104, 186, 155, 55, 148, 38, 106, 255, 151, 132, 138, 199, 113, 77, 212, 162, 185, 6,
+            79, 180, 229, 49, 60, 105, 198, 127, 91, 244, 214, 186, 62, 61,
+        ],
+        [
+            29, 254, 87, 7, 165, 114, 18, 76, 54, 39, 67, 130, 22, 232, 156, 152, 108, 111, 76,
+            242, 206, 188, 3, 128, 125, 61, 185, 187, 198, 48, 252, 44,
+        ],
+    ],
+    [
+        [
+            187, 50, 8, 176, 60, 67, 135, 89, 94, 138, 218, 198, 22, 101, 177, 175, 102, 240, 126,
+            241, 82, 144, 251, 102, 72, 83, 107, 48, 146, 17, 213, 28,
+        ],
+        [
+            66, 28, 29, 99, 204, 226, 10, 124, 168, 193, 84, 224, 148, 6, 106, 116, 159, 95, 220,
+            57, 114, 182, 252, 121, 106, 183, 91, 112, 135, 212, 111, 32,
+        ],
+        [
+            74, 224, 165, 3, 122, 142, 237, 166, 242, 106, 187, 40, 75, 60, 48, 81, 110, 173, 246,
+            152, 66, 206, 150, 22, 173, 227, 82, 47, 214, 31, 65, 25,
+        ],
+        [
+            241, 175, 29, 66, 85, 85, 198, 49, 73, 114, 59, 93, 17, 168, 52, 23, 229, 172, 95, 205,
+            71, 36, 103, 168, 242, 113, 13, 36, 233, 30, 70, 12,
+        ],
+        [
+            237, 63, 61, 13, 103, 181, 237, 70, 72, 231, 126, 24, 8, 136, 64, 33, 107, 250, 198,
+            207, 196, 179, 175, 29, 224, 86, 78, 2, 162, 171, 147, 0,
+        ],
+        [
+            11, 93, 3, 235, 245, 18, 55, 148, 155, 241, 206, 53, 156, 60, 107, 8, 149, 42, 57, 117,
+            150, 13, 151, 213, 8, 223, 186, 100, 167, 163, 208, 4,
+        ],
+        [
+            101, 234, 84, 111, 45, 42, 194, 165, 16, 135, 160, 248, 114, 253, 44, 141, 91, 202, 39,
+            81, 92, 168, 4, 92, 33, 196, 29, 132, 94, 49, 171, 36,
+        ],
+        [
+            170, 78, 106, 212, 212, 78, 86, 18, 151, 82, 184, 101, 228, 37, 105, 224, 43, 102, 141,
+            27, 19, 208, 35, 122, 31, 89, 86, 64, 192, 221, 17, 17,
+        ],
+    ],
+    [
+        [
+            151, 50, 9, 177, 173, 66, 105, 137, 98, 60, 243, 94, 35, 26, 166, 35, 163, 143, 255,
+            135, 238, 117, 197, 96, 41, 128, 136, 136, 152, 185, 32, 22,
+        ],
+        [
+            106, 14, 42, 81, 127, 116, 49, 48, 154, 161, 77, 30, 178, 74, 202, 5, 124, 177, 27,
+            169, 164, 70, 166, 152, 138, 194, 203, 198, 134, 203, 255, 40,
+        ],
+        [
+            47, 96, 56, 43, 93, 62, 87, 53, 208, 6, 248, 168, 93, 211, 251, 240, 46, 138, 239, 76,
+            20, 142, 20, 116, 0, 124, 15, 225, 30, 217, 116, 37,
+        ],
+        [
+            231, 205, 171, 128, 77, 59, 170, 67, 8, 186, 39, 75, 19, 129, 239, 181, 145, 141, 177,
+            29, 7, 232, 153, 69, 218, 26, 205, 164, 206, 207, 0, 54,
+        ],
+        [
+            229, 107, 81, 81, 205, 122, 120, 80, 1, 96, 13, 166, 168, 148, 0, 240, 16, 207, 156,
+            84, 125, 0, 207, 196, 242, 124, 208, 133, 52, 32, 182, 9,
+        ],
+        [
+            179, 184, 212, 223, 250, 116, 72, 192, 9, 113, 91, 215, 203, 32, 185, 213, 167, 149,
+            210, 44, 74, 255, 114, 55, 2, 218, 189, 211, 188, 57, 154, 59,
+        ],
+        [
+            162, 165, 77, 233, 58, 220, 93, 70, 103, 253, 243, 4, 206, 70, 34, 10, 214, 54, 189,
+            252, 222, 176, 215, 185, 142, 65, 240, 131, 61, 234, 236, 13,
+        ],
+        [
+            48, 73, 161, 183, 218, 189, 224, 124, 241, 181, 230, 36, 73, 203, 90, 15, 116, 0, 69,
+            237, 156, 181, 231, 180, 84, 197, 234, 181, 190, 199, 255, 52,
+        ],
+    ],
+    [
+        [
+            220, 111, 247, 64, 46, 37, 189, 99, 253, 91, 162, 238, 241, 140, 108, 174, 90, 146,
+            190, 18, 224, 248, 2, 146, 96, 236, 243, 212, 16, 103, 66, 30,
+        ],
+        [
+            31, 37, 121, 78, 67, 203, 24, 7, 252, 180, 126, 16, 235, 113, 134, 22, 212, 79, 77,
+            205, 114, 166, 90, 126, 71, 121, 244, 35, 135, 130, 158, 2,
+        ],
+        [
+            122, 50, 153, 247, 80, 50, 170, 82, 111, 229, 167, 139, 213, 253, 253, 149, 1, 132,
+            230, 42, 168, 20, 94, 119, 109, 143, 55, 222, 234, 138, 53, 52,
+        ],
+        [
+            22, 219, 32, 98, 222, 149, 154, 11, 103, 155, 91, 234, 214, 98, 113, 121, 194, 38, 112,
+            245, 228, 153, 212, 138, 113, 239, 46, 112, 14, 169, 217, 57,
+        ],
+        [
+            218, 47, 129, 55, 195, 205, 29, 175, 252, 108, 76, 237, 220, 134, 47, 151, 189, 218,
+            53, 45, 238, 145, 156, 13, 203, 143, 8, 75, 11, 81, 68, 27,
+        ],
+        [
+            165, 15, 17, 124, 219, 84, 3, 50, 247, 108, 34, 94, 139, 246, 71, 153, 118, 224, 119,
+            186, 40, 94, 45, 102, 25, 209, 86, 62, 6, 174, 151, 53,
+        ],
+        [
+            128, 13, 54, 223, 254, 21, 137, 124, 31, 192, 179, 70, 118, 72, 142, 187, 167, 0, 178,
+            120, 165, 60, 204, 21, 18, 202, 138, 190, 17, 246, 100, 51,
+        ],
+        [
+            148, 186, 124, 117, 46, 54, 68, 248, 71, 170, 136, 117, 249, 134, 99, 43, 192, 98, 121,
+            63, 207, 156, 75, 54, 185, 158, 212, 22, 18, 211, 51, 52,
+        ],
+    ],
+    [
+        [
+            24, 52, 228, 114, 155, 108, 214, 40, 54, 236, 37, 7, 134, 141, 237, 159, 77, 185, 13,
+            39, 195, 44, 58, 34, 229, 109, 3, 4, 68, 221, 190, 1,
+        ],
+        [
+            246, 210, 179, 250, 192, 219, 151, 191, 86, 214, 163, 157, 76, 7, 169, 170, 142, 35,
+            76, 33, 26, 34, 184, 11, 1, 201, 80, 190, 175, 176, 222, 22,
+        ],
+        [
+            45, 230, 47, 218, 24, 154, 184, 70, 125, 235, 25, 236, 196, 31, 216, 134, 216, 186,
+            232, 169, 254, 217, 128, 228, 248, 58, 65, 17, 151, 230, 252, 39,
+        ],
+        [
+            49, 249, 191, 147, 138, 148, 49, 217, 180, 143, 197, 86, 126, 226, 166, 187, 86, 230,
+            21, 120, 10, 5, 224, 33, 168, 69, 24, 177, 196, 212, 19, 56,
+        ],
+        [
+            78, 3, 109, 136, 87, 121, 66, 254, 234, 100, 221, 179, 88, 91, 164, 100, 110, 130, 124,
+            91, 196, 38, 192, 144, 172, 166, 18, 172, 247, 58, 40, 14,
+        ],
+        [
+            214, 225, 119, 224, 102, 139, 164, 249, 12, 11, 182, 68, 37, 36, 143, 165, 110, 236,
+            160, 96, 231, 183, 237, 46, 33, 87, 251, 228, 234, 141, 224, 8,
+        ],
+        [
+            41, 23, 61, 155, 61, 57, 2, 172, 82, 226, 110, 224, 155, 186, 1, 116, 244, 90, 184,
+            218, 91, 241, 142, 128, 196, 137, 32, 56, 165, 182, 15, 35,
+        ],
+        [
+            134, 195, 91, 252, 76, 154, 223, 242, 155, 67, 75, 113, 30, 185, 151, 122, 108, 161,
+            234, 74, 245, 112, 142, 141, 211, 94, 34, 237, 227, 172, 133, 1,
+        ],
+    ],
+    [
+        [
+            167, 255, 57, 210, 245, 166, 106, 113, 15, 165, 122, 64, 80, 166, 212, 184, 73, 180,
+            113, 173, 253, 39, 112, 70, 8, 20, 6, 65, 24, 62, 64, 5,
+        ],
+        [
+            203, 107, 134, 205, 3, 48, 37, 121, 106, 5, 121, 146, 237, 41, 10, 95, 169, 198, 158,
+            124, 91, 231, 131, 169, 13, 208, 34, 9, 160, 185, 35, 62,
+        ],
+        [
+            159, 157, 209, 73, 242, 210, 214, 163, 71, 138, 37, 146, 109, 231, 120, 218, 9, 240,
+            166, 57, 3, 33, 3, 133, 32, 211, 190, 239, 180, 72, 251, 14,
+        ],
+        [
+            235, 185, 248, 188, 219, 240, 28, 178, 142, 217, 194, 95, 153, 114, 200, 233, 230, 77,
+            203, 129, 201, 87, 115, 29, 42, 80, 160, 207, 197, 103, 161, 18,
+        ],
+        [
+            64, 41, 171, 141, 241, 81, 18, 17, 80, 24, 42, 140, 182, 191, 240, 165, 69, 60, 26, 10,
+            218, 36, 147, 62, 195, 1, 37, 201, 79, 111, 117, 48,
+        ],
+        [
+            99, 149, 18, 72, 7, 45, 206, 70, 179, 31, 195, 173, 136, 27, 178, 204, 81, 105, 144,
+            191, 206, 91, 40, 189, 8, 32, 92, 108, 138, 209, 85, 23,
+        ],
+        [
+            122, 133, 113, 198, 75, 111, 114, 28, 82, 109, 46, 198, 163, 186, 185, 113, 163, 16,
+            25, 119, 248, 50, 124, 124, 202, 61, 194, 124, 64, 125, 8, 3,
+        ],
+        [
+            231, 74, 52, 247, 27, 78, 86, 39, 140, 9, 146, 193, 50, 231, 242, 134, 74, 134, 57,
+            174, 105, 148, 90, 9, 117, 29, 5, 224, 77, 120, 94, 43,
+        ],
+    ],
+    [
+        [
+            66, 125, 134, 52, 113, 121, 1, 157, 97, 185, 99, 106, 44, 43, 60, 127, 106, 209, 19,
+            201, 122, 218, 244, 45, 241, 86, 143, 244, 245, 208, 162, 7,
+        ],
+        [
+            18, 80, 241, 94, 225, 206, 164, 202, 189, 9, 154, 17, 214, 79, 229, 176, 191, 112, 95,
+            5, 52, 43, 102, 83, 249, 151, 222, 109, 132, 233, 251, 3,
+        ],
+        [
+            253, 91, 9, 76, 243, 26, 104, 70, 78, 24, 99, 82, 248, 129, 141, 73, 122, 142, 83, 21,
+            218, 240, 118, 200, 240, 184, 227, 38, 137, 46, 190, 3,
+        ],
+        [
+            155, 143, 123, 196, 198, 125, 209, 238, 161, 6, 7, 95, 47, 74, 163, 223, 247, 184, 193,
+            90, 102, 129, 37, 25, 201, 201, 101, 71, 81, 31, 49, 54,
+        ],
+        [
+            229, 127, 64, 113, 252, 102, 170, 69, 29, 131, 215, 235, 16, 35, 215, 100, 234, 250,
+            171, 224, 254, 50, 218, 177, 59, 199, 79, 8, 85, 162, 106, 42,
+        ],
+        [
+            48, 238, 75, 148, 191, 96, 178, 107, 185, 175, 86, 29, 33, 61, 66, 179, 234, 82, 134,
+            19, 254, 213, 129, 75, 188, 155, 24, 164, 137, 200, 190, 41,
+        ],
+        [
+            220, 31, 55, 254, 233, 65, 55, 210, 170, 104, 85, 6, 115, 71, 143, 106, 177, 34, 156,
+            96, 46, 5, 122, 164, 33, 122, 36, 249, 146, 49, 169, 44,
+        ],
+        [
+            222, 65, 234, 61, 23, 51, 29, 154, 52, 159, 192, 26, 238, 127, 189, 106, 219, 161, 17,
+            81, 68, 54, 147, 136, 210, 156, 120, 36, 171, 255, 57, 58,
+        ],
+    ],
+    [
+        [
+            71, 251, 242, 20, 210, 72, 251, 220, 14, 8, 19, 169, 220, 25, 39, 174, 75, 44, 133, 22,
+            105, 236, 21, 103, 212, 100, 5, 34, 121, 79, 162, 0,
+        ],
+        [
+            194, 41, 180, 100, 238, 236, 100, 134, 89, 82, 152, 106, 230, 80, 7, 146, 66, 87, 9,
+            42, 24, 87, 242, 96, 92, 63, 56, 169, 156, 190, 229, 34,
+        ],
+        [
+            141, 254, 94, 59, 138, 160, 119, 154, 211, 60, 56, 145, 249, 153, 182, 182, 220, 6,
+            168, 138, 212, 237, 122, 17, 116, 242, 63, 233, 22, 145, 242, 30,
+        ],
+        [
+            153, 109, 113, 106, 252, 209, 225, 86, 244, 176, 84, 140, 44, 71, 175, 77, 108, 18, 39,
+            175, 183, 234, 142, 163, 210, 63, 38, 103, 232, 88, 223, 17,
+        ],
+        [
+            109, 169, 28, 78, 240, 241, 115, 94, 37, 155, 187, 62, 78, 248, 41, 16, 199, 207, 47,
+            59, 100, 234, 147, 113, 185, 30, 204, 174, 216, 101, 217, 26,
+        ],
+        [
+            199, 76, 237, 233, 188, 41, 236, 124, 20, 78, 61, 129, 251, 10, 106, 218, 166, 189, 16,
+            189, 63, 30, 242, 111, 51, 164, 134, 147, 135, 167, 20, 32,
+        ],
+        [
+            246, 126, 31, 131, 87, 207, 67, 228, 92, 46, 120, 73, 48, 7, 53, 2, 228, 91, 167, 249,
+            224, 145, 38, 140, 49, 110, 9, 198, 28, 166, 199, 23,
+        ],
+        [
+            231, 83, 169, 70, 52, 62, 177, 207, 175, 89, 75, 217, 161, 59, 56, 2, 169, 1, 9, 205,
+            52, 49, 201, 25, 166, 146, 234, 172, 244, 231, 106, 47,
+        ],
+    ],
+    [
+        [
+            194, 228, 232, 201, 33, 16, 85, 164, 105, 160, 141, 18, 249, 59, 102, 48, 193, 116,
+            209, 147, 10, 211, 226, 31, 157, 35, 94, 220, 99, 198, 20, 42,
+        ],
+        [
+            173, 35, 189, 24, 85, 198, 154, 168, 25, 220, 226, 85, 221, 15, 58, 3, 224, 4, 58, 168,
+            58, 29, 56, 245, 186, 223, 226, 181, 18, 185, 172, 40,
+        ],
+        [
+            27, 18, 59, 17, 10, 72, 50, 106, 165, 134, 74, 100, 153, 117, 121, 253, 16, 86, 246,
+            110, 187, 230, 25, 216, 83, 224, 186, 141, 45, 119, 33, 49,
+        ],
+        [
+            244, 45, 103, 199, 97, 180, 35, 18, 240, 147, 30, 233, 41, 208, 61, 151, 65, 157, 96,
+            171, 100, 18, 176, 152, 225, 175, 193, 244, 215, 35, 160, 5,
+        ],
+        [
+            28, 222, 44, 27, 46, 254, 161, 252, 108, 206, 27, 127, 81, 6, 137, 238, 194, 214, 249,
+            85, 148, 234, 179, 183, 90, 25, 164, 214, 151, 128, 32, 50,
+        ],
+        [
+            125, 65, 228, 176, 203, 94, 50, 79, 49, 124, 4, 14, 170, 253, 17, 191, 75, 224, 55, 44,
+            99, 162, 131, 127, 176, 147, 248, 78, 201, 196, 241, 48,
+        ],
+        [
+            117, 21, 105, 66, 55, 43, 28, 99, 109, 184, 3, 147, 39, 208, 145, 27, 14, 225, 196,
+            196, 154, 197, 190, 14, 72, 118, 238, 54, 18, 187, 54, 26,
+        ],
+        [
+            70, 174, 45, 224, 63, 252, 216, 207, 239, 185, 167, 156, 199, 168, 127, 109, 175, 46,
+            99, 100, 169, 75, 223, 35, 161, 102, 242, 103, 16, 8, 209, 55,
+        ],
+    ],
+    [
+        [
+            13, 194, 138, 145, 78, 219, 22, 182, 229, 0, 1, 81, 185, 166, 160, 114, 3, 35, 63, 253,
+            99, 163, 28, 47, 140, 78, 62, 65, 234, 25, 70, 37,
+        ],
+        [
+            61, 96, 17, 118, 88, 237, 59, 158, 157, 55, 155, 76, 10, 185, 215, 169, 151, 212, 195,
+            26, 97, 8, 212, 102, 242, 134, 252, 227, 178, 5, 199, 22,
+        ],
+        [
+            34, 135, 203, 237, 55, 68, 123, 190, 69, 155, 72, 68, 155, 82, 131, 168, 8, 208, 132,
+            197, 218, 130, 132, 104, 97, 217, 13, 156, 76, 112, 181, 16,
+        ],
+        [
+            95, 192, 150, 61, 45, 125, 142, 207, 41, 12, 219, 19, 191, 159, 133, 179, 135, 190,
+            152, 115, 226, 94, 245, 57, 244, 14, 94, 122, 221, 36, 84, 14,
+        ],
+        [
+            60, 90, 132, 102, 233, 42, 52, 168, 255, 226, 18, 254, 36, 107, 88, 73, 146, 120, 103,
+            244, 75, 107, 77, 25, 143, 238, 53, 95, 194, 155, 31, 40,
+        ],
+        [
+            138, 52, 172, 249, 115, 57, 8, 171, 31, 81, 27, 131, 252, 161, 40, 171, 234, 110, 66,
+            119, 79, 189, 7, 252, 119, 55, 152, 241, 39, 80, 8, 4,
+        ],
+        [
+            14, 102, 234, 194, 179, 112, 30, 38, 179, 183, 161, 70, 57, 1, 209, 189, 106, 139, 242,
+            192, 200, 245, 190, 143, 182, 219, 93, 128, 9, 37, 227, 63,
+        ],
+        [
+            122, 219, 120, 166, 254, 238, 26, 106, 128, 225, 64, 176, 209, 13, 159, 175, 107, 206,
+            89, 142, 159, 70, 79, 142, 28, 220, 139, 218, 34, 215, 125, 63,
+        ],
+    ],
+    [
+        [
+            172, 21, 136, 167, 111, 36, 168, 90, 36, 244, 208, 208, 34, 42, 91, 158, 121, 11, 214,
+            17, 150, 220, 169, 137, 174, 234, 191, 231, 228, 166, 244, 39,
+        ],
+        [
+            247, 84, 154, 37, 49, 122, 163, 113, 225, 52, 106, 231, 138, 127, 51, 135, 176, 76,
+            175, 217, 247, 243, 84, 86, 27, 91, 136, 106, 29, 19, 70, 32,
+        ],
+        [
+            183, 140, 119, 40, 234, 18, 150, 188, 245, 145, 29, 134, 108, 239, 3, 75, 85, 135, 174,
+            215, 248, 64, 240, 135, 80, 107, 134, 242, 237, 181, 254, 34,
+        ],
+        [
+            157, 21, 160, 26, 117, 32, 17, 245, 64, 238, 132, 120, 163, 148, 190, 127, 55, 73, 224,
+            219, 166, 32, 236, 26, 161, 153, 206, 37, 218, 158, 115, 50,
+        ],
+        [
+            102, 128, 174, 242, 77, 163, 172, 154, 138, 244, 102, 17, 122, 197, 231, 16, 67, 251,
+            112, 69, 234, 176, 66, 247, 133, 177, 21, 204, 174, 237, 4, 49,
+        ],
+        [
+            239, 96, 167, 25, 10, 118, 236, 57, 32, 103, 160, 19, 209, 187, 230, 224, 85, 134, 110,
+            238, 216, 152, 208, 109, 0, 188, 254, 240, 93, 53, 109, 23,
+        ],
+        [
+            108, 28, 154, 95, 92, 197, 178, 24, 211, 70, 120, 40, 247, 84, 168, 186, 7, 171, 75,
+            120, 151, 200, 22, 59, 21, 170, 251, 131, 56, 235, 175, 30,
+        ],
+        [
+            167, 85, 243, 125, 181, 241, 122, 202, 14, 50, 200, 228, 168, 106, 9, 243, 21, 134,
+            155, 179, 123, 98, 111, 203, 96, 238, 117, 102, 244, 82, 32, 3,
+        ],
+    ],
+    [
+        [
+            81, 194, 89, 56, 62, 155, 254, 27, 234, 67, 235, 139, 206, 253, 178, 220, 111, 228,
+            143, 76, 232, 237, 223, 210, 227, 76, 234, 83, 158, 41, 165, 30,
+        ],
+        [
+            231, 16, 196, 172, 106, 248, 216, 179, 18, 11, 178, 169, 44, 149, 81, 254, 108, 74,
+            207, 135, 95, 26, 32, 80, 180, 103, 196, 109, 126, 18, 241, 26,
+        ],
+        [
+            25, 140, 4, 125, 204, 220, 57, 121, 155, 173, 62, 202, 248, 55, 151, 70, 91, 173, 109,
+            160, 23, 245, 116, 228, 68, 199, 22, 29, 170, 0, 10, 36,
+        ],
+        [
+            170, 226, 29, 101, 137, 91, 118, 169, 27, 250, 42, 0, 135, 49, 146, 159, 97, 105, 241,
+            55, 67, 34, 72, 162, 122, 167, 18, 120, 202, 9, 82, 39,
+        ],
+        [
+            130, 23, 40, 251, 34, 205, 36, 24, 34, 193, 84, 226, 32, 35, 205, 182, 98, 64, 218, 99,
+            223, 29, 193, 200, 187, 51, 94, 127, 85, 136, 106, 63,
+        ],
+        [
+            20, 174, 125, 99, 207, 8, 50, 43, 203, 1, 165, 193, 43, 225, 16, 254, 207, 164, 119,
+            162, 140, 94, 66, 208, 113, 7, 89, 200, 55, 53, 169, 24,
+        ],
+        [
+            114, 146, 145, 183, 20, 171, 214, 161, 11, 200, 195, 62, 124, 57, 225, 210, 37, 202,
+            108, 255, 246, 167, 197, 3, 205, 66, 206, 131, 22, 60, 71, 51,
+        ],
+        [
+            96, 247, 39, 97, 175, 212, 113, 61, 218, 136, 61, 57, 34, 15, 242, 54, 133, 211, 151,
+            28, 183, 159, 134, 188, 192, 104, 174, 54, 236, 231, 26, 5,
+        ],
+    ],
+    [
+        [
+            159, 212, 195, 141, 31, 242, 46, 244, 34, 181, 77, 152, 114, 59, 111, 27, 127, 224,
+            253, 146, 51, 221, 241, 189, 211, 26, 127, 150, 115, 126, 255, 8,
+        ],
+        [
+            166, 51, 28, 89, 18, 65, 151, 110, 54, 47, 186, 87, 146, 233, 13, 36, 99, 46, 194, 38,
+            248, 235, 17, 179, 225, 64, 174, 192, 149, 76, 193, 57,
+        ],
+        [
+            124, 227, 148, 2, 195, 251, 0, 91, 99, 91, 4, 61, 36, 61, 60, 185, 160, 8, 216, 162,
+            255, 163, 156, 212, 189, 234, 160, 131, 80, 233, 69, 31,
+        ],
+        [
+            228, 5, 75, 168, 81, 179, 20, 142, 53, 62, 19, 152, 211, 120, 178, 172, 214, 30, 69,
+            85, 124, 165, 73, 139, 93, 24, 36, 46, 199, 96, 40, 30,
+        ],
+        [
+            252, 20, 32, 26, 246, 30, 192, 50, 136, 144, 68, 182, 232, 174, 73, 4, 252, 168, 180,
+            46, 189, 66, 59, 7, 189, 2, 72, 92, 118, 220, 240, 43,
+        ],
+        [
+            61, 140, 148, 113, 74, 83, 138, 136, 151, 151, 156, 219, 38, 244, 28, 186, 62, 172, 40,
+            239, 14, 13, 100, 187, 136, 215, 226, 156, 167, 53, 46, 22,
+        ],
+        [
+            137, 240, 137, 254, 218, 224, 225, 48, 30, 129, 224, 75, 203, 160, 113, 2, 238, 6, 205,
+            79, 230, 109, 24, 44, 5, 147, 43, 123, 120, 33, 176, 16,
+        ],
+        [
+            252, 48, 156, 11, 223, 23, 120, 45, 236, 97, 109, 212, 138, 155, 248, 142, 17, 14, 185,
+            199, 52, 218, 56, 244, 239, 186, 59, 155, 82, 48, 200, 39,
+        ],
+    ],
+    [
+        [
+            5, 220, 5, 128, 148, 124, 206, 148, 180, 145, 11, 158, 188, 112, 206, 237, 160, 123,
+            218, 124, 1, 54, 164, 128, 18, 95, 83, 183, 248, 29, 228, 12,
+        ],
+        [
+            214, 168, 154, 183, 172, 78, 16, 52, 50, 33, 14, 96, 238, 44, 248, 23, 157, 35, 215,
+            83, 221, 57, 161, 29, 193, 11, 161, 179, 229, 48, 198, 21,
+        ],
+        [
+            133, 164, 224, 39, 107, 6, 45, 223, 31, 74, 95, 252, 109, 219, 126, 219, 154, 63, 190,
+            71, 193, 16, 23, 146, 1, 24, 128, 52, 193, 130, 160, 23,
+        ],
+        [
+            121, 231, 94, 211, 129, 23, 194, 169, 190, 169, 243, 221, 172, 104, 207, 254, 157, 174,
+            139, 227, 208, 20, 188, 82, 82, 190, 139, 190, 72, 23, 205, 20,
+        ],
+        [
+            91, 172, 54, 154, 40, 43, 90, 99, 254, 241, 239, 151, 148, 167, 189, 194, 248, 200, 56,
+            103, 126, 85, 184, 208, 17, 168, 236, 248, 153, 208, 179, 31,
+        ],
+        [
+            205, 123, 215, 56, 96, 17, 215, 28, 168, 216, 148, 55, 15, 133, 60, 195, 164, 134, 17,
+            234, 32, 36, 207, 201, 14, 112, 211, 78, 203, 7, 230, 52,
+        ],
+        [
+            93, 248, 248, 21, 87, 109, 35, 58, 212, 50, 248, 161, 115, 63, 189, 191, 135, 115, 223,
+            208, 78, 213, 39, 118, 91, 211, 131, 192, 33, 234, 149, 37,
+        ],
+        [
+            35, 215, 54, 145, 79, 225, 122, 226, 127, 245, 11, 190, 251, 200, 1, 47, 80, 179, 224,
+            211, 121, 180, 217, 47, 108, 41, 65, 53, 77, 93, 205, 47,
+        ],
+    ],
+    [
+        [
+            121, 229, 227, 180, 214, 66, 64, 75, 82, 108, 25, 2, 216, 161, 23, 42, 45, 75, 106,
+            187, 162, 63, 32, 6, 45, 189, 38, 184, 218, 18, 6, 43,
+        ],
+        [
+            65, 81, 179, 34, 92, 125, 223, 47, 254, 226, 115, 185, 128, 172, 68, 24, 9, 184, 57,
+            129, 234, 174, 232, 12, 171, 145, 73, 72, 18, 195, 42, 11,
+        ],
+        [
+            14, 28, 16, 216, 210, 137, 236, 100, 226, 55, 225, 147, 154, 252, 211, 181, 106, 243,
+            161, 79, 247, 183, 91, 55, 111, 18, 181, 172, 154, 5, 151, 53,
+        ],
+        [
+            59, 222, 201, 101, 150, 48, 2, 24, 246, 2, 107, 177, 44, 141, 54, 27, 244, 1, 91, 52,
+            200, 187, 171, 156, 135, 208, 249, 222, 154, 42, 16, 33,
+        ],
+        [
+            104, 150, 234, 215, 26, 74, 45, 216, 243, 25, 122, 153, 44, 247, 128, 15, 164, 80, 95,
+            105, 74, 164, 174, 150, 221, 180, 164, 117, 94, 121, 184, 21,
+        ],
+        [
+            244, 3, 63, 14, 247, 139, 139, 24, 56, 152, 122, 211, 220, 149, 32, 72, 173, 50, 233,
+            95, 192, 61, 115, 222, 6, 198, 23, 145, 220, 92, 168, 14,
+        ],
+        [
+            123, 105, 48, 25, 179, 136, 51, 189, 62, 161, 38, 50, 41, 89, 206, 31, 92, 164, 227,
+            29, 69, 233, 226, 53, 29, 17, 61, 221, 213, 199, 213, 36,
+        ],
+        [
+            10, 180, 201, 130, 164, 6, 35, 113, 109, 164, 34, 227, 3, 202, 86, 70, 95, 236, 68, 10,
+            198, 16, 204, 49, 49, 232, 145, 2, 205, 237, 135, 33,
+        ],
+    ],
+    [
+        [
+            164, 61, 189, 226, 93, 173, 150, 18, 110, 21, 99, 125, 250, 45, 117, 50, 250, 157, 212,
+            9, 169, 14, 232, 53, 168, 110, 221, 253, 98, 44, 184, 55,
+        ],
+        [
+            10, 200, 231, 57, 40, 195, 109, 223, 230, 107, 35, 167, 70, 250, 255, 175, 106, 241,
+            35, 163, 24, 65, 178, 218, 181, 40, 201, 150, 29, 181, 120, 1,
+        ],
+        [
+            23, 147, 76, 178, 80, 155, 42, 165, 82, 142, 164, 81, 100, 180, 173, 9, 26, 9, 233, 6,
+            67, 3, 203, 70, 213, 195, 1, 93, 123, 169, 4, 12,
+        ],
+        [
+            15, 24, 204, 61, 20, 190, 93, 198, 16, 129, 215, 142, 41, 33, 219, 224, 34, 154, 94,
+            234, 109, 21, 251, 232, 198, 62, 4, 235, 236, 16, 3, 45,
+        ],
+        [
+            143, 177, 225, 157, 173, 54, 188, 123, 41, 91, 240, 220, 223, 81, 70, 194, 27, 147,
+            141, 230, 175, 43, 25, 222, 7, 143, 81, 185, 252, 252, 13, 63,
+        ],
+        [
+            2, 130, 165, 36, 212, 154, 222, 127, 66, 123, 167, 90, 242, 142, 84, 162, 154, 244, 10,
+            228, 7, 110, 213, 182, 236, 30, 202, 0, 248, 20, 219, 31,
+        ],
+        [
+            91, 141, 198, 216, 211, 179, 193, 160, 134, 90, 212, 128, 85, 185, 8, 213, 156, 178,
+            84, 94, 33, 60, 104, 15, 76, 132, 101, 139, 16, 202, 39, 7,
+        ],
+        [
+            40, 21, 104, 114, 55, 102, 78, 10, 8, 169, 121, 156, 143, 255, 176, 144, 216, 134, 19,
+            27, 70, 151, 163, 149, 21, 220, 239, 65, 109, 137, 163, 36,
+        ],
+    ],
+    [
+        [
+            177, 102, 25, 89, 51, 205, 218, 46, 239, 16, 165, 74, 131, 94, 82, 248, 57, 135, 156,
+            160, 63, 57, 210, 21, 30, 42, 243, 39, 215, 37, 128, 28,
+        ],
+        [
+            105, 52, 188, 198, 150, 99, 113, 232, 68, 219, 243, 180, 210, 216, 187, 179, 27, 118,
+            63, 211, 239, 147, 39, 75, 243, 209, 136, 247, 151, 84, 146, 32,
+        ],
+        [
+            114, 57, 148, 130, 175, 207, 73, 255, 149, 172, 194, 92, 217, 117, 177, 223, 52, 37,
+            51, 57, 169, 149, 212, 248, 73, 221, 164, 0, 186, 245, 112, 23,
+        ],
+        [
+            57, 72, 243, 117, 146, 120, 9, 114, 211, 234, 216, 19, 43, 149, 3, 198, 27, 4, 239, 93,
+            46, 75, 219, 149, 112, 40, 54, 28, 48, 234, 66, 57,
+        ],
+        [
+            67, 161, 31, 89, 164, 242, 224, 205, 207, 9, 154, 77, 198, 216, 166, 150, 167, 168, 60,
+            83, 229, 54, 120, 248, 82, 105, 61, 130, 142, 46, 193, 18,
+        ],
+        [
+            45, 128, 84, 140, 202, 147, 79, 95, 51, 250, 148, 114, 188, 145, 61, 29, 62, 132, 115,
+            244, 102, 11, 0, 96, 85, 30, 86, 136, 195, 144, 247, 18,
+        ],
+        [
+            7, 154, 159, 131, 116, 203, 12, 167, 60, 97, 53, 6, 77, 133, 249, 117, 25, 204, 243,
+            118, 175, 154, 233, 70, 243, 130, 27, 127, 179, 205, 253, 15,
+        ],
+        [
+            106, 108, 100, 123, 231, 100, 59, 207, 108, 100, 34, 155, 222, 229, 31, 255, 98, 181,
+            171, 122, 9, 114, 3, 101, 255, 72, 161, 61, 8, 219, 123, 27,
+        ],
+    ],
+    [
+        [
+            138, 91, 16, 195, 19, 101, 70, 243, 47, 48, 96, 34, 191, 184, 150, 226, 190, 100, 88,
+            119, 234, 152, 160, 152, 104, 219, 29, 239, 19, 148, 9, 38,
+        ],
+        [
+            246, 211, 73, 28, 125, 13, 63, 122, 5, 88, 167, 151, 179, 186, 84, 13, 111, 163, 102,
+            113, 126, 241, 32, 50, 224, 13, 146, 15, 230, 150, 11, 52,
+        ],
+        [
+            154, 150, 57, 187, 127, 246, 180, 239, 190, 165, 103, 233, 89, 183, 5, 175, 150, 93,
+            87, 51, 167, 126, 178, 169, 66, 28, 9, 161, 218, 239, 123, 25,
+        ],
+        [
+            185, 229, 244, 166, 244, 110, 77, 101, 167, 108, 163, 229, 108, 174, 226, 103, 89, 36,
+            200, 164, 214, 148, 49, 212, 242, 197, 121, 167, 97, 157, 74, 17,
+        ],
+        [
+            52, 58, 191, 122, 149, 177, 220, 26, 97, 103, 175, 44, 100, 111, 151, 136, 79, 54, 93,
+            185, 65, 182, 102, 131, 165, 82, 46, 91, 114, 18, 91, 6,
+        ],
+        [
+            107, 19, 80, 165, 166, 216, 121, 157, 215, 92, 135, 201, 246, 234, 30, 122, 36, 27,
+            203, 88, 216, 113, 237, 199, 111, 120, 35, 119, 8, 205, 32, 46,
+        ],
+        [
+            20, 119, 36, 113, 135, 162, 9, 149, 247, 211, 154, 128, 212, 137, 68, 212, 28, 87, 145,
+            233, 53, 162, 167, 72, 114, 252, 255, 10, 110, 30, 117, 41,
+        ],
+        [
+            69, 67, 187, 172, 32, 58, 82, 131, 180, 241, 128, 245, 245, 178, 215, 244, 40, 37, 49,
+            66, 218, 99, 232, 17, 201, 214, 84, 241, 29, 215, 217, 16,
+        ],
+    ],
+    [
+        [
+            8, 217, 27, 9, 205, 139, 87, 170, 175, 101, 13, 65, 42, 153, 124, 195, 221, 110, 147,
+            106, 107, 50, 112, 113, 79, 85, 128, 96, 221, 122, 88, 37,
+        ],
+        [
+            62, 174, 26, 84, 3, 154, 76, 218, 161, 234, 202, 236, 43, 222, 190, 214, 40, 177, 81,
+            209, 138, 91, 117, 25, 45, 250, 233, 13, 223, 81, 61, 34,
+        ],
+        [
+            112, 4, 242, 252, 45, 111, 178, 214, 78, 207, 68, 208, 81, 104, 157, 45, 160, 124, 213,
+            193, 38, 80, 58, 205, 140, 9, 107, 41, 196, 141, 223, 40,
+        ],
+        [
+            54, 79, 54, 153, 234, 76, 173, 78, 107, 19, 23, 164, 223, 21, 74, 147, 230, 20, 103,
+            113, 131, 60, 33, 233, 200, 146, 23, 144, 189, 71, 94, 24,
+        ],
+        [
+            113, 192, 128, 244, 20, 55, 236, 149, 20, 196, 221, 99, 71, 23, 208, 187, 92, 158, 5,
+            73, 239, 163, 254, 39, 142, 161, 51, 180, 159, 209, 209, 12,
+        ],
+        [
+            204, 251, 47, 230, 61, 123, 221, 149, 69, 100, 194, 77, 56, 250, 81, 132, 163, 128,
+            181, 208, 116, 94, 151, 79, 31, 139, 66, 154, 91, 182, 52, 28,
+        ],
+        [
+            83, 105, 243, 244, 101, 204, 108, 161, 15, 204, 51, 165, 200, 209, 129, 177, 30, 110,
+            84, 4, 65, 203, 125, 221, 234, 8, 100, 183, 47, 52, 49, 25,
+        ],
+        [
+            201, 43, 72, 102, 184, 137, 0, 15, 252, 35, 236, 135, 16, 241, 233, 164, 218, 184, 188,
+            92, 174, 121, 33, 207, 166, 154, 39, 203, 16, 89, 89, 46,
+        ],
+    ],
+];
+
+pub fn generator() -> pallas::Affine {
+    pallas::Affine::from_xy(
+        pallas::Base::from_bytes(&GENERATOR.0).unwrap(),
+        pallas::Base::from_bytes(&GENERATOR.1).unwrap(),
+    )
+    .unwrap()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::super::{
+        test_lagrange_coeffs, test_zs_and_us, NUM_WINDOWS, VALUE_COMMITMENT_PERSONALIZATION,
+    };
+    use super::*;
+    use group::Curve;
+    use pasta_curves::{
+        arithmetic::{CurveAffine, CurveExt, FieldExt},
+        pallas,
+    };
+
+    #[test]
+    fn generator() {
+        let hasher = pallas::Point::hash_to_curve(VALUE_COMMITMENT_PERSONALIZATION);
+        let point = hasher(b"r");
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(*coords.x(), pallas::Base::from_bytes(&GENERATOR.0).unwrap());
+        assert_eq!(*coords.y(), pallas::Base::from_bytes(&GENERATOR.1).unwrap());
+    }
+
+    #[test]
+    fn lagrange_coeffs() {
+        let base = super::generator();
+        test_lagrange_coeffs(base, NUM_WINDOWS);
+    }
+
+    #[test]
+    fn z() {
+        let base = super::generator();
+        test_zs_and_us(base, &Z, &U, NUM_WINDOWS);
+    }
+}

+ 818 - 0
src/crypto/constants/fixed_bases/value_commit_v.rs

@@ -0,0 +1,818 @@
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    pallas,
+};
+
+/// The value commitment is used to check balance between inputs and outputs. The value is
+/// placed over this generator.
+pub const GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        103, 67, 249, 58, 110, 189, 167, 42, 140, 124, 90, 43, 127, 163, 4, 254, 50, 178, 155, 79,
+        112, 106, 168, 247, 66, 15, 61, 142, 122, 89, 112, 47,
+    ],
+    [
+        142, 242, 90, 175, 126, 196, 19, 164, 219, 227, 255, 167, 102, 167, 158, 29, 66, 108, 109,
+        19, 99, 127, 145, 30, 175, 25, 25, 49, 105, 81, 14, 45,
+    ],
+);
+
+/// Short signed z-values for GENERATOR
+pub const Z_SHORT: [u64; super::NUM_WINDOWS_SHORT] = [
+    163547, 76040, 88852, 128479, 54088, 89871, 39598, 144309, 43471, 102492, 741, 55288, 33756,
+    77312, 12095, 48253, 45718, 202901, 33132, 71081, 152108, 169712,
+];
+
+/// Short signed u-values for GENERATOR
+pub const U_SHORT: [[[u8; 32]; super::H]; super::NUM_WINDOWS_SHORT] = [
+    [
+        [
+            16, 88, 158, 52, 92, 165, 59, 177, 224, 70, 108, 93, 144, 51, 8, 133, 114, 192, 151,
+            40, 85, 33, 52, 118, 147, 163, 220, 193, 171, 43, 73, 27,
+        ],
+        [
+            201, 84, 190, 165, 219, 228, 63, 155, 182, 74, 179, 74, 230, 96, 89, 168, 110, 162, 83,
+            218, 185, 137, 194, 92, 244, 85, 1, 60, 59, 16, 119, 14,
+        ],
+        [
+            113, 146, 25, 32, 206, 37, 173, 225, 58, 41, 184, 214, 177, 123, 211, 55, 42, 208, 214,
+            45, 149, 99, 31, 171, 172, 226, 219, 171, 246, 85, 116, 59,
+        ],
+        [
+            10, 79, 89, 241, 37, 161, 115, 213, 183, 43, 68, 233, 219, 249, 131, 137, 41, 119, 153,
+            24, 92, 87, 138, 167, 93, 46, 32, 97, 102, 164, 164, 53,
+        ],
+        [
+            50, 252, 2, 254, 234, 133, 190, 34, 244, 192, 31, 96, 156, 152, 150, 88, 154, 224, 223,
+            144, 223, 113, 203, 226, 214, 44, 69, 198, 171, 60, 26, 45,
+        ],
+        [
+            151, 65, 173, 0, 249, 13, 78, 201, 84, 58, 255, 120, 124, 169, 98, 242, 239, 132, 149,
+            204, 146, 244, 55, 176, 56, 26, 19, 148, 125, 42, 26, 32,
+        ],
+        [
+            6, 29, 196, 176, 135, 157, 248, 239, 196, 9, 100, 82, 220, 41, 203, 49, 35, 108, 76,
+            59, 222, 47, 82, 39, 35, 23, 88, 136, 61, 90, 23, 57,
+        ],
+        [
+            169, 203, 101, 116, 220, 68, 34, 248, 199, 107, 202, 59, 111, 171, 90, 121, 119, 80,
+            146, 214, 191, 197, 220, 212, 125, 139, 12, 140, 198, 191, 110, 31,
+        ],
+    ],
+    [
+        [
+            16, 171, 139, 236, 248, 28, 27, 145, 109, 161, 63, 121, 19, 190, 106, 193, 13, 122,
+            108, 54, 95, 202, 195, 184, 118, 60, 72, 213, 154, 240, 52, 34,
+        ],
+        [
+            131, 218, 16, 142, 97, 153, 190, 249, 118, 171, 187, 254, 21, 17, 202, 48, 107, 23,
+            103, 72, 159, 238, 228, 38, 183, 166, 74, 136, 77, 51, 85, 18,
+        ],
+        [
+            137, 78, 204, 243, 154, 87, 148, 200, 11, 98, 58, 33, 89, 170, 198, 87, 29, 187, 167,
+            122, 157, 151, 5, 148, 254, 216, 113, 12, 158, 243, 102, 63,
+        ],
+        [
+            16, 187, 216, 98, 244, 19, 70, 209, 217, 133, 240, 226, 111, 219, 247, 74, 4, 231, 183,
+            216, 35, 174, 192, 96, 129, 159, 39, 96, 200, 174, 126, 1,
+        ],
+        [
+            185, 2, 174, 129, 110, 163, 212, 152, 214, 139, 105, 150, 23, 209, 185, 245, 71, 8,
+            171, 142, 43, 57, 167, 172, 233, 77, 194, 166, 118, 232, 127, 35,
+        ],
+        [
+            57, 28, 236, 33, 234, 0, 214, 131, 161, 209, 42, 25, 194, 150, 82, 126, 216, 23, 81,
+            85, 90, 47, 95, 46, 119, 108, 253, 12, 92, 29, 13, 25,
+        ],
+        [
+            100, 162, 156, 175, 254, 203, 69, 171, 182, 190, 85, 161, 94, 117, 225, 0, 95, 121,
+            190, 235, 79, 7, 147, 134, 48, 156, 113, 55, 114, 229, 174, 25,
+        ],
+        [
+            243, 93, 223, 98, 132, 0, 171, 125, 135, 53, 111, 49, 49, 173, 69, 211, 62, 106, 168,
+            221, 115, 208, 2, 20, 14, 150, 124, 130, 189, 48, 16, 15,
+        ],
+    ],
+    [
+        [
+            43, 238, 4, 240, 186, 135, 47, 128, 185, 51, 70, 196, 3, 137, 22, 254, 29, 247, 161,
+            233, 187, 255, 239, 183, 150, 179, 8, 64, 90, 33, 17, 54,
+        ],
+        [
+            20, 226, 19, 60, 92, 195, 1, 255, 100, 188, 89, 54, 98, 225, 138, 133, 26, 140, 202,
+            76, 107, 199, 46, 54, 167, 23, 119, 80, 19, 25, 34, 5,
+        ],
+        [
+            145, 109, 10, 159, 200, 145, 32, 253, 32, 93, 187, 12, 66, 161, 44, 217, 16, 100, 225,
+            37, 139, 125, 169, 119, 83, 34, 96, 130, 234, 255, 138, 38,
+        ],
+        [
+            148, 127, 71, 227, 195, 244, 12, 49, 83, 78, 218, 9, 176, 158, 12, 5, 194, 54, 44, 157,
+            252, 228, 175, 170, 54, 91, 49, 254, 83, 228, 180, 61,
+        ],
+        [
+            36, 96, 238, 61, 227, 144, 153, 81, 121, 197, 74, 190, 35, 216, 255, 92, 70, 7, 168,
+            219, 130, 255, 172, 71, 200, 31, 142, 232, 255, 117, 96, 15,
+        ],
+        [
+            50, 152, 255, 238, 188, 127, 140, 240, 203, 33, 246, 193, 228, 179, 25, 1, 227, 194,
+            79, 70, 41, 160, 83, 243, 148, 1, 95, 86, 63, 22, 55, 40,
+        ],
+        [
+            99, 228, 147, 46, 232, 157, 225, 210, 45, 159, 169, 42, 184, 90, 3, 165, 62, 4, 93,
+            181, 74, 187, 112, 156, 26, 103, 199, 84, 132, 148, 14, 24,
+        ],
+        [
+            120, 163, 182, 125, 197, 141, 122, 21, 166, 103, 203, 57, 160, 228, 242, 192, 203, 40,
+            233, 179, 8, 173, 199, 21, 213, 215, 222, 129, 23, 153, 25, 29,
+        ],
+    ],
+    [
+        [
+            189, 6, 27, 46, 68, 6, 124, 69, 159, 212, 18, 104, 218, 16, 66, 183, 250, 92, 69, 5,
+            218, 234, 31, 198, 123, 100, 216, 103, 106, 113, 192, 43,
+        ],
+        [
+            226, 152, 83, 159, 143, 155, 164, 90, 171, 100, 22, 240, 187, 26, 55, 172, 170, 133,
+            128, 192, 29, 33, 35, 8, 59, 142, 20, 204, 151, 172, 29, 28,
+        ],
+        [
+            196, 57, 232, 112, 46, 200, 26, 93, 224, 191, 117, 154, 9, 47, 228, 145, 122, 137, 238,
+            236, 70, 14, 112, 163, 96, 140, 239, 122, 75, 200, 206, 12,
+        ],
+        [
+            91, 66, 65, 159, 86, 50, 113, 39, 30, 12, 213, 235, 15, 70, 163, 119, 112, 27, 22, 170,
+            151, 20, 71, 172, 65, 251, 224, 76, 26, 189, 118, 42,
+        ],
+        [
+            195, 200, 87, 207, 125, 122, 254, 50, 24, 40, 189, 169, 237, 228, 134, 66, 37, 220, 23,
+            98, 202, 193, 152, 184, 171, 63, 105, 11, 70, 94, 154, 58,
+        ],
+        [
+            4, 0, 82, 125, 41, 130, 11, 238, 112, 201, 95, 30, 144, 31, 31, 233, 86, 121, 145, 200,
+            204, 89, 182, 51, 151, 169, 58, 206, 184, 219, 181, 46,
+        ],
+        [
+            36, 240, 60, 205, 120, 239, 9, 98, 61, 228, 247, 9, 145, 71, 67, 10, 164, 160, 186,
+            104, 25, 225, 210, 37, 31, 42, 58, 208, 44, 19, 30, 29,
+        ],
+        [
+            163, 214, 140, 64, 48, 239, 54, 175, 108, 32, 187, 248, 142, 77, 244, 117, 10, 236, 39,
+            80, 158, 44, 98, 44, 248, 24, 208, 60, 173, 247, 115, 28,
+        ],
+    ],
+    [
+        [
+            230, 166, 7, 118, 178, 55, 26, 250, 91, 159, 230, 158, 34, 135, 91, 49, 166, 244, 124,
+            175, 86, 228, 159, 119, 231, 15, 19, 199, 219, 85, 233, 19,
+        ],
+        [
+            65, 240, 77, 9, 197, 255, 96, 35, 239, 161, 177, 115, 83, 114, 180, 179, 118, 158, 220,
+            61, 177, 3, 175, 70, 132, 51, 87, 79, 36, 104, 129, 15,
+        ],
+        [
+            245, 9, 141, 218, 228, 57, 204, 250, 83, 156, 160, 158, 146, 157, 206, 198, 16, 94, 80,
+            59, 31, 242, 163, 30, 80, 99, 32, 142, 193, 101, 172, 22,
+        ],
+        [
+            22, 68, 73, 27, 236, 149, 225, 78, 69, 83, 174, 202, 98, 113, 148, 167, 43, 132, 118,
+            49, 153, 96, 186, 134, 20, 103, 123, 48, 75, 104, 207, 6,
+        ],
+        [
+            186, 5, 66, 183, 166, 255, 222, 14, 34, 0, 105, 167, 36, 11, 210, 228, 91, 103, 65,
+            248, 3, 48, 117, 240, 180, 214, 201, 222, 5, 202, 103, 42,
+        ],
+        [
+            231, 31, 19, 122, 240, 72, 34, 93, 204, 125, 90, 215, 124, 174, 124, 28, 145, 103, 126,
+            178, 1, 9, 152, 240, 251, 118, 14, 195, 197, 167, 136, 22,
+        ],
+        [
+            121, 57, 39, 104, 26, 135, 98, 221, 85, 199, 94, 230, 223, 129, 28, 191, 185, 0, 46,
+            200, 72, 116, 202, 255, 80, 180, 13, 98, 229, 217, 238, 17,
+        ],
+        [
+            228, 158, 59, 241, 50, 224, 177, 78, 8, 121, 211, 157, 95, 196, 88, 59, 85, 141, 134,
+            50, 123, 168, 175, 115, 240, 153, 223, 61, 71, 229, 77, 10,
+        ],
+    ],
+    [
+        [
+            196, 151, 212, 168, 230, 19, 214, 179, 118, 17, 196, 50, 76, 231, 114, 80, 178, 137,
+            232, 241, 60, 2, 0, 124, 25, 239, 98, 131, 220, 159, 221, 51,
+        ],
+        [
+            207, 216, 50, 53, 106, 200, 85, 166, 137, 33, 29, 239, 97, 46, 104, 218, 177, 150, 178,
+            64, 232, 238, 208, 98, 103, 58, 233, 97, 1, 243, 73, 5,
+        ],
+        [
+            174, 215, 22, 124, 193, 136, 79, 91, 111, 146, 51, 128, 249, 129, 203, 168, 157, 164,
+            252, 144, 206, 10, 63, 253, 250, 113, 251, 65, 218, 23, 12, 25,
+        ],
+        [
+            186, 92, 109, 134, 176, 198, 214, 156, 148, 7, 106, 121, 226, 70, 250, 192, 180, 164,
+            16, 29, 245, 196, 155, 183, 214, 26, 3, 26, 249, 134, 153, 38,
+        ],
+        [
+            244, 56, 170, 227, 236, 145, 153, 150, 166, 77, 201, 48, 100, 130, 204, 194, 108, 207,
+            3, 243, 227, 41, 45, 8, 136, 106, 58, 70, 126, 3, 132, 59,
+        ],
+        [
+            215, 169, 24, 118, 5, 192, 171, 217, 47, 86, 212, 249, 228, 92, 248, 103, 242, 222, 17,
+            206, 36, 157, 126, 224, 105, 113, 239, 102, 54, 25, 151, 14,
+        ],
+        [
+            129, 213, 202, 163, 74, 201, 249, 43, 200, 62, 4, 232, 68, 211, 44, 153, 25, 71, 155,
+            5, 93, 19, 117, 195, 201, 179, 158, 207, 252, 213, 166, 62,
+        ],
+        [
+            86, 75, 236, 222, 217, 118, 49, 0, 141, 130, 201, 248, 34, 225, 69, 91, 186, 90, 246,
+            36, 141, 152, 166, 216, 118, 7, 38, 133, 147, 190, 79, 3,
+        ],
+    ],
+    [
+        [
+            226, 55, 121, 73, 104, 77, 129, 202, 168, 123, 192, 163, 28, 9, 195, 37, 116, 207, 125,
+            198, 203, 244, 121, 236, 232, 91, 168, 14, 142, 241, 250, 60,
+        ],
+        [
+            222, 86, 183, 37, 132, 107, 210, 125, 127, 46, 94, 81, 18, 91, 72, 160, 16, 193, 239,
+            114, 238, 186, 186, 203, 96, 169, 87, 155, 108, 36, 97, 6,
+        ],
+        [
+            110, 110, 99, 98, 167, 78, 75, 128, 33, 138, 18, 19, 194, 192, 219, 184, 74, 196, 82,
+            115, 241, 102, 30, 197, 199, 194, 154, 120, 49, 10, 95, 37,
+        ],
+        [
+            212, 206, 154, 98, 20, 33, 185, 182, 138, 207, 65, 197, 246, 19, 132, 52, 173, 186, 42,
+            243, 88, 20, 51, 11, 206, 25, 216, 48, 162, 138, 124, 13,
+        ],
+        [
+            32, 161, 64, 72, 1, 32, 243, 175, 251, 37, 86, 248, 136, 187, 181, 55, 39, 255, 98,
+            228, 189, 235, 194, 2, 228, 39, 92, 104, 245, 17, 117, 7,
+        ],
+        [
+            207, 205, 116, 251, 54, 21, 8, 82, 173, 45, 205, 38, 245, 155, 16, 56, 198, 232, 173,
+            88, 97, 22, 234, 26, 139, 206, 108, 254, 123, 87, 181, 26,
+        ],
+        [
+            38, 147, 223, 169, 68, 76, 49, 169, 137, 141, 72, 63, 166, 88, 34, 220, 163, 91, 167,
+            251, 29, 160, 254, 199, 205, 74, 158, 105, 252, 182, 158, 21,
+        ],
+        [
+            221, 44, 183, 72, 226, 191, 226, 165, 162, 153, 186, 190, 97, 53, 19, 115, 215, 71,
+            155, 33, 79, 120, 197, 228, 216, 212, 249, 15, 179, 11, 216, 32,
+        ],
+    ],
+    [
+        [
+            248, 136, 25, 30, 234, 18, 242, 209, 97, 211, 74, 228, 236, 199, 101, 200, 206, 52,
+            146, 207, 72, 125, 28, 3, 60, 86, 34, 195, 250, 251, 204, 0,
+        ],
+        [
+            204, 182, 197, 171, 247, 159, 161, 27, 18, 146, 249, 99, 198, 138, 25, 61, 119, 232,
+            160, 152, 18, 149, 7, 67, 125, 231, 237, 3, 68, 190, 137, 0,
+        ],
+        [
+            141, 245, 108, 181, 49, 171, 106, 247, 202, 169, 106, 39, 93, 40, 122, 2, 236, 255,
+            198, 215, 122, 254, 242, 192, 49, 250, 243, 35, 7, 219, 21, 22,
+        ],
+        [
+            239, 85, 174, 15, 207, 84, 128, 92, 87, 80, 129, 20, 21, 225, 233, 158, 193, 136, 141,
+            114, 66, 146, 29, 193, 223, 250, 27, 56, 195, 15, 135, 17,
+        ],
+        [
+            231, 242, 76, 43, 57, 10, 41, 166, 32, 254, 129, 47, 147, 118, 189, 200, 44, 102, 204,
+            116, 96, 82, 186, 150, 106, 27, 30, 73, 237, 94, 36, 44,
+        ],
+        [
+            240, 139, 69, 197, 199, 228, 206, 96, 255, 229, 189, 207, 65, 97, 93, 211, 161, 190,
+            228, 249, 50, 82, 223, 251, 13, 173, 241, 221, 78, 243, 105, 19,
+        ],
+        [
+            44, 224, 170, 161, 50, 93, 212, 80, 100, 243, 51, 74, 51, 165, 60, 208, 244, 18, 158,
+            30, 158, 81, 111, 213, 136, 95, 125, 173, 143, 108, 106, 4,
+        ],
+        [
+            134, 244, 131, 92, 152, 118, 30, 139, 153, 128, 62, 115, 88, 25, 58, 29, 205, 101, 47,
+            208, 93, 89, 222, 17, 122, 112, 71, 56, 147, 68, 92, 22,
+        ],
+    ],
+    [
+        [
+            59, 157, 112, 130, 217, 2, 102, 228, 79, 211, 152, 82, 183, 186, 47, 151, 125, 13, 97,
+            121, 115, 253, 17, 121, 227, 250, 99, 14, 84, 249, 18, 30,
+        ],
+        [
+            80, 180, 155, 59, 6, 182, 136, 39, 134, 168, 238, 138, 129, 174, 195, 206, 210, 167,
+            214, 167, 35, 139, 130, 27, 21, 59, 7, 200, 165, 37, 91, 29,
+        ],
+        [
+            220, 228, 189, 172, 68, 102, 135, 236, 7, 70, 152, 244, 120, 217, 67, 44, 43, 74, 155,
+            179, 2, 148, 106, 238, 232, 186, 181, 130, 141, 114, 60, 1,
+        ],
+        [
+            68, 132, 80, 55, 28, 52, 222, 165, 156, 6, 214, 236, 207, 37, 223, 118, 42, 55, 40,
+            123, 208, 181, 240, 56, 14, 142, 58, 72, 193, 71, 120, 58,
+        ],
+        [
+            93, 114, 68, 232, 179, 37, 202, 74, 41, 64, 245, 112, 233, 162, 231, 19, 223, 207, 232,
+            213, 178, 60, 106, 26, 35, 191, 108, 19, 243, 220, 40, 41,
+        ],
+        [
+            166, 223, 96, 196, 120, 210, 67, 47, 249, 123, 164, 213, 148, 138, 7, 155, 96, 222,
+            176, 166, 88, 85, 95, 71, 221, 237, 138, 181, 198, 165, 163, 0,
+        ],
+        [
+            241, 254, 24, 83, 47, 65, 146, 151, 5, 182, 233, 205, 182, 13, 75, 173, 10, 14, 48,
+            223, 227, 201, 141, 212, 114, 205, 196, 92, 137, 253, 127, 60,
+        ],
+        [
+            20, 41, 204, 77, 168, 230, 68, 202, 73, 251, 254, 88, 95, 80, 130, 216, 122, 75, 173,
+            105, 236, 192, 177, 209, 26, 66, 205, 127, 154, 188, 245, 17,
+        ],
+    ],
+    [
+        [
+            239, 194, 214, 218, 225, 244, 0, 110, 12, 75, 130, 236, 76, 102, 205, 64, 104, 144,
+            198, 188, 183, 46, 119, 96, 230, 68, 210, 161, 253, 91, 8, 20,
+        ],
+        [
+            84, 32, 226, 77, 213, 16, 207, 156, 234, 224, 147, 173, 186, 249, 186, 155, 90, 255,
+            34, 55, 48, 108, 76, 214, 254, 66, 95, 200, 174, 191, 52, 43,
+        ],
+        [
+            37, 103, 206, 174, 250, 172, 136, 87, 30, 68, 89, 230, 110, 190, 148, 71, 5, 249, 217,
+            112, 54, 182, 127, 54, 173, 89, 6, 63, 230, 69, 32, 35,
+        ],
+        [
+            160, 186, 242, 212, 179, 197, 16, 239, 56, 24, 91, 241, 68, 7, 138, 200, 93, 194, 45,
+            155, 210, 60, 30, 4, 167, 246, 82, 244, 71, 217, 31, 20,
+        ],
+        [
+            182, 132, 62, 134, 4, 186, 95, 160, 230, 255, 125, 156, 5, 134, 66, 99, 83, 182, 156,
+            207, 98, 84, 197, 48, 160, 47, 126, 2, 253, 64, 69, 25,
+        ],
+        [
+            135, 241, 60, 121, 32, 218, 195, 61, 68, 66, 190, 195, 208, 2, 201, 111, 158, 101, 108,
+            228, 145, 141, 82, 80, 36, 16, 157, 212, 65, 213, 188, 61,
+        ],
+        [
+            190, 186, 202, 30, 121, 177, 200, 82, 245, 162, 14, 253, 114, 50, 43, 134, 246, 12,
+            100, 222, 149, 242, 117, 174, 136, 192, 117, 132, 228, 144, 238, 39,
+        ],
+        [
+            160, 120, 19, 13, 34, 38, 71, 236, 116, 162, 150, 254, 247, 252, 222, 198, 196, 59, 98,
+            165, 54, 33, 22, 120, 58, 73, 225, 42, 37, 211, 88, 21,
+        ],
+    ],
+    [
+        [
+            252, 1, 229, 131, 50, 189, 111, 31, 191, 210, 177, 219, 234, 21, 100, 182, 115, 212,
+            154, 111, 130, 59, 237, 32, 142, 202, 110, 96, 166, 120, 188, 1,
+        ],
+        [
+            247, 244, 137, 120, 38, 62, 94, 38, 17, 38, 102, 240, 225, 129, 15, 214, 213, 142, 79,
+            176, 156, 118, 85, 80, 167, 47, 122, 152, 206, 19, 67, 40,
+        ],
+        [
+            27, 159, 102, 201, 17, 4, 75, 28, 159, 5, 194, 6, 63, 104, 157, 219, 53, 38, 84, 216,
+            73, 181, 11, 118, 29, 177, 147, 135, 150, 5, 58, 10,
+        ],
+        [
+            97, 168, 102, 245, 40, 187, 155, 99, 147, 65, 114, 119, 191, 225, 196, 34, 117, 134,
+            116, 162, 73, 69, 158, 103, 144, 16, 22, 216, 146, 38, 10, 41,
+        ],
+        [
+            149, 231, 10, 10, 17, 16, 88, 231, 24, 215, 115, 237, 123, 68, 9, 209, 24, 141, 150,
+            207, 109, 56, 107, 192, 252, 112, 156, 0, 65, 234, 86, 10,
+        ],
+        [
+            201, 24, 6, 113, 122, 123, 58, 3, 233, 141, 78, 228, 137, 112, 71, 121, 200, 171, 158,
+            233, 87, 171, 121, 118, 205, 98, 38, 24, 176, 153, 170, 25,
+        ],
+        [
+            6, 114, 137, 241, 204, 203, 173, 160, 14, 124, 220, 164, 166, 224, 0, 253, 255, 68, 40,
+            182, 248, 135, 226, 25, 213, 247, 45, 116, 94, 147, 107, 3,
+        ],
+        [
+            73, 103, 138, 222, 168, 203, 85, 216, 242, 63, 127, 158, 153, 60, 168, 180, 234, 71,
+            27, 10, 38, 161, 207, 26, 81, 150, 195, 37, 91, 228, 57, 46,
+        ],
+    ],
+    [
+        [
+            188, 220, 107, 162, 250, 116, 137, 134, 75, 73, 102, 28, 11, 158, 166, 162, 77, 99,
+            159, 21, 166, 195, 208, 99, 28, 0, 51, 64, 126, 222, 203, 28,
+        ],
+        [
+            115, 93, 10, 209, 3, 81, 82, 191, 158, 74, 26, 242, 145, 24, 85, 106, 28, 36, 54, 17,
+            216, 109, 58, 102, 221, 11, 10, 157, 226, 90, 53, 3,
+        ],
+        [
+            197, 172, 174, 245, 150, 142, 92, 221, 45, 118, 174, 8, 83, 195, 45, 83, 221, 212, 122,
+            239, 218, 103, 89, 56, 184, 102, 73, 70, 1, 40, 246, 54,
+        ],
+        [
+            131, 77, 239, 236, 59, 58, 35, 163, 25, 57, 251, 93, 224, 202, 225, 84, 189, 195, 1,
+            234, 156, 138, 3, 2, 102, 170, 173, 235, 97, 41, 224, 0,
+        ],
+        [
+            251, 165, 141, 221, 2, 154, 174, 224, 120, 187, 163, 188, 37, 146, 49, 193, 150, 241,
+            183, 33, 12, 228, 96, 92, 105, 198, 238, 59, 247, 172, 247, 54,
+        ],
+        [
+            31, 84, 10, 130, 68, 107, 203, 153, 201, 34, 69, 151, 1, 180, 37, 198, 113, 64, 82,
+            116, 116, 142, 251, 62, 22, 122, 138, 130, 200, 159, 145, 2,
+        ],
+        [
+            229, 126, 102, 192, 242, 5, 109, 247, 248, 70, 34, 78, 35, 23, 81, 67, 34, 226, 133,
+            119, 200, 242, 142, 111, 223, 102, 159, 61, 162, 226, 222, 11,
+        ],
+        [
+            171, 0, 253, 102, 188, 223, 208, 250, 186, 183, 127, 172, 10, 41, 201, 173, 242, 156,
+            106, 219, 236, 139, 76, 115, 200, 123, 176, 228, 181, 248, 121, 38,
+        ],
+    ],
+    [
+        [
+            187, 71, 125, 130, 250, 45, 125, 44, 56, 31, 103, 55, 71, 87, 166, 228, 184, 12, 252,
+            79, 26, 221, 65, 188, 62, 254, 222, 87, 189, 71, 43, 0,
+        ],
+        [
+            248, 127, 55, 175, 11, 237, 134, 201, 211, 212, 93, 115, 63, 118, 15, 121, 71, 55, 176,
+            74, 3, 75, 20, 100, 177, 194, 39, 92, 67, 109, 243, 38,
+        ],
+        [
+            147, 188, 248, 11, 127, 3, 176, 153, 109, 5, 65, 101, 2, 46, 70, 203, 246, 245, 254,
+            67, 193, 214, 156, 21, 116, 165, 60, 79, 219, 45, 180, 47,
+        ],
+        [
+            78, 126, 47, 15, 17, 83, 240, 144, 40, 174, 95, 250, 144, 43, 132, 67, 241, 189, 140,
+            244, 41, 221, 164, 186, 104, 156, 223, 233, 160, 99, 190, 39,
+        ],
+        [
+            29, 119, 16, 42, 190, 69, 200, 191, 3, 160, 164, 28, 189, 135, 85, 63, 59, 121, 213,
+            143, 9, 96, 150, 14, 21, 93, 132, 57, 4, 165, 174, 12,
+        ],
+        [
+            54, 200, 34, 46, 89, 210, 152, 121, 245, 147, 150, 48, 193, 246, 108, 154, 243, 12, 10,
+            10, 97, 83, 225, 116, 187, 177, 176, 80, 248, 185, 5, 38,
+        ],
+        [
+            245, 84, 103, 49, 77, 27, 84, 143, 30, 40, 54, 249, 178, 71, 191, 135, 199, 72, 204,
+            162, 75, 110, 203, 246, 193, 61, 70, 158, 74, 154, 13, 45,
+        ],
+        [
+            123, 98, 28, 217, 129, 160, 71, 205, 19, 41, 168, 124, 76, 145, 108, 71, 57, 60, 26,
+            154, 163, 64, 250, 13, 52, 179, 197, 193, 54, 184, 29, 32,
+        ],
+    ],
+    [
+        [
+            103, 140, 102, 88, 162, 193, 224, 59, 243, 31, 145, 100, 116, 71, 36, 129, 94, 248, 33,
+            0, 102, 46, 146, 206, 22, 255, 216, 58, 61, 118, 226, 47,
+        ],
+        [
+            21, 127, 228, 231, 155, 190, 28, 145, 48, 160, 35, 104, 47, 120, 243, 107, 145, 118,
+            199, 126, 138, 164, 246, 143, 153, 59, 153, 209, 81, 118, 167, 9,
+        ],
+        [
+            4, 84, 44, 30, 90, 253, 226, 166, 218, 12, 39, 214, 231, 241, 223, 87, 87, 82, 93, 220,
+            65, 132, 166, 75, 221, 33, 236, 113, 198, 43, 210, 39,
+        ],
+        [
+            243, 54, 41, 143, 244, 171, 75, 158, 218, 230, 55, 35, 236, 18, 40, 55, 157, 139, 180,
+            29, 58, 159, 88, 208, 214, 87, 168, 227, 93, 211, 194, 17,
+        ],
+        [
+            97, 131, 219, 190, 19, 178, 244, 173, 141, 143, 113, 3, 27, 63, 35, 185, 170, 43, 75,
+            64, 75, 38, 5, 13, 123, 39, 147, 243, 141, 122, 217, 39,
+        ],
+        [
+            3, 24, 126, 200, 122, 92, 125, 221, 95, 205, 139, 145, 231, 77, 223, 96, 84, 39, 33,
+            66, 139, 41, 82, 182, 22, 102, 95, 173, 66, 125, 77, 21,
+        ],
+        [
+            27, 50, 52, 183, 190, 198, 236, 248, 71, 251, 120, 132, 192, 227, 113, 36, 155, 81,
+            225, 48, 72, 17, 246, 99, 208, 242, 236, 93, 2, 19, 53, 31,
+        ],
+        [
+            99, 18, 31, 165, 229, 52, 216, 52, 162, 62, 66, 1, 190, 22, 69, 133, 11, 126, 106, 165,
+            131, 180, 218, 253, 238, 124, 3, 16, 42, 196, 148, 57,
+        ],
+    ],
+    [
+        [
+            0, 209, 105, 72, 69, 130, 81, 154, 136, 174, 169, 182, 42, 150, 112, 115, 234, 136, 47,
+            170, 158, 213, 211, 65, 178, 62, 18, 172, 135, 59, 253, 19,
+        ],
+        [
+            145, 192, 219, 168, 214, 190, 54, 248, 68, 248, 196, 148, 4, 254, 61, 193, 67, 218,
+            131, 110, 235, 60, 159, 101, 200, 218, 208, 195, 30, 249, 163, 32,
+        ],
+        [
+            21, 246, 3, 74, 137, 246, 202, 207, 71, 59, 198, 73, 117, 224, 124, 57, 2, 82, 110, 6,
+            190, 80, 143, 143, 113, 62, 127, 122, 164, 202, 6, 54,
+        ],
+        [
+            252, 245, 11, 63, 63, 70, 60, 82, 15, 154, 188, 35, 211, 222, 252, 180, 109, 109, 98,
+            69, 197, 240, 137, 46, 189, 8, 167, 87, 15, 179, 18, 12,
+        ],
+        [
+            125, 206, 204, 128, 43, 62, 39, 36, 246, 164, 44, 6, 250, 83, 14, 207, 53, 201, 166,
+            231, 175, 110, 140, 200, 48, 239, 20, 171, 46, 80, 115, 54,
+        ],
+        [
+            167, 7, 74, 225, 61, 229, 21, 154, 196, 11, 247, 27, 158, 112, 217, 238, 57, 53, 63,
+            251, 162, 91, 168, 86, 37, 203, 207, 119, 68, 135, 205, 9,
+        ],
+        [
+            84, 187, 71, 200, 46, 254, 136, 13, 25, 137, 121, 128, 232, 221, 40, 0, 175, 232, 153,
+            227, 181, 162, 29, 67, 225, 234, 249, 102, 82, 171, 226, 1,
+        ],
+        [
+            24, 185, 170, 6, 35, 57, 108, 85, 245, 134, 216, 239, 33, 12, 223, 38, 227, 73, 145,
+            100, 25, 14, 244, 177, 84, 38, 101, 67, 21, 96, 249, 61,
+        ],
+    ],
+    [
+        [
+            57, 9, 82, 174, 160, 195, 27, 106, 241, 225, 207, 16, 11, 131, 29, 63, 187, 187, 5, 76,
+            34, 39, 136, 124, 56, 25, 58, 99, 70, 116, 170, 19,
+        ],
+        [
+            143, 6, 32, 114, 74, 44, 29, 53, 226, 34, 62, 232, 111, 63, 201, 203, 46, 115, 209,
+            118, 31, 27, 1, 120, 254, 70, 252, 80, 5, 111, 123, 55,
+        ],
+        [
+            62, 18, 214, 41, 0, 12, 4, 12, 145, 201, 12, 6, 179, 4, 20, 84, 36, 155, 8, 99, 181,
+            18, 150, 144, 203, 228, 172, 135, 166, 152, 214, 8,
+        ],
+        [
+            49, 93, 249, 139, 121, 113, 205, 158, 145, 118, 40, 96, 206, 154, 71, 190, 146, 65,
+            233, 104, 83, 91, 25, 118, 176, 14, 149, 115, 137, 27, 223, 41,
+        ],
+        [
+            116, 160, 29, 244, 254, 193, 228, 122, 194, 168, 126, 1, 222, 247, 90, 191, 253, 101,
+            123, 197, 178, 127, 30, 113, 38, 73, 48, 240, 82, 52, 161, 12,
+        ],
+        [
+            156, 145, 203, 40, 113, 83, 199, 161, 230, 196, 203, 227, 217, 212, 254, 139, 37, 215,
+            39, 230, 190, 141, 119, 120, 87, 23, 61, 21, 3, 209, 179, 47,
+        ],
+        [
+            179, 114, 238, 159, 43, 22, 64, 61, 207, 56, 101, 90, 62, 245, 27, 21, 165, 0, 205, 34,
+            104, 32, 170, 75, 215, 255, 83, 74, 123, 73, 159, 19,
+        ],
+        [
+            14, 208, 162, 223, 209, 5, 175, 15, 1, 78, 222, 82, 21, 113, 25, 129, 103, 64, 139, 21,
+            226, 245, 199, 114, 252, 69, 133, 254, 128, 63, 61, 13,
+        ],
+    ],
+    [
+        [
+            255, 187, 20, 3, 51, 61, 230, 80, 83, 233, 71, 190, 94, 131, 225, 143, 139, 246, 196,
+            161, 165, 85, 92, 167, 71, 198, 83, 10, 164, 120, 89, 26,
+        ],
+        [
+            250, 108, 167, 151, 249, 92, 38, 36, 21, 96, 210, 31, 41, 91, 113, 183, 104, 192, 3,
+            45, 165, 253, 37, 75, 239, 245, 28, 148, 5, 255, 134, 60,
+        ],
+        [
+            59, 154, 220, 255, 37, 98, 169, 60, 50, 196, 202, 240, 225, 57, 165, 129, 255, 66, 169,
+            162, 7, 30, 198, 27, 160, 208, 193, 106, 29, 119, 104, 48,
+        ],
+        [
+            137, 180, 21, 151, 27, 173, 213, 11, 238, 163, 104, 192, 171, 59, 79, 249, 123, 55,
+            183, 8, 94, 117, 32, 48, 41, 141, 231, 207, 61, 135, 104, 2,
+        ],
+        [
+            242, 254, 15, 0, 58, 49, 204, 28, 27, 56, 2, 67, 248, 104, 160, 32, 214, 242, 10, 206,
+            233, 61, 23, 103, 180, 53, 179, 198, 56, 254, 65, 6,
+        ],
+        [
+            136, 214, 253, 248, 156, 140, 42, 172, 221, 187, 160, 233, 86, 213, 239, 5, 110, 252,
+            70, 18, 193, 29, 156, 156, 136, 70, 167, 59, 98, 223, 7, 30,
+        ],
+        [
+            84, 25, 227, 152, 61, 51, 53, 59, 135, 229, 159, 248, 6, 39, 151, 139, 121, 149, 226,
+            142, 126, 136, 248, 196, 93, 176, 131, 254, 221, 204, 179, 36,
+        ],
+        [
+            198, 74, 99, 58, 59, 34, 82, 94, 95, 64, 17, 241, 173, 114, 211, 57, 124, 181, 140,
+            102, 105, 79, 13, 1, 60, 121, 143, 88, 192, 253, 159, 47,
+        ],
+    ],
+    [
+        [
+            90, 115, 165, 218, 163, 197, 210, 143, 213, 125, 1, 77, 74, 165, 200, 244, 80, 39, 20,
+            247, 86, 120, 109, 109, 93, 7, 209, 199, 109, 12, 144, 46,
+        ],
+        [
+            231, 44, 48, 128, 109, 202, 114, 192, 218, 67, 233, 141, 64, 251, 104, 41, 58, 212, 60,
+            65, 93, 58, 34, 149, 128, 90, 30, 197, 191, 244, 8, 37,
+        ],
+        [
+            56, 47, 18, 80, 195, 143, 175, 35, 183, 225, 201, 236, 138, 29, 26, 229, 194, 202, 13,
+            43, 71, 188, 3, 204, 12, 15, 218, 207, 15, 83, 219, 39,
+        ],
+        [
+            50, 71, 182, 171, 33, 129, 211, 168, 40, 85, 193, 218, 165, 54, 220, 203, 164, 124, 8,
+            37, 19, 210, 8, 253, 120, 158, 239, 239, 28, 195, 253, 37,
+        ],
+        [
+            245, 191, 155, 103, 118, 221, 209, 204, 89, 48, 249, 160, 180, 1, 114, 3, 254, 220, 94,
+            244, 221, 122, 224, 55, 184, 106, 99, 11, 236, 89, 211, 38,
+        ],
+        [
+            182, 208, 168, 152, 15, 192, 45, 31, 93, 181, 13, 203, 128, 82, 126, 145, 129, 220, 19,
+            252, 188, 247, 49, 216, 218, 198, 178, 70, 180, 209, 175, 22,
+        ],
+        [
+            72, 71, 200, 22, 21, 120, 50, 111, 112, 195, 141, 79, 49, 52, 98, 8, 37, 130, 142, 13,
+            78, 197, 15, 92, 203, 50, 108, 82, 109, 254, 158, 12,
+        ],
+        [
+            71, 44, 114, 76, 152, 26, 79, 25, 44, 244, 191, 178, 150, 102, 34, 230, 54, 251, 209,
+            155, 90, 28, 81, 49, 127, 246, 116, 238, 106, 105, 196, 29,
+        ],
+    ],
+    [
+        [
+            208, 87, 78, 186, 184, 128, 38, 190, 131, 156, 221, 119, 87, 12, 144, 4, 240, 77, 118,
+            209, 74, 131, 37, 155, 247, 155, 206, 167, 80, 71, 127, 18,
+        ],
+        [
+            190, 54, 229, 228, 15, 167, 185, 240, 161, 238, 216, 88, 210, 31, 242, 20, 81, 147, 48,
+            54, 38, 226, 251, 64, 69, 196, 67, 166, 242, 34, 118, 39,
+        ],
+        [
+            58, 171, 187, 174, 13, 247, 253, 15, 102, 171, 48, 63, 136, 157, 55, 28, 117, 130, 104,
+            23, 145, 203, 155, 105, 121, 249, 115, 106, 88, 114, 86, 11,
+        ],
+        [
+            105, 30, 100, 75, 20, 206, 29, 147, 150, 37, 48, 216, 33, 147, 61, 193, 82, 230, 205,
+            122, 142, 65, 148, 102, 47, 185, 182, 147, 185, 31, 29, 54,
+        ],
+        [
+            158, 245, 169, 236, 26, 185, 17, 174, 156, 69, 81, 196, 60, 109, 99, 91, 19, 208, 93,
+            58, 9, 109, 228, 186, 109, 127, 171, 156, 229, 215, 195, 59,
+        ],
+        [
+            23, 42, 4, 183, 91, 177, 2, 172, 168, 182, 158, 185, 157, 118, 199, 184, 237, 203, 60,
+            170, 35, 121, 162, 7, 130, 171, 121, 207, 32, 2, 227, 62,
+        ],
+        [
+            0, 139, 174, 217, 13, 116, 28, 230, 238, 117, 190, 91, 86, 105, 38, 231, 147, 100, 233,
+            187, 70, 128, 111, 82, 184, 113, 154, 136, 59, 27, 21, 10,
+        ],
+        [
+            4, 208, 53, 136, 59, 196, 102, 52, 69, 1, 231, 8, 254, 19, 67, 134, 251, 73, 157, 156,
+            30, 94, 170, 147, 185, 72, 11, 143, 226, 255, 0, 60,
+        ],
+    ],
+    [
+        [
+            214, 131, 68, 196, 131, 169, 22, 250, 29, 101, 142, 26, 106, 96, 18, 190, 18, 15, 19,
+            59, 203, 203, 119, 251, 61, 221, 198, 116, 24, 178, 61, 42,
+        ],
+        [
+            101, 161, 133, 103, 0, 112, 204, 255, 98, 240, 20, 161, 242, 253, 216, 204, 83, 96, 93,
+            228, 77, 76, 63, 70, 116, 156, 69, 253, 121, 189, 2, 36,
+        ],
+        [
+            156, 83, 226, 206, 4, 35, 12, 137, 209, 181, 109, 81, 194, 119, 188, 216, 30, 233, 135,
+            220, 213, 40, 74, 152, 49, 14, 0, 3, 223, 41, 238, 54,
+        ],
+        [
+            47, 25, 110, 4, 111, 57, 200, 91, 168, 73, 47, 175, 189, 60, 49, 243, 128, 11, 63, 17,
+            151, 123, 80, 140, 139, 202, 93, 104, 190, 32, 67, 54,
+        ],
+        [
+            90, 100, 132, 107, 167, 162, 164, 62, 239, 68, 20, 223, 157, 1, 90, 95, 248, 82, 65,
+            61, 241, 63, 238, 10, 2, 160, 230, 104, 101, 197, 60, 52,
+        ],
+        [
+            41, 144, 80, 156, 134, 224, 6, 48, 188, 57, 30, 205, 84, 135, 190, 75, 213, 94, 16, 72,
+            11, 96, 41, 117, 75, 60, 62, 133, 29, 133, 105, 15,
+        ],
+        [
+            219, 66, 247, 117, 3, 137, 38, 43, 131, 177, 137, 150, 9, 65, 160, 206, 235, 121, 121,
+            245, 205, 233, 229, 78, 72, 200, 171, 149, 240, 64, 184, 5,
+        ],
+        [
+            22, 179, 118, 116, 100, 222, 159, 96, 236, 247, 38, 23, 224, 103, 6, 5, 42, 95, 161, 4,
+            128, 2, 240, 122, 117, 247, 127, 207, 76, 205, 137, 31,
+        ],
+    ],
+    [
+        [
+            255, 68, 73, 184, 204, 219, 231, 9, 237, 101, 142, 55, 146, 252, 138, 14, 186, 62, 32,
+            108, 79, 130, 251, 188, 101, 134, 179, 162, 172, 160, 149, 22,
+        ],
+        [
+            93, 226, 69, 177, 229, 17, 78, 185, 6, 206, 195, 246, 145, 189, 141, 7, 197, 148, 166,
+            43, 203, 235, 170, 119, 102, 76, 108, 98, 216, 237, 121, 34,
+        ],
+        [
+            211, 167, 46, 90, 228, 111, 217, 129, 255, 3, 113, 207, 200, 221, 28, 48, 33, 62, 31,
+            245, 116, 175, 130, 128, 180, 252, 132, 178, 56, 58, 16, 2,
+        ],
+        [
+            159, 176, 149, 39, 220, 58, 146, 80, 175, 91, 125, 15, 166, 114, 133, 117, 52, 243,
+            219, 221, 223, 114, 140, 236, 106, 39, 65, 168, 43, 244, 140, 57,
+        ],
+        [
+            144, 68, 49, 189, 208, 94, 145, 108, 143, 62, 16, 188, 15, 110, 23, 239, 71, 48, 32,
+            238, 96, 19, 43, 91, 231, 90, 77, 162, 159, 162, 71, 15,
+        ],
+        [
+            103, 8, 114, 153, 156, 97, 188, 167, 128, 217, 58, 42, 208, 82, 234, 142, 53, 71, 10,
+            38, 177, 2, 13, 35, 8, 49, 196, 134, 215, 255, 42, 54,
+        ],
+        [
+            229, 29, 149, 199, 252, 232, 6, 148, 31, 243, 79, 192, 221, 191, 136, 186, 249, 198,
+            35, 155, 198, 198, 19, 183, 159, 123, 65, 127, 169, 3, 156, 59,
+        ],
+        [
+            2, 244, 213, 144, 80, 83, 125, 211, 252, 98, 209, 105, 104, 213, 143, 183, 164, 199,
+            103, 53, 110, 48, 230, 35, 34, 129, 221, 255, 225, 224, 42, 42,
+        ],
+    ],
+    [
+        [
+            145, 41, 77, 21, 230, 237, 146, 98, 160, 218, 242, 227, 198, 83, 11, 39, 148, 69, 31,
+            185, 143, 52, 71, 75, 157, 26, 157, 188, 179, 27, 114, 24,
+        ],
+        [
+            160, 247, 33, 120, 242, 78, 125, 237, 149, 68, 194, 190, 248, 145, 93, 23, 171, 167,
+            181, 242, 226, 41, 104, 67, 0, 116, 81, 246, 87, 82, 103, 51,
+        ],
+        [
+            84, 35, 131, 165, 134, 206, 147, 191, 7, 3, 253, 142, 49, 128, 111, 47, 53, 169, 88,
+            17, 31, 193, 20, 98, 19, 173, 111, 175, 134, 186, 166, 27,
+        ],
+        [
+            49, 150, 139, 110, 180, 138, 202, 107, 41, 238, 123, 185, 17, 161, 67, 30, 2, 2, 39,
+            91, 7, 35, 69, 121, 34, 12, 247, 78, 138, 39, 59, 8,
+        ],
+        [
+            64, 14, 249, 58, 50, 65, 122, 135, 174, 11, 102, 220, 221, 64, 29, 66, 24, 169, 57,
+            114, 140, 176, 7, 149, 78, 15, 211, 255, 101, 244, 151, 46,
+        ],
+        [
+            127, 185, 215, 42, 158, 164, 234, 37, 140, 239, 228, 75, 189, 8, 197, 4, 206, 24, 136,
+            191, 73, 206, 141, 195, 85, 123, 141, 189, 82, 250, 65, 21,
+        ],
+        [
+            49, 239, 163, 97, 219, 143, 242, 84, 53, 166, 149, 155, 243, 11, 207, 69, 250, 25, 159,
+            142, 240, 8, 72, 229, 91, 179, 218, 39, 128, 133, 201, 6,
+        ],
+        [
+            96, 144, 236, 91, 71, 246, 217, 36, 27, 102, 209, 14, 75, 249, 185, 211, 2, 97, 216,
+            204, 141, 6, 234, 251, 183, 215, 152, 151, 125, 210, 121, 14,
+        ],
+    ],
+];
+
+pub fn generator() -> pallas::Affine {
+    pallas::Affine::from_xy(
+        pallas::Base::from_bytes(&GENERATOR.0).unwrap(),
+        pallas::Base::from_bytes(&GENERATOR.1).unwrap(),
+    )
+    .unwrap()
+}
+
+#[cfg(test)]
+mod tests {
+    use super::super::{
+        test_lagrange_coeffs, test_zs_and_us, NUM_WINDOWS_SHORT, VALUE_COMMITMENT_PERSONALIZATION,
+    };
+    use super::*;
+    use group::Curve;
+    use pasta_curves::{
+        arithmetic::{CurveAffine, CurveExt, FieldExt},
+        pallas,
+    };
+
+    #[test]
+    fn generator() {
+        let hasher = pallas::Point::hash_to_curve(VALUE_COMMITMENT_PERSONALIZATION);
+        let point = hasher(b"v");
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(*coords.x(), pallas::Base::from_bytes(&GENERATOR.0).unwrap());
+        assert_eq!(*coords.y(), pallas::Base::from_bytes(&GENERATOR.1).unwrap());
+    }
+
+    #[test]
+    fn lagrange_coeffs_short() {
+        let base = super::generator();
+        test_lagrange_coeffs(base, NUM_WINDOWS_SHORT);
+    }
+
+    #[test]
+    fn z_short() {
+        let base = super::generator();
+        test_zs_and_us(base, &Z_SHORT, &U_SHORT, NUM_WINDOWS_SHORT);
+    }
+}

+ 261 - 0
src/crypto/constants/sinsemilla.rs

@@ -0,0 +1,261 @@
+//! Sinsemilla generators
+use super::OrchardFixedBases;
+//use crate::spec::i2lebsp;
+
+use halo2_gadgets::sinsemilla::{CommitDomains, HashDomains};
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    pallas,
+};
+
+/// Number of bits of each message piece in $\mathsf{SinsemillaHashToPoint}$
+pub const K: usize = 10;
+
+/// $\frac{1}{2^K}$
+pub const INV_TWO_POW_K: [u8; 32] = [
+    1, 0, 192, 196, 160, 229, 70, 82, 221, 165, 74, 202, 85, 7, 62, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+    0, 0, 0, 0, 0, 240, 63,
+];
+
+/// The largest integer such that $2^c \leq (r_P - 1) / 2$, where $r_P$ is the order
+/// of Pallas.
+pub const C: usize = 253;
+
+/// SWU hash-to-curve personalization for the Merkle CRH generator
+pub const MERKLE_CRH_PERSONALIZATION: &str = "z.cash:Orchard-MerkleCRH";
+
+// Sinsemilla Q generators
+
+/// SWU hash-to-curve personalization for Sinsemilla $Q$ generators.
+pub const Q_PERSONALIZATION: &str = "z.cash:SinsemillaQ";
+
+// Sinsemilla S generators
+
+/// SWU hash-to-curve personalization for Sinsemilla $S$ generators.
+pub const S_PERSONALIZATION: &str = "z.cash:SinsemillaS";
+
+/// Generator used in SinsemillaHashToPoint for note commitment
+pub const Q_NOTE_COMMITMENT_M_GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        93, 116, 168, 64, 9, 186, 14, 50, 42, 221, 70, 253, 90, 15, 150, 197, 93, 237, 176, 121,
+        180, 242, 159, 247, 13, 205, 251, 86, 160, 7, 128, 23,
+    ],
+    [
+        99, 172, 73, 115, 90, 10, 39, 135, 158, 94, 219, 129, 136, 18, 34, 136, 44, 201, 244, 110,
+        217, 194, 190, 78, 131, 112, 198, 138, 147, 88, 160, 50,
+    ],
+);
+
+/// Generator used in SinsemillaHashToPoint for IVK commitment
+pub const Q_COMMIT_IVK_M_GENERATOR: ([u8; 32], [u8; 32]) = (
+    [
+        242, 130, 15, 121, 146, 47, 203, 107, 50, 162, 40, 81, 36, 204, 27, 66, 250, 65, 162, 90,
+        184, 129, 204, 125, 17, 200, 169, 74, 241, 12, 188, 5,
+    ],
+    [
+        190, 222, 173, 207, 206, 229, 90, 190, 241, 165, 109, 201, 29, 53, 196, 70, 75, 5, 222, 32,
+        70, 7, 89, 239, 230, 190, 26, 212, 246, 76, 1, 27,
+    ],
+);
+
+/// Generator used in SinsemillaHashToPoint for Merkle collision-resistant hash
+pub const Q_MERKLE_CRH: ([u8; 32], [u8; 32]) = (
+    [
+        160, 198, 41, 127, 249, 199, 185, 248, 112, 16, 141, 192, 85, 185, 190, 201, 153, 14, 137,
+        239, 90, 54, 15, 160, 185, 24, 168, 99, 150, 210, 22, 22,
+    ],
+    [
+        98, 234, 242, 37, 206, 174, 233, 134, 150, 21, 116, 5, 234, 150, 28, 226, 121, 89, 163, 79,
+        62, 242, 196, 45, 153, 32, 175, 227, 163, 66, 134, 53,
+    ],
+);
+
+pub fn i2lebsp<const NUM_BITS: usize>(int: u64) -> [bool; NUM_BITS] {
+    assert!(NUM_BITS <= 64);
+    super::util::gen_const_array(|mask: usize| (int & (1 << mask)) != 0)
+}
+
+#[allow(dead_code)]
+fn lebs2ip_k(bits: &[bool]) -> u32 {
+    assert!(bits.len() == K);
+    bits.iter()
+        .enumerate()
+        .fold(0u32, |acc, (i, b)| acc + if *b { 1 << i } else { 0 })
+}
+
+/// The sequence of K bits in little-endian order representing an integer
+/// up to `2^K` - 1.
+pub fn i2lebsp_k(int: usize) -> [bool; K] {
+    assert!(int < (1 << K));
+    i2lebsp(int as u64)
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum OrchardHashDomains {
+    NoteCommit,
+    CommitIvk,
+    MerkleCrh,
+}
+
+#[allow(non_snake_case)]
+impl HashDomains<pallas::Affine> for OrchardHashDomains {
+    fn Q(&self) -> pallas::Affine {
+        match self {
+            OrchardHashDomains::CommitIvk => pallas::Affine::from_xy(
+                pallas::Base::from_bytes(&Q_COMMIT_IVK_M_GENERATOR.0).unwrap(),
+                pallas::Base::from_bytes(&Q_COMMIT_IVK_M_GENERATOR.1).unwrap(),
+            )
+            .unwrap(),
+            OrchardHashDomains::NoteCommit => pallas::Affine::from_xy(
+                pallas::Base::from_bytes(&Q_NOTE_COMMITMENT_M_GENERATOR.0).unwrap(),
+                pallas::Base::from_bytes(&Q_NOTE_COMMITMENT_M_GENERATOR.1).unwrap(),
+            )
+            .unwrap(),
+            OrchardHashDomains::MerkleCrh => pallas::Affine::from_xy(
+                pallas::Base::from_bytes(&Q_MERKLE_CRH.0).unwrap(),
+                pallas::Base::from_bytes(&Q_MERKLE_CRH.1).unwrap(),
+            )
+            .unwrap(),
+        }
+    }
+}
+
+#[derive(Clone, Debug, Eq, PartialEq)]
+pub enum OrchardCommitDomains {
+    NoteCommit,
+    CommitIvk,
+}
+
+impl CommitDomains<pallas::Affine, OrchardFixedBases, OrchardHashDomains> for OrchardCommitDomains {
+    fn r(&self) -> OrchardFixedBases {
+        match self {
+            Self::NoteCommit => OrchardFixedBases::NoteCommitR,
+            Self::CommitIvk => OrchardFixedBases::CommitIvkR,
+        }
+    }
+
+    fn hash_domain(&self) -> OrchardHashDomains {
+        match self {
+            Self::NoteCommit => OrchardHashDomains::NoteCommit,
+            Self::CommitIvk => OrchardHashDomains::CommitIvk,
+        }
+    }
+}
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+    use crate::crypto::constants::{
+        fixed_bases::{COMMIT_IVK_PERSONALIZATION, NOTE_COMMITMENT_PERSONALIZATION},
+        sinsemilla::MERKLE_CRH_PERSONALIZATION,
+    };
+    use halo2_gadgets::primitives::sinsemilla::{CommitDomain, HashDomain};
+
+    use pasta_curves::{
+        arithmetic::{CurveAffine, FieldExt},
+        group::{ff::PrimeField, Curve},
+        pallas,
+    };
+    use rand::{self, rngs::OsRng, Rng};
+
+    #[test]
+    // Nodes in the Merkle tree are Pallas base field elements.
+    fn l_orchard_merkle() {
+        assert_eq!(255, pallas::Base::NUM_BITS as usize);
+    }
+
+    #[test]
+    fn lebs2ip_k_round_trip() {
+        let mut rng = OsRng;
+        {
+            let int = rng.gen_range(0..(1 << K));
+            assert_eq!(lebs2ip_k(&i2lebsp_k(int)) as usize, int);
+        }
+
+        assert_eq!(lebs2ip_k(&i2lebsp_k(0)) as usize, 0);
+        assert_eq!(lebs2ip_k(&i2lebsp_k((1 << K) - 1)) as usize, (1 << K) - 1);
+    }
+
+    #[test]
+    fn i2lebsp_k_round_trip() {
+        {
+            let bitstring = (0..K).map(|_| rand::random()).collect::<Vec<_>>();
+            assert_eq!(
+                i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
+                bitstring
+            );
+        }
+
+        {
+            let bitstring = [false; K];
+            assert_eq!(
+                i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
+                bitstring
+            );
+        }
+
+        {
+            let bitstring = [true; K];
+            assert_eq!(
+                i2lebsp_k(lebs2ip_k(&bitstring) as usize).to_vec(),
+                bitstring
+            );
+        }
+    }
+
+    #[test]
+    fn q_note_commitment_m() {
+        let domain = CommitDomain::new(NOTE_COMMITMENT_PERSONALIZATION);
+        let point = domain.Q();
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(
+            *coords.x(),
+            pallas::Base::from_bytes(&Q_NOTE_COMMITMENT_M_GENERATOR.0).unwrap()
+        );
+        assert_eq!(
+            *coords.y(),
+            pallas::Base::from_bytes(&Q_NOTE_COMMITMENT_M_GENERATOR.1).unwrap()
+        );
+    }
+
+    #[test]
+    fn q_commit_ivk_m() {
+        let domain = CommitDomain::new(COMMIT_IVK_PERSONALIZATION);
+        let point = domain.Q();
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(
+            *coords.x(),
+            pallas::Base::from_bytes(&Q_COMMIT_IVK_M_GENERATOR.0).unwrap()
+        );
+        assert_eq!(
+            *coords.y(),
+            pallas::Base::from_bytes(&Q_COMMIT_IVK_M_GENERATOR.1).unwrap()
+        );
+    }
+
+    #[test]
+    fn q_merkle_crh() {
+        let domain = HashDomain::new(MERKLE_CRH_PERSONALIZATION);
+        let point = domain.Q();
+        let coords = point.to_affine().coordinates().unwrap();
+
+        assert_eq!(
+            *coords.x(),
+            pallas::Base::from_bytes(&Q_MERKLE_CRH.0).unwrap()
+        );
+        assert_eq!(
+            *coords.y(),
+            pallas::Base::from_bytes(&Q_MERKLE_CRH.1).unwrap()
+        );
+    }
+
+    #[test]
+    fn inv_two_pow_k() {
+        let two_pow_k = pallas::Base::from_u64(1u64 << K);
+        let inv_two_pow_k = pallas::Base::from_bytes(&INV_TWO_POW_K).unwrap();
+
+        assert_eq!(two_pow_k * inv_two_pow_k, pallas::Base::one());
+    }
+}

+ 31 - 0
src/crypto/constants/util.rs

@@ -0,0 +1,31 @@
+use pasta_curves::arithmetic::{CurveAffine, Field, FieldExt};
+
+/// Evaluate y = f(x) given the coefficients of f(x)
+pub fn evaluate<C: CurveAffine>(x: u8, coeffs: &[C::Base]) -> C::Base {
+    let x = C::Base::from_u64(x as u64);
+    coeffs
+        .iter()
+        .rev()
+        .cloned()
+        .reduce(|acc, coeff| acc * x + coeff)
+        .unwrap_or_else(C::Base::zero)
+}
+
+/// Takes in an FnMut closure and returns a constant-length array with elements of
+/// type `Output`.
+pub fn gen_const_array<Output: Copy + Default, const LEN: usize>(
+    closure: impl FnMut(usize) -> Output,
+) -> [Output; LEN] {
+    gen_const_array_with_default(Default::default(), closure)
+}
+
+pub(crate) fn gen_const_array_with_default<Output: Copy, const LEN: usize>(
+    default_value: Output,
+    mut closure: impl FnMut(usize) -> Output,
+) -> [Output; LEN] {
+    let mut ret: [Output; LEN] = [default_value; LEN];
+    for (bit, val) in ret.iter_mut().zip((0..LEN).map(|idx| closure(idx))) {
+        *bit = val;
+    }
+    ret
+}

+ 4 - 3
src/crypto/diffie_hellman.rs

@@ -1,5 +1,6 @@
 use blake2b_simd::{Hash as Blake2bHash, Params as Blake2bParams};
-use group::{cofactor::CofactorGroup, GroupEncoding};
+use pasta_curves as pasta;
+use pasta_curves::group::{cofactor::CofactorGroup, GroupEncoding};
 
 pub const KDF_SAPLING_PERSONALIZATION: &[u8; 16] = b"DarkFiSaplingKDF";
 
@@ -8,7 +9,7 @@ pub const KDF_SAPLING_PERSONALIZATION: &[u8; 16] = b"DarkFiSaplingKDF";
 /// Sapling key agreement for note encryption.
 ///
 /// Implements section 5.4.4.3 of the Zcash Protocol Specification.
-pub fn sapling_ka_agree(esk: &jubjub::Fr, pk_d: &jubjub::ExtendedPoint) -> jubjub::SubgroupPoint {
+pub fn sapling_ka_agree(esk: &pasta::Fq, pk_d: &pasta::Ep) -> pasta::Ep {
     // [8 esk] pk_d
     // <ExtendedPoint as CofactorGroup>::clear_cofactor is implemented using
     // ExtendedPoint::mul_by_cofactor in the jubjub crate.
@@ -25,7 +26,7 @@ pub fn sapling_ka_agree(esk: &jubjub::Fr, pk_d: &jubjub::ExtendedPoint) -> jubju
 /// Sapling KDF for note encryption.
 ///
 /// Implements section 5.4.4.4 of the Zcash Protocol Specification.
-pub fn kdf_sapling(dhsecret: jubjub::SubgroupPoint, epk: &jubjub::ExtendedPoint) -> Blake2bHash {
+pub fn kdf_sapling(dhsecret: pasta::Ep, epk: &pasta::Ep) -> Blake2bHash {
     Blake2bParams::new()
         .hash_length(32)
         .personal(KDF_SAPLING_PERSONALIZATION)

+ 102 - 410
src/crypto/merkle.rs

@@ -1,455 +1,147 @@
-//! Implementation of a Merkle tree of commitments used to prove the existence
-//! of notes.
-
-//use byteorder::{LittleEndian, ReadBytesExt};
-use crate::serial::{Decodable, Encodable, VarInt};
-use crate::{Error, Result};
-use std::collections::VecDeque;
-use std::io;
-use std::io::{Read, Write};
-
-//use super::serialize::{Optional, Vector};
-use super::merkle_node::SAPLING_COMMITMENT_TREE_DEPTH;
-
-/// A hashable node within a Merkle tree.
-pub trait Hashable: Clone + Copy + Encodable + Decodable {
-    /// Parses a node from the given byte source.
-    fn read<R: Read>(reader: R) -> Result<Self>;
-
-    /// Serializes this node.
-    fn write<W: Write>(&self, writer: W) -> Result<()>;
-
-    /// Returns the parent node within the tree of the two given nodes.
-    fn combine(_: usize, _: &Self, _: &Self) -> Self;
-
-    /// Returns a blank leaf node.
-    fn blank() -> Self;
-
-    /// Returns the empty root for the given depth.
-    fn empty_root(_: usize) -> Self;
+use std::iter;
+
+use halo2_gadgets::primitives::sinsemilla::HashDomain;
+use incrementalmerkletree::{Altitude, Hashable};
+use lazy_static::lazy_static;
+use pasta_curves::{
+    arithmetic::FieldExt,
+    group::ff::{PrimeField, PrimeFieldBits},
+    pallas,
+};
+
+use super::{
+    coin::Coin,
+    constants::{
+        sinsemilla::{i2lebsp_k, MERKLE_CRH_PERSONALIZATION},
+        util::gen_const_array_with_default,
+    },
+};
+
+// TODO: to constants
+const MERKLE_DEPTH_ORCHARD: usize = 32;
+
+lazy_static! {
+    static ref UNCOMMITTED_ORCHARD: pallas::Base = pallas::Base::from_u64(2);
+    pub(crate) static ref EMPTY_ROOTS: Vec<MerkleHash> = {
+        iter::empty()
+            .chain(Some(MerkleHash::empty_leaf()))
+            .chain(
+                (0..MERKLE_DEPTH_ORCHARD).scan(MerkleHash::empty_leaf(), |state, l| {
+                    let l = l as u8;
+                    *state = MerkleHash::combine(l.into(), state, state);
+                    Some(*state)
+                }),
+            )
+            .collect()
+    };
 }
 
-struct PathFiller<Node: Hashable> {
-    queue: VecDeque<Node>,
-}
+#[derive(Copy, Clone, Debug)]
+pub struct MerkleHash(pallas::Base);
 
-impl<Node: Hashable> PathFiller<Node> {
-    fn empty() -> Self {
-        PathFiller {
-            queue: VecDeque::new(),
-        }
+impl MerkleHash {
+    pub fn from_coin(value: &Coin) -> Self {
+        MerkleHash(value.inner())
     }
 
-    fn next(&mut self, depth: usize) -> Node {
-        self.queue
-            .pop_front()
-            .unwrap_or_else(|| Node::empty_root(depth))
+    pub(crate) fn inner(&self) -> pallas::Base {
+        self.0
     }
-}
 
-/// A Merkle tree of note commitments.
-///
-/// The depth of the Merkle tree is fixed at 32, equal to the depth of the
-/// Sapling commitment tree.
-#[derive(Clone)]
-pub struct CommitmentTree<Node: Hashable> {
-    left: Option<Node>,
-    right: Option<Node>,
-    parents: Vec<Option<Node>>,
-}
-
-impl<Node: Hashable> CommitmentTree<Node> {
-    /// Creates an empty tree.
-    pub fn empty() -> Self {
-        CommitmentTree {
-            left: None,
-            right: None,
-            parents: vec![],
-        }
-    }
-
-    /// Returns the number of leaf nodes in the tree.
-    pub fn size(&self) -> usize {
-        self.parents.iter().enumerate().fold(
-            match (self.left, self.right) {
-                (None, None) => 0,
-                (Some(_), None) => 1,
-                (Some(_), Some(_)) => 2,
-                (None, Some(_)) => unreachable!(),
-            },
-            |acc, (i, p)| {
-                // Treat occupation of parents array as a binary number
-                // (right-shifted by 1)
-                acc + if p.is_some() { 1 << (i + 1) } else { 0 }
-            },
-        )
+    pub fn to_bytes(&self) -> [u8; 32] {
+        self.0.to_bytes()
     }
 
-    fn is_complete(&self, depth: usize) -> bool {
-        self.left.is_some()
-            && self.right.is_some()
-            && self.parents.len() == depth - 1
-            && self.parents.iter().all(|p| p.is_some())
+    pub fn from_bytes(bytes: &[u8; 32]) -> Self {
+        pallas::Base::from_bytes(bytes).map(MerkleHash).unwrap()
     }
+}
 
-    /// Adds a leaf node to the tree.
-    ///
-    /// Returns an error if the tree is full.
-    pub fn append(&mut self, node: Node) -> Result<()> {
-        self.append_inner(node, SAPLING_COMMITMENT_TREE_DEPTH)
+impl Hashable for MerkleHash {
+    fn empty_leaf() -> Self {
+        MerkleHash(*UNCOMMITTED_ORCHARD)
     }
 
-    fn append_inner(&mut self, node: Node, depth: usize) -> Result<()> {
-        if self.is_complete(depth) {
-            return Err(Error::TreeFull);
-        }
-
-        match (self.left, self.right) {
-            (None, _) => self.left = Some(node),
-            (_, None) => self.right = Some(node),
-            (Some(l), Some(r)) => {
-                let mut combined = Node::combine(0, &l, &r);
-                self.left = Some(node);
-                self.right = None;
-
-                for i in 0..depth {
-                    if i < self.parents.len() {
-                        if let Some(p) = self.parents[i] {
-                            combined = Node::combine(i + 1, &p, &combined);
-                            self.parents[i] = None;
-                        } else {
-                            self.parents[i] = Some(combined);
-                            break;
-                        }
-                    } else {
-                        self.parents.push(Some(combined));
-                        break;
-                    }
-                }
-            }
-        }
+    fn combine(altitude: Altitude, left: &Self, right: &Self) -> Self {
+        let domain = HashDomain::new(MERKLE_CRH_PERSONALIZATION);
 
-        Ok(())
+        MerkleHash(
+            domain
+                .hash(
+                    iter::empty()
+                        .chain(i2lebsp_k(altitude.into()).iter().copied())
+                        .chain(left.0.to_le_bits().iter().by_val().take(255))
+                        .chain(right.0.to_le_bits().iter().by_val().take(255)),
+                )
+                .unwrap_or(pallas::Base::zero()),
+        )
     }
 
-    /// Returns the current root of the tree.
-    pub fn root(&self) -> Node {
-        self.root_inner(SAPLING_COMMITMENT_TREE_DEPTH, PathFiller::empty())
-    }
-
-    fn root_inner(&self, depth: usize, mut filler: PathFiller<Node>) -> Node {
-        assert!(depth > 0);
-
-        // 1) Hash left and right leaves together.
-        //    - Empty leaves are used as needed.
-        let leaf_root = Node::combine(
-            0,
-            &self.left.unwrap_or_else(|| filler.next(0)),
-            &self.right.unwrap_or_else(|| filler.next(0)),
-        );
-
-        // 2) Hash in parents up to the currently-filled depth.
-        //    - Roots of the empty subtrees are used as needed.
-        let mid_root = self
-            .parents
-            .iter()
-            .enumerate()
-            .fold(leaf_root, |root, (i, p)| match p {
-                Some(node) => Node::combine(i + 1, node, &root),
-                None => Node::combine(i + 1, &root, &filler.next(i + 1)),
-            });
-
-        // 3) Hash in roots of the empty subtrees up to the final depth.
-        ((self.parents.len() + 1)..depth)
-            .fold(mid_root, |root, d| Node::combine(d, &root, &filler.next(d)))
+    fn empty_root(altitude: Altitude) -> Self {
+        EMPTY_ROOTS[<usize>::from(altitude)]
     }
 }
 
-impl<Node: Hashable> Encodable for CommitmentTree<Node> {
-    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
-        let mut len = 0;
-        len += self.left.encode(&mut s)?;
-        len += self.right.encode(&mut s)?;
-        len += self.parents.encode(&mut s)?;
-        Ok(len)
-    }
-}
+pub struct Anchor(pallas::Base);
 
-impl<Node: Hashable> Decodable for CommitmentTree<Node> {
-    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
-        Ok(Self {
-            left: Decodable::decode(&mut d)?,
-            right: Decodable::decode(&mut d)?,
-            parents: Decodable::decode(&mut d)?,
-        })
+impl From<pallas::Base> for Anchor {
+    fn from(anchor_field: pallas::Base) -> Anchor {
+        Anchor(anchor_field)
     }
 }
 
-/*
-/// An updatable witness to a path from a position in a particular
-/// [`CommitmentTree`].
-///
-/// Appending the same commitments in the same order to both the original
-/// [`CommitmentTree`] and this `IncrementalWitness` will result in a witness to
-/// the path from the target position to the root of the updated tree.
-///
-/// # Examples
-///
-/// ```
-/// use ff::{Field, PrimeField};
-/// use rand_core::OsRng;
-/// use zcash_primitives::{
-///     merkle_tree::{CommitmentTree, IncrementalWitness},
-///     sapling::Node,
-/// };
-///
-/// let mut rng = OsRng;
-///
-/// let mut tree = CommitmentTree::<Node>::empty();
-///
-/// tree.append(Node::new(bls12_381::Scalar::random(&mut rng).to_repr()));
-/// tree.append(Node::new(bls12_381::Scalar::random(&mut rng).to_repr()));
-/// let mut witness = IncrementalWitness::from_tree(&tree);
-/// assert_eq!(witness.position(), 1);
-/// assert_eq!(tree.root(), witness.root());
-///
-/// let cmu = Node::new(bls12_381::Scalar::random(&mut rng).to_repr());
-/// tree.append(cmu);
-/// witness.append(cmu);
-/// assert_eq!(tree.root(), witness.root());
-/// ```
-///
-*/
-
-#[derive(Clone)]
-pub struct IncrementalWitness<Node: Hashable> {
-    tree: CommitmentTree<Node>,
-    filled: Vec<Node>,
-    cursor_depth: usize,
-    cursor: Option<CommitmentTree<Node>>,
-}
-
-impl<Node: Hashable> Encodable for Vec<Node> {
-    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
-        let mut len = 0;
-        len += VarInt(self.len() as u64).encode(&mut s)?;
-        for c in self.iter() {
-            len += c.encode(&mut s)?;
-        }
-        Ok(len)
+impl From<MerkleHash> for Anchor {
+    fn from(anchor: MerkleHash) -> Anchor {
+        Anchor(anchor.0)
     }
 }
 
-impl<Node: Hashable> Decodable for Vec<Node> {
-    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
-        let len = VarInt::decode(&mut d)?.0;
-        let mut ret = Vec::with_capacity(len as usize);
-        for _ in 0..len {
-            ret.push(Decodable::decode(&mut d)?);
-        }
-        Ok(ret)
+impl Anchor {
+    pub fn from_bytes(bytes: [u8; 32]) -> Anchor {
+        pallas::Base::from_repr(bytes).map(Anchor).unwrap()
     }
-}
-
-impl<Node: Hashable> Encodable for IncrementalWitness<Node> {
-    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
-        let mut len = 0;
-        len += self.tree.encode(&mut s)?;
 
-        len += self.filled.encode(&mut s)?;
-
-        len += self.cursor_depth.encode(&mut s)?;
-        len += self.cursor.encode(&mut s)?;
-        Ok(len)
+    pub fn to_bytes(self) -> [u8; 32] {
+        self.0.to_repr()
     }
 }
 
-impl<Node: Hashable> Decodable for IncrementalWitness<Node> {
-    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
-        Ok(Self {
-            tree: Decodable::decode(&mut d)?,
-            filled: Decodable::decode(&mut d)?,
-            cursor_depth: Decodable::decode(&mut d)?,
-            cursor: Decodable::decode(d)?,
-        })
-    }
+#[derive(Debug)]
+pub struct MerklePath {
+    position: u32,
+    auth_path: [MerkleHash; MERKLE_DEPTH_ORCHARD],
 }
 
-impl<Node: Hashable> IncrementalWitness<Node> {
-    /// Creates an `IncrementalWitness` for the most recent commitment added to
-    /// the given [`CommitmentTree`].
-    pub fn from_tree(tree: &CommitmentTree<Node>) -> IncrementalWitness<Node> {
-        IncrementalWitness {
-            tree: tree.clone(),
-            filled: vec![],
-            cursor_depth: 0,
-            cursor: None,
-        }
-    }
-
-    /// Returns the position of the witnessed leaf node in the commitment tree.
-    pub fn position(&self) -> usize {
-        self.tree.size() - 1
-    }
-
-    fn filler(&self) -> PathFiller<Node> {
-        let cursor_root = self
-            .cursor
-            .as_ref()
-            .map(|c| c.root_inner(self.cursor_depth, PathFiller::empty()));
-
-        PathFiller {
-            queue: self.filled.iter().cloned().chain(cursor_root).collect(),
+impl MerklePath {
+    pub fn new(position: u32, auth_path: [pallas::Base; MERKLE_DEPTH_ORCHARD]) -> Self {
+        Self {
+            position,
+            auth_path: gen_const_array_with_default(MerkleHash::empty_leaf(), |i| {
+                MerkleHash(auth_path[i])
+            }),
         }
     }
 
-    /// Finds the next "depth" of an unfilled subtree.
-    fn next_depth(&self) -> usize {
-        let mut skip = self.filled.len();
-
-        if self.tree.left.is_none() {
-            if skip > 0 {
-                skip -= 1;
-            } else {
-                return 0;
-            }
-        }
-
-        if self.tree.right.is_none() {
-            if skip > 0 {
-                skip -= 1;
-            } else {
-                return 0;
-            }
-        }
-
-        let mut d = 1;
-        for p in &self.tree.parents {
-            if p.is_none() {
-                if skip > 0 {
-                    skip -= 1;
+    pub fn root(&self, coin: Coin) -> Anchor {
+        self.auth_path
+            .iter()
+            .enumerate()
+            .fold(MerkleHash::from_coin(&coin), |node, (l, sibling)| {
+                let l = l as u8;
+                if self.position & (1 << l) == 0 {
+                    MerkleHash::combine(l.into(), &node, sibling)
                 } else {
-                    return d;
+                    MerkleHash::combine(l.into(), sibling, &node)
                 }
-            }
-            d += 1;
-        }
-
-        d + skip
-    }
-
-    /// Tracks a leaf node that has been added to the underlying tree.
-    ///
-    /// Returns an error if the tree is full.
-    pub fn append(&mut self, node: Node) -> Result<()> {
-        self.append_inner(node, SAPLING_COMMITMENT_TREE_DEPTH)
-    }
-
-    fn append_inner(&mut self, node: Node, depth: usize) -> Result<()> {
-        if let Some(mut cursor) = self.cursor.take() {
-            cursor
-                .append_inner(node, depth)
-                .expect("cursor should not be full");
-            if cursor.is_complete(self.cursor_depth) {
-                self.filled
-                    .push(cursor.root_inner(self.cursor_depth, PathFiller::empty()));
-            } else {
-                self.cursor = Some(cursor);
-            }
-        } else {
-            self.cursor_depth = self.next_depth();
-            if self.cursor_depth >= depth {
-                return Err(Error::TreeFull);
-            }
-
-            if self.cursor_depth == 0 {
-                self.filled.push(node);
-            } else {
-                let mut cursor = CommitmentTree::empty();
-                cursor
-                    .append_inner(node, depth)
-                    .expect("cursor should not be full");
-                self.cursor = Some(cursor);
-            }
-        }
-
-        Ok(())
-    }
-
-    /// Returns the current root of the tree corresponding to the witness.
-    pub fn root(&self) -> Node {
-        self.root_inner(SAPLING_COMMITMENT_TREE_DEPTH)
-    }
-
-    fn root_inner(&self, depth: usize) -> Node {
-        self.tree.root_inner(depth, self.filler())
-    }
-
-    /// Returns the current witness, or None if the tree is empty.
-    pub fn path(&self) -> Option<MerklePath<Node>> {
-        self.path_inner(SAPLING_COMMITMENT_TREE_DEPTH)
-    }
-
-    fn path_inner(&self, depth: usize) -> Option<MerklePath<Node>> {
-        let mut filler = self.filler();
-        let mut auth_path = Vec::new();
-
-        if let Some(node) = self.tree.left {
-            if self.tree.right.is_some() {
-                auth_path.push((node, true));
-            } else {
-                auth_path.push((filler.next(0), false));
-            }
-        } else {
-            // Can't create an authentication path for the beginning of the tree
-            return None;
-        }
-
-        for (i, p) in self.tree.parents.iter().enumerate() {
-            auth_path.push(match p {
-                Some(node) => (*node, true),
-                None => (filler.next(i + 1), false),
-            });
-        }
-
-        for i in self.tree.parents.len()..(depth - 1) {
-            auth_path.push((filler.next(i + 1), false));
-        }
-        assert_eq!(auth_path.len(), depth);
-
-        Some(MerklePath::from_path(auth_path, self.position() as u64))
+            })
+            .into()
     }
-}
-
-/// A path from a position in a particular commitment tree to the root of that
-/// tree.
-#[derive(Clone, Debug, PartialEq)]
-pub struct MerklePath<Node: Hashable> {
-    pub auth_path: Vec<(Node, bool)>,
-    pub position: u64,
-}
 
-impl<Node: Hashable> MerklePath<Node> {
-    /// Constructs a Merkle path directly from a path and position.
-    pub fn from_path(auth_path: Vec<(Node, bool)>, position: u64) -> Self {
-        MerklePath {
-            auth_path,
-            position,
-        }
+    pub fn position(&self) -> u32 {
+        self.position
     }
 
-    /// Returns the root of the tree corresponding to this path applied to
-    /// `leaf`.
-    pub fn root(&self, leaf: Node) -> Node {
+    pub fn auth_path(&self) -> [MerkleHash; MERKLE_DEPTH_ORCHARD] {
         self.auth_path
-            .iter()
-            .enumerate()
-            .fold(
-                leaf,
-                |root, (i, (p, leaf_is_on_right))| match leaf_is_on_right {
-                    false => Node::combine(i, &root, p),
-                    true => Node::combine(i, p, &root),
-                },
-            )
     }
 }

+ 453 - 0
src/crypto/merkle_old.rs

@@ -0,0 +1,453 @@
+//! Implementation of a Merkle tree of commitments used to prove the existence
+//! of notes.
+
+//use byteorder::{LittleEndian, ReadBytesExt};
+use crate::serial::{Decodable, Encodable, VarInt};
+use crate::{Error, Result};
+use std::collections::VecDeque;
+use std::io;
+use std::io::{Read, Write};
+
+//use super::serialize::{Optional, Vector};
+use super::merkle_node::SAPLING_COMMITMENT_TREE_DEPTH;
+
+/// A hashable node within a Merkle tree.
+pub trait Hashable: Clone + Copy + Encodable + Decodable {
+    /// Parses a node from the given byte source.
+    fn read<R: Read>(reader: R) -> Result<Self>;
+
+    /// Serializes this node.
+    fn write<W: Write>(&self, writer: W) -> Result<()>;
+
+    /// Returns the parent node within the tree of the two given nodes.
+    fn combine(_: usize, _: &Self, _: &Self) -> Self;
+
+    /// Returns a blank leaf node.
+    fn blank() -> Self;
+
+    /// Returns the empty root for the given depth.
+    fn empty_root(_: usize) -> Self;
+}
+
+struct PathFiller<Node: Hashable> {
+    queue: VecDeque<Node>,
+}
+
+impl<Node: Hashable> PathFiller<Node> {
+    fn empty() -> Self {
+        PathFiller {
+            queue: VecDeque::new(),
+        }
+    }
+
+    fn next(&mut self, depth: usize) -> Node {
+        self.queue
+            .pop_front()
+            .unwrap_or_else(|| Node::empty_root(depth))
+    }
+}
+
+/// A Merkle tree of note commitments.
+///
+/// The depth of the Merkle tree is fixed at 32, equal to the depth of the
+/// Sapling commitment tree.
+#[derive(Clone)]
+pub struct CommitmentTree<Node: Hashable> {
+    left: Option<Node>,
+    right: Option<Node>,
+    parents: Vec<Option<Node>>,
+}
+
+impl<Node: Hashable> CommitmentTree<Node> {
+    /// Creates an empty tree.
+    pub fn empty() -> Self {
+        CommitmentTree {
+            left: None,
+            right: None,
+            parents: vec![],
+        }
+    }
+
+    /// Returns the number of leaf nodes in the tree.
+    pub fn size(&self) -> usize {
+        self.parents.iter().enumerate().fold(
+            match (self.left, self.right) {
+                (None, None) => 0,
+                (Some(_), None) => 1,
+                (Some(_), Some(_)) => 2,
+                (None, Some(_)) => unreachable!(),
+            },
+            |acc, (i, p)| {
+                // Treat occupation of parents array as a binary number
+                // (right-shifted by 1)
+                acc + if p.is_some() { 1 << (i + 1) } else { 0 }
+            },
+        )
+    }
+
+    fn is_complete(&self, depth: usize) -> bool {
+        self.left.is_some()
+            && self.right.is_some()
+            && self.parents.len() == depth - 1
+            && self.parents.iter().all(|p| p.is_some())
+    }
+
+    /// Adds a leaf node to the tree.
+    ///
+    /// Returns an error if the tree is full.
+    pub fn append(&mut self, node: Node) -> Result<()> {
+        self.append_inner(node, SAPLING_COMMITMENT_TREE_DEPTH)
+    }
+
+    fn append_inner(&mut self, node: Node, depth: usize) -> Result<()> {
+        if self.is_complete(depth) {
+            return Err(Error::TreeFull);
+        }
+
+        match (self.left, self.right) {
+            (None, _) => self.left = Some(node),
+            (_, None) => self.right = Some(node),
+            (Some(l), Some(r)) => {
+                let mut combined = Node::combine(0, &l, &r);
+                self.left = Some(node);
+                self.right = None;
+
+                for i in 0..depth {
+                    if i < self.parents.len() {
+                        if let Some(p) = self.parents[i] {
+                            combined = Node::combine(i + 1, &p, &combined);
+                            self.parents[i] = None;
+                        } else {
+                            self.parents[i] = Some(combined);
+                            break;
+                        }
+                    } else {
+                        self.parents.push(Some(combined));
+                        break;
+                    }
+                }
+            }
+        }
+
+        Ok(())
+    }
+
+    /// Returns the current root of the tree.
+    pub fn root(&self) -> Node {
+        self.root_inner(SAPLING_COMMITMENT_TREE_DEPTH, PathFiller::empty())
+    }
+
+    fn root_inner(&self, depth: usize, mut filler: PathFiller<Node>) -> Node {
+        assert!(depth > 0);
+
+        // 1) Hash left and right leaves together.
+        //    - Empty leaves are used as needed.
+        let leaf_root = Node::combine(
+            0,
+            &self.left.unwrap_or_else(|| filler.next(0)),
+            &self.right.unwrap_or_else(|| filler.next(0)),
+        );
+
+        // 2) Hash in parents up to the currently-filled depth.
+        //    - Roots of the empty subtrees are used as needed.
+        let mid_root = self
+            .parents
+            .iter()
+            .enumerate()
+            .fold(leaf_root, |root, (i, p)| match p {
+                Some(node) => Node::combine(i + 1, node, &root),
+                None => Node::combine(i + 1, &root, &filler.next(i + 1)),
+            });
+
+        // 3) Hash in roots of the empty subtrees up to the final depth.
+        ((self.parents.len() + 1)..depth)
+            .fold(mid_root, |root, d| Node::combine(d, &root, &filler.next(d)))
+    }
+}
+
+impl<Node: Hashable> Encodable for CommitmentTree<Node> {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let mut len = 0;
+        len += self.left.encode(&mut s)?;
+        len += self.right.encode(&mut s)?;
+        len += self.parents.encode(&mut s)?;
+        Ok(len)
+    }
+}
+
+impl<Node: Hashable> Decodable for CommitmentTree<Node> {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        Ok(Self {
+            left: Decodable::decode(&mut d)?,
+            right: Decodable::decode(&mut d)?,
+            parents: Decodable::decode(&mut d)?,
+        })
+    }
+}
+
+/// An updatable witness to a path from a position in a particular
+/// [`CommitmentTree`].
+///
+/// Appending the same commitments in the same order to both the original
+/// [`CommitmentTree`] and this `IncrementalWitness` will result in a witness to
+/// the path from the target position to the root of the updated tree.
+///
+/// # Examples
+///
+/// ```
+/// use ff::{Field, PrimeField};
+/// use rand_core::OsRng;
+/// use zcash_primitives::{
+///     merkle_tree::{CommitmentTree, IncrementalWitness},
+///     sapling::Node,
+/// };
+///
+/// let mut rng = OsRng;
+///
+/// let mut tree = CommitmentTree::<Node>::empty();
+///
+/// tree.append(Node::new(bls12_381::Scalar::random(&mut rng).to_repr()));
+/// tree.append(Node::new(bls12_381::Scalar::random(&mut rng).to_repr()));
+/// let mut witness = IncrementalWitness::from_tree(&tree);
+/// assert_eq!(witness.position(), 1);
+/// assert_eq!(tree.root(), witness.root());
+///
+/// let cmu = Node::new(bls12_381::Scalar::random(&mut rng).to_repr());
+/// tree.append(cmu);
+/// witness.append(cmu);
+/// assert_eq!(tree.root(), witness.root());
+/// ```
+///
+
+#[derive(Clone)]
+pub struct IncrementalWitness<Node: Hashable> {
+    tree: CommitmentTree<Node>,
+    filled: Vec<Node>,
+    cursor_depth: usize,
+    cursor: Option<CommitmentTree<Node>>,
+}
+
+impl<Node: Hashable> Encodable for Vec<Node> {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let mut len = 0;
+        len += VarInt(self.len() as u64).encode(&mut s)?;
+        for c in self.iter() {
+            len += c.encode(&mut s)?;
+        }
+        Ok(len)
+    }
+}
+
+impl<Node: Hashable> Decodable for Vec<Node> {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let len = VarInt::decode(&mut d)?.0;
+        let mut ret = Vec::with_capacity(len as usize);
+        for _ in 0..len {
+            ret.push(Decodable::decode(&mut d)?);
+        }
+        Ok(ret)
+    }
+}
+
+impl<Node: Hashable> Encodable for IncrementalWitness<Node> {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        let mut len = 0;
+        len += self.tree.encode(&mut s)?;
+
+        len += self.filled.encode(&mut s)?;
+
+        len += self.cursor_depth.encode(&mut s)?;
+        len += self.cursor.encode(&mut s)?;
+        Ok(len)
+    }
+}
+
+impl<Node: Hashable> Decodable for IncrementalWitness<Node> {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        Ok(Self {
+            tree: Decodable::decode(&mut d)?,
+            filled: Decodable::decode(&mut d)?,
+            cursor_depth: Decodable::decode(&mut d)?,
+            cursor: Decodable::decode(d)?,
+        })
+    }
+}
+
+impl<Node: Hashable> IncrementalWitness<Node> {
+    /// Creates an `IncrementalWitness` for the most recent commitment added to
+    /// the given [`CommitmentTree`].
+    pub fn from_tree(tree: &CommitmentTree<Node>) -> IncrementalWitness<Node> {
+        IncrementalWitness {
+            tree: tree.clone(),
+            filled: vec![],
+            cursor_depth: 0,
+            cursor: None,
+        }
+    }
+
+    /// Returns the position of the witnessed leaf node in the commitment tree.
+    pub fn position(&self) -> usize {
+        self.tree.size() - 1
+    }
+
+    fn filler(&self) -> PathFiller<Node> {
+        let cursor_root = self
+            .cursor
+            .as_ref()
+            .map(|c| c.root_inner(self.cursor_depth, PathFiller::empty()));
+
+        PathFiller {
+            queue: self.filled.iter().cloned().chain(cursor_root).collect(),
+        }
+    }
+
+    /// Finds the next "depth" of an unfilled subtree.
+    fn next_depth(&self) -> usize {
+        let mut skip = self.filled.len();
+
+        if self.tree.left.is_none() {
+            if skip > 0 {
+                skip -= 1;
+            } else {
+                return 0;
+            }
+        }
+
+        if self.tree.right.is_none() {
+            if skip > 0 {
+                skip -= 1;
+            } else {
+                return 0;
+            }
+        }
+
+        let mut d = 1;
+        for p in &self.tree.parents {
+            if p.is_none() {
+                if skip > 0 {
+                    skip -= 1;
+                } else {
+                    return d;
+                }
+            }
+            d += 1;
+        }
+
+        d + skip
+    }
+
+    /// Tracks a leaf node that has been added to the underlying tree.
+    ///
+    /// Returns an error if the tree is full.
+    pub fn append(&mut self, node: Node) -> Result<()> {
+        self.append_inner(node, SAPLING_COMMITMENT_TREE_DEPTH)
+    }
+
+    fn append_inner(&mut self, node: Node, depth: usize) -> Result<()> {
+        if let Some(mut cursor) = self.cursor.take() {
+            cursor
+                .append_inner(node, depth)
+                .expect("cursor should not be full");
+            if cursor.is_complete(self.cursor_depth) {
+                self.filled
+                    .push(cursor.root_inner(self.cursor_depth, PathFiller::empty()));
+            } else {
+                self.cursor = Some(cursor);
+            }
+        } else {
+            self.cursor_depth = self.next_depth();
+            if self.cursor_depth >= depth {
+                return Err(Error::TreeFull);
+            }
+
+            if self.cursor_depth == 0 {
+                self.filled.push(node);
+            } else {
+                let mut cursor = CommitmentTree::empty();
+                cursor
+                    .append_inner(node, depth)
+                    .expect("cursor should not be full");
+                self.cursor = Some(cursor);
+            }
+        }
+
+        Ok(())
+    }
+
+    /// Returns the current root of the tree corresponding to the witness.
+    pub fn root(&self) -> Node {
+        self.root_inner(SAPLING_COMMITMENT_TREE_DEPTH)
+    }
+
+    fn root_inner(&self, depth: usize) -> Node {
+        self.tree.root_inner(depth, self.filler())
+    }
+
+    /// Returns the current witness, or None if the tree is empty.
+    pub fn path(&self) -> Option<MerklePath<Node>> {
+        self.path_inner(SAPLING_COMMITMENT_TREE_DEPTH)
+    }
+
+    fn path_inner(&self, depth: usize) -> Option<MerklePath<Node>> {
+        let mut filler = self.filler();
+        let mut auth_path = Vec::new();
+
+        if let Some(node) = self.tree.left {
+            if self.tree.right.is_some() {
+                auth_path.push((node, true));
+            } else {
+                auth_path.push((filler.next(0), false));
+            }
+        } else {
+            // Can't create an authentication path for the beginning of the tree
+            return None;
+        }
+
+        for (i, p) in self.tree.parents.iter().enumerate() {
+            auth_path.push(match p {
+                Some(node) => (*node, true),
+                None => (filler.next(i + 1), false),
+            });
+        }
+
+        for i in self.tree.parents.len()..(depth - 1) {
+            auth_path.push((filler.next(i + 1), false));
+        }
+        assert_eq!(auth_path.len(), depth);
+
+        Some(MerklePath::from_path(auth_path, self.position() as u64))
+    }
+}
+
+/// A path from a position in a particular commitment tree to the root of that
+/// tree.
+#[derive(Clone, Debug, PartialEq)]
+pub struct MerklePath<Node: Hashable> {
+    pub auth_path: Vec<(Node, bool)>,
+    pub position: u64,
+}
+
+impl<Node: Hashable> MerklePath<Node> {
+    /// Constructs a Merkle path directly from a path and position.
+    pub fn from_path(auth_path: Vec<(Node, bool)>, position: u64) -> Self {
+        MerklePath {
+            auth_path,
+            position,
+        }
+    }
+
+    /// Returns the root of the tree corresponding to this path applied to
+    /// `leaf`.
+    pub fn root(&self, leaf: Node) -> Node {
+        self.auth_path
+            .iter()
+            .enumerate()
+            .fold(
+                leaf,
+                |root, (i, (p, leaf_is_on_right))| match leaf_is_on_right {
+                    false => Node::combine(i, &root, p),
+                    true => Node::combine(i, p, &root),
+                },
+            )
+    }
+}

+ 96 - 127
src/crypto/mint_proof.rs

@@ -1,56 +1,59 @@
-use bellman::gadgets::multipack;
-use bellman::groth16;
-use blake2s_simd::Params as Blake2sParams;
-use bls12_381::Bls12;
-use group::{Curve, GroupEncoding};
-use rand::rngs::OsRng;
 use std::io;
 use std::time::Instant;
 
-use crate::circuit::mint_contract::MintContract;
-use crate::error::Result;
-use crate::serial::{Decodable, Encodable};
+use halo2_gadgets::primitives;
+use halo2_gadgets::primitives::poseidon::{ConstantLength, P128Pow5T3};
+use log::debug;
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    group::Curve,
+    pallas,
+};
+
+use super::{
+    proof::{Proof, ProvingKey, VerifyingKey},
+    util::{mod_r_p, pedersen_commitment_scalar, pedersen_commitment_u64},
+};
+use crate::{
+    circuit::mint_contract::MintContract,
+    serial::{Decodable, Encodable},
+    types::*,
+    Result,
+};
 
 pub struct MintRevealedValues {
-    pub value_commit: jubjub::SubgroupPoint,
-    pub token_commit: jubjub::SubgroupPoint,
-    pub coin: [u8; 32],
+    pub value_commit: DrkValueCommit,
+    pub token_commit: DrkValueCommit,
+    //pub coin: [u8; 32],
+    pub coin: pallas::Base,
 }
 
 impl MintRevealedValues {
     fn compute(
         value: u64,
-        token_id: jubjub::Fr,
-        randomness_value: &jubjub::Fr,
-        randomness_token: &jubjub::Fr,
-        serial: &jubjub::Fr,
-        randomness_coin: &jubjub::Fr,
-        public: &jubjub::SubgroupPoint,
+        token_id: DrkTokenId,
+        value_blind: DrkValueBlind,
+        token_blind: DrkValueBlind,
+        serial: DrkSerial,
+        coin_blind: DrkCoinBlind,
+        public_key: DrkPublicKey,
     ) -> Self {
-        let value_commit = (zcash_primitives::constants::VALUE_COMMITMENT_VALUE_GENERATOR
-            * jubjub::Fr::from(value))
-            + (zcash_primitives::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR
-                * randomness_value);
-
-        let token_commit = (zcash_primitives::constants::VALUE_COMMITMENT_VALUE_GENERATOR
-            * token_id)
-            + (zcash_primitives::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR
-                * randomness_token);
-
-        let mut coin = [0; 32];
-        coin.copy_from_slice(
-            Blake2sParams::new()
-                .hash_length(32)
-                .personal(zcash_primitives::constants::CRH_IVK_PERSONALIZATION)
-                .to_state()
-                .update(&public.to_bytes())
-                .update(&value.to_le_bytes())
-                .update(&token_id.to_bytes())
-                .update(&serial.to_bytes())
-                .update(&randomness_coin.to_bytes())
-                .finalize()
-                .as_bytes(),
-        );
+        let value_commit = pedersen_commitment_u64(value, value_blind);
+        let token_commit = pedersen_commitment_scalar(mod_r_p(token_id), token_blind);
+
+        let coords = public_key.to_affine().coordinates().unwrap();
+        let messages = [
+            [*coords.x(), *coords.y()],
+            [DrkValue::from_u64(value), token_id],
+            [serial, coin_blind],
+        ];
+
+        let mut coin = DrkCoin::zero();
+        for msg in messages.iter() {
+            coin += primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(*msg);
+        }
+
+        //let coin = hash.to_bytes();
 
         MintRevealedValues {
             value_commit,
@@ -59,41 +62,20 @@ impl MintRevealedValues {
         }
     }
 
-    fn make_outputs(&self) -> [bls12_381::Scalar; 6] {
-        let mut public_input = [bls12_381::Scalar::zero(); 6];
-
-        {
-            let result = jubjub::ExtendedPoint::from(self.value_commit);
-            let affine = result.to_affine();
-            //let (u, v) = (affine.get_u(), affine.get_v());
-            let u = affine.get_u();
-            let v = affine.get_v();
-            public_input[0] = u;
-            public_input[1] = v;
-        }
-
-        {
-            let result = jubjub::ExtendedPoint::from(self.token_commit);
-            let affine = result.to_affine();
-            let u = affine.get_u();
-            let v = affine.get_v();
-            public_input[2] = u;
-            public_input[3] = v;
-        }
-
-        {
-            // Pack the hash as inputs for proof verification.
-            let hash = multipack::bytes_to_bits_le(&self.coin);
-            let hash = multipack::compute_multipacking(&hash);
-
-            // There are 2 chunks for a blake hash
-            assert_eq!(hash.len(), 2);
-
-            public_input[4] = hash[0];
-            public_input[5] = hash[1];
-        }
-
-        public_input
+    fn make_outputs(&self) -> [DrkCircuitField; 5] {
+        let value_coords = self.value_commit.to_affine().coordinates().unwrap();
+        let token_coords = self.token_commit.to_affine().coordinates().unwrap();
+
+        vec![
+            //DrkCircuitField::from_bytes(&self.coin).unwrap(),
+            self.coin.clone(),
+            *value_coords.x(),
+            *value_coords.y(),
+            *token_coords.x(),
+            *token_coords.y(),
+        ]
+        .try_into()
+        .unwrap()
     }
 }
 
@@ -117,72 +99,59 @@ impl Decodable for MintRevealedValues {
     }
 }
 
-pub fn setup_mint_prover() -> groth16::Parameters<Bls12> {
-    println!("Mint: Making random params...");
-    let start = Instant::now();
-    let params = {
-        let c = MintContract {
-            value: None,
-            token_id: None,
-            randomness_value: None,
-            randomness_token: None,
-            serial: None,
-            randomness_coin: None,
-            public: None,
-        };
-        groth16::generate_random_parameters::<Bls12, _, _>(c, &mut OsRng).unwrap()
-    };
-    println!("Setup: [{:?}]", start.elapsed());
-    params
-}
-
 #[allow(clippy::too_many_arguments)]
 pub fn create_mint_proof(
-    params: &groth16::Parameters<Bls12>,
     value: u64,
-    token_id: jubjub::Fr,
-    randomness_value: jubjub::Fr,
-    randomness_token: jubjub::Fr,
-    serial: jubjub::Fr,
-    randomness_coin: jubjub::Fr,
-    public: jubjub::SubgroupPoint,
-) -> (groth16::Proof<Bls12>, MintRevealedValues) {
+    token_id: DrkTokenId,
+    value_blind: DrkValueBlind,
+    token_blind: DrkValueBlind,
+    serial: DrkSerial,
+    coin_blind: DrkCoinBlind,
+    public_key: DrkPublicKey,
+) -> Result<(Proof, MintRevealedValues)> {
+    const K: u32 = 11;
+
     let revealed = MintRevealedValues::compute(
         value,
         token_id,
-        &randomness_value,
-        &randomness_token,
-        &serial,
-        &randomness_coin,
-        &public,
+        value_blind,
+        token_blind,
+        serial,
+        coin_blind,
+        public_key,
     );
 
+    let coords = public_key.to_affine().coordinates().unwrap();
+
     let c = MintContract {
-        value: Some(value),
-        token_id: Some(token_id),
-        randomness_value: Some(randomness_value),
-        randomness_token: Some(randomness_token),
+        pub_x: Some(*coords.x()),
+        pub_y: Some(*coords.y()),
+        value: Some(DrkValue::from_u64(value)),
+        asset: Some(token_id),
         serial: Some(serial),
-        randomness_coin: Some(randomness_coin),
-        public: Some(public),
+        coin_blind: Some(coin_blind),
+        value_blind: Some(value_blind),
+        asset_blind: Some(token_blind),
     };
 
     let start = Instant::now();
-    let proof = groth16::create_random_proof(c, params, &mut OsRng).unwrap();
-    println!("Prove: [{:?}]", start.elapsed());
+    // TODO: Don't always build this
+    let pk = ProvingKey::build(K, MintContract::default());
+    debug!("Setup: [{:?}]", start.elapsed());
+
+    let start = Instant::now();
+    let public_inputs = revealed.make_outputs();
+    let proof = Proof::create(&pk, &[c], &public_inputs)?;
+    debug!("Prove: [{:?}]", start.elapsed());
 
-    (proof, revealed)
+    Ok((proof, revealed))
 }
 
 pub fn verify_mint_proof(
-    pvk: &groth16::PreparedVerifyingKey<Bls12>,
-    proof: &groth16::Proof<Bls12>,
+    vk: &VerifyingKey,
+    proof: &Proof,
     revealed: &MintRevealedValues,
-) -> bool {
-    let public_input = revealed.make_outputs();
-
-    let start = Instant::now();
-    let result = groth16::verify_proof(pvk, proof, &public_input).is_ok();
-    println!("Verify: [{:?}]", start.elapsed());
-    result
+) -> Result<()> {
+    let public_inputs = revealed.make_outputs();
+    Ok(proof.verify(vk, &public_inputs)?)
 }

+ 16 - 29
src/crypto/mod.rs

@@ -1,49 +1,36 @@
+Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
+Warning: can't set `comment_width = 100`, unstable features are only available in nightly channel.
+Warning: can't set `imports_granularity = Crate`, unstable features are only available in nightly channel.
+Warning: can't set `binop_separator = Back`, unstable features are only available in nightly channel.
+Warning: can't set `trailing_semicolon = false`, unstable features are only available in nightly channel.
+Warning: can't set `trailing_comma = Vertical`, unstable features are only available in nightly channel.
+pub mod arith_chip;
 pub mod coin;
+pub mod constants;
 pub mod diffie_hellman;
-pub mod fr_serial;
 pub mod merkle;
-pub mod merkle_node;
+pub mod merkle_node2;
 pub mod mint_proof;
 pub mod note;
 pub mod nullifier;
+pub mod pasta_serial;
+pub mod proof;
 pub mod schnorr;
 pub mod spend_proof;
 pub mod util;
 
-use bellman::groth16;
-use bls12_381::Bls12;
+pub(crate) use {mint_proof::MintRevealedValues, proof::Proof, spend_proof::SpendRevealedValues};
 
-use crate::error::Result;
-pub use mint_proof::{create_mint_proof, setup_mint_prover, verify_mint_proof, MintRevealedValues};
-pub use spend_proof::{
-    create_spend_proof, setup_spend_prover, verify_spend_proof, SpendRevealedValues,
-};
+use crate::types::DrkSecretKey;
 
 #[derive(Clone)]
 pub struct OwnCoin {
     pub coin: coin::Coin,
     pub note: note::Note,
-    pub secret: jubjub::Fr,
-    pub witness: merkle::IncrementalWitness<merkle_node::MerkleNode>,
+    pub secret: DrkSecretKey,
+    //pub witness: merkle::IncrementalWitness<merkle_node::MerkleNode>,
+    //pub witness: BridgeFrontier<merkle::MerkleHash, 32>,
     pub nullifier: nullifier::Nullifier,
 }
 
 pub type OwnCoins = Vec<OwnCoin>;
-
-pub fn save_params(filename: &str, params: &groth16::Parameters<Bls12>) -> Result<()> {
-    let buffer = std::fs::File::create(filename)?;
-    params.write(buffer)?;
-    Ok(())
-}
-
-pub fn load_params(
-    filename: &str,
-) -> Result<(
-    groth16::Parameters<Bls12>,
-    groth16::PreparedVerifyingKey<Bls12>,
-)> {
-    let buffer = std::fs::File::open(filename)?;
-    let params = groth16::Parameters::<Bls12>::read(buffer, false)?;
-    let pvk = groth16::prepare_verifying_key(&params.vk);
-    Ok((params, pvk))
-}

+ 36 - 27
src/crypto/note.rs

@@ -1,27 +1,34 @@
+use std::io;
+
 use crypto_api_chachapoly::ChachaPolyIetf;
-use ff::Field;
+use pasta_curves::arithmetic::Field;
 use rand::rngs::OsRng;
-use std::io;
 
-use super::diffie_hellman::{kdf_sapling, sapling_ka_agree};
-use crate::error::{Error, Result};
-use crate::serial::{Decodable, Encodable, ReadExt, WriteExt};
+use super::{
+    diffie_hellman::{kdf_sapling, sapling_ka_agree},
+    util::mod_r_p,
+};
+use crate::{
+    serial::{Decodable, Encodable, ReadExt, WriteExt},
+    types::*,
+    Error, Result,
+};
 
 pub const NOTE_PLAINTEXT_SIZE: usize = 32 +    // serial
     8 +     // value
     32 +    // token_id
     32 +    // coin_blind
-    32; // valcom_blind
+    32; // value_blind
 pub const AEAD_TAG_SIZE: usize = 16;
 pub const ENC_CIPHERTEXT_SIZE: usize = NOTE_PLAINTEXT_SIZE + AEAD_TAG_SIZE;
 
 #[derive(Clone)]
 pub struct Note {
-    pub serial: jubjub::Fr,
+    pub serial: DrkSerial,
     pub value: u64,
-    pub token_id: jubjub::Fr,
-    pub coin_blind: jubjub::Fr,
-    pub valcom_blind: jubjub::Fr,
+    pub token_id: DrkTokenId,
+    pub coin_blind: DrkCoinBlind,
+    pub value_blind: DrkValueBlind,
 }
 
 impl Encodable for Note {
@@ -31,7 +38,7 @@ impl Encodable for Note {
         len += self.value.encode(&mut s)?;
         len += self.token_id.encode(&mut s)?;
         len += self.coin_blind.encode(&mut s)?;
-        len += self.valcom_blind.encode(&mut s)?;
+        len += self.value_blind.encode(&mut s)?;
         Ok(len)
     }
 }
@@ -43,17 +50,17 @@ impl Decodable for Note {
             value: Decodable::decode(&mut d)?,
             token_id: Decodable::decode(&mut d)?,
             coin_blind: Decodable::decode(&mut d)?,
-            valcom_blind: Decodable::decode(d)?,
+            value_blind: Decodable::decode(d)?,
         })
     }
 }
 
 impl Note {
-    pub fn encrypt(&self, public: &jubjub::SubgroupPoint) -> Result<EncryptedNote> {
-        let ephem_secret = jubjub::Fr::random(&mut OsRng);
-        let ephem_public = zcash_primitives::constants::SPENDING_KEY_GENERATOR * ephem_secret;
-        let shared_secret = sapling_ka_agree(&ephem_secret, public.into());
-        let key = kdf_sapling(shared_secret, &ephem_public.into());
+    pub fn encrypt(&self, public: &DrkPublicKey) -> Result<EncryptedNote> {
+        let ephem_secret = DrkSecretKey::random(&mut OsRng);
+        let ephem_public = derive_public_key(ephem_secret);
+        let shared_secret = sapling_ka_agree(&mod_r_p(ephem_secret), public);
+        let key = kdf_sapling(shared_secret, &ephem_public);
 
         let mut input = Vec::new();
         self.encode(&mut input)?;
@@ -75,7 +82,7 @@ impl Note {
 
 pub struct EncryptedNote {
     ciphertext: [u8; ENC_CIPHERTEXT_SIZE],
-    ephem_public: jubjub::SubgroupPoint,
+    ephem_public: DrkPublicKey,
 }
 
 impl Encodable for EncryptedNote {
@@ -100,9 +107,9 @@ impl Decodable for EncryptedNote {
 }
 
 impl EncryptedNote {
-    pub fn decrypt(&self, secret: &jubjub::Fr) -> Result<Note> {
-        let shared_secret = sapling_ka_agree(secret, &self.ephem_public.into());
-        let key = kdf_sapling(shared_secret, &self.ephem_public.into());
+    pub fn decrypt(&self, secret: &DrkSecretKey) -> Result<Note> {
+        let shared_secret = sapling_ka_agree(&mod_r_p(*secret), &self.ephem_public);
+        let key = kdf_sapling(shared_secret, &self.ephem_public);
 
         let mut plaintext = [0; ENC_CIPHERTEXT_SIZE];
         assert_eq!(
@@ -124,16 +131,18 @@ impl EncryptedNote {
 
 #[test]
 fn test_note_encdec() {
+    use crate::types::*;
+
     let note = Note {
-        serial: jubjub::Fr::random(&mut OsRng),
+        serial: DrkSerial::random(&mut OsRng),
         value: 110,
-        token_id: jubjub::Fr::random(&mut OsRng),
-        coin_blind: jubjub::Fr::random(&mut OsRng),
-        valcom_blind: jubjub::Fr::random(&mut OsRng),
+        token_id: DrkTokenId::random(&mut OsRng),
+        coin_blind: DrkCoinBlind::random(&mut OsRng),
+        value_blind: DrkValueBlind::random(&mut OsRng),
     };
 
-    let secret = jubjub::Fr::random(&mut OsRng);
-    let public = zcash_primitives::constants::SPENDING_KEY_GENERATOR * secret;
+    let secret = DrkSecretKey::random(&mut OsRng);
+    let public = derive_public_key(secret);
 
     let encrypted_note = note.encrypt(&public).unwrap();
     let note2 = encrypted_note.decrypt(&secret).unwrap();

+ 30 - 14
src/crypto/nullifier.rs

@@ -1,31 +1,47 @@
+Warning: can't set `wrap_comments = true`, unstable features are only available in nightly channel.
+Warning: can't set `comment_width = 100`, unstable features are only available in nightly channel.
+Warning: can't set `imports_granularity = Crate`, unstable features are only available in nightly channel.
+Warning: can't set `binop_separator = Back`, unstable features are only available in nightly channel.
+Warning: can't set `trailing_semicolon = false`, unstable features are only available in nightly channel.
+Warning: can't set `trailing_comma = Vertical`, unstable features are only available in nightly channel.
 use std::io;
 
+use pasta_curves::{arithmetic::FieldExt, pallas};
+
 use crate::{
-    error::Result,
-    serial::{Decodable, Encodable},
+    serial::{Decodable, Encodable, ReadExt, WriteExt},
+    Result,
 };
 
-#[derive(Debug, Clone, PartialEq)]
-pub struct Nullifier {
-    pub repr: [u8; 32],
-}
+#[derive(Clone, Copy, Debug, PartialEq)]
+pub struct Nullifier(pub(crate) pallas::Base);
 
 impl Nullifier {
-    pub fn new(repr: [u8; 32]) -> Self {
-        Self { repr }
+    pub fn from_bytes(bytes: &[u8; 32]) -> Self {
+        pallas::Base::from_bytes(bytes).map(Nullifier).unwrap()
+    }
+
+    pub fn to_bytes(self) -> [u8; 32] {
+        self.0.to_bytes()
+    }
+
+    pub(crate) fn inner(&self) -> pallas::Base {
+        self.0
     }
 }
 
 impl Encodable for Nullifier {
-    fn encode<S: io::Write>(&self, s: S) -> Result<usize> {
-        self.repr.encode(s)
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        s.write_slice(&self.to_bytes()[..])?;
+        Ok(32)
     }
 }
 
 impl Decodable for Nullifier {
-    fn decode<D: io::Read>(d: D) -> Result<Self> {
-        Ok(Self {
-            repr: Decodable::decode(d)?,
-        })
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let mut bytes = [0u8; 32];
+        d.read_slice(&mut bytes)?;
+        let result = Self::from_bytes(&bytes);
+        Ok(result)
     }
 }

+ 31 - 7
src/crypto/fr_serial.rs → src/crypto/pasta_serial.rs

@@ -1,17 +1,41 @@
-use group::GroupEncoding;
 use std::io;
 
-use crate::error::{Error, Result};
-use crate::serial::{Decodable, Encodable, ReadExt, WriteExt};
+use pasta_curves as pasta;
+use pasta_curves::{arithmetic::FieldExt, group::GroupEncoding};
 
-impl Encodable for jubjub::Fr {
+use crate::{
+    serial::{Decodable, Encodable, ReadExt, WriteExt},
+    Error, Result,
+};
+
+impl Encodable for pasta::Fp {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        s.write_slice(&self.to_bytes()[..])?;
+        Ok(32)
+    }
+}
+
+impl Decodable for pasta::Fp {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let mut bytes = [0u8; 32];
+        d.read_slice(&mut bytes)?;
+        let result = Self::from_bytes(&bytes);
+        if result.is_some().into() {
+            Ok(result.unwrap())
+        } else {
+            Err(Error::BadOperationType)
+        }
+    }
+}
+
+impl Encodable for pasta::Fq {
     fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
         s.write_slice(&self.to_bytes()[..])?;
         Ok(32)
     }
 }
 
-impl Decodable for jubjub::Fr {
+impl Decodable for pasta::Fq {
     fn decode<D: io::Read>(mut d: D) -> Result<Self> {
         let mut bytes = [0u8; 32];
         d.read_slice(&mut bytes)?;
@@ -24,14 +48,14 @@ impl Decodable for jubjub::Fr {
     }
 }
 
-impl Encodable for jubjub::SubgroupPoint {
+impl Encodable for pasta::Ep {
     fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
         s.write_slice(&self.to_bytes()[..])?;
         Ok(32)
     }
 }
 
-impl Decodable for jubjub::SubgroupPoint {
+impl Decodable for pasta::Ep {
     fn decode<D: io::Read>(mut d: D) -> Result<Self> {
         let mut bytes = [0u8; 32];
         d.read_slice(&mut bytes)?;

+ 109 - 0
src/crypto/proof.rs

@@ -0,0 +1,109 @@
+use std::io;
+
+// TODO: Alias vesta::Affine to something
+use halo2::{
+    plonk,
+    plonk::Circuit,
+    poly::commitment,
+    transcript::{Blake2bRead, Blake2bWrite},
+};
+use pasta_curves::vesta;
+
+use crate::serial::{Decodable, Encodable, ReadExt, VarInt, WriteExt};
+use crate::types::*;
+use crate::Result;
+
+#[derive(Debug)]
+pub struct VerifyingKey {
+    pub params: commitment::Params<vesta::Affine>,
+    pub vk: plonk::VerifyingKey<vesta::Affine>,
+}
+
+impl VerifyingKey {
+    pub fn build(k: u32, c: impl Circuit<DrkCircuitField>) -> Self {
+        let params = commitment::Params::new(k);
+        let vk = plonk::keygen_vk(&params, &c).unwrap();
+        VerifyingKey { params, vk }
+    }
+}
+
+#[derive(Debug)]
+pub struct ProvingKey {
+    pub params: commitment::Params<vesta::Affine>,
+    pub pk: plonk::ProvingKey<vesta::Affine>,
+}
+
+impl ProvingKey {
+    pub fn build(k: u32, c: impl Circuit<DrkCircuitField>) -> Self {
+        let params = commitment::Params::new(k);
+        let vk = plonk::keygen_vk(&params, &c).unwrap();
+        let pk = plonk::keygen_pk(&params, vk, &c).unwrap();
+        ProvingKey { params, pk }
+    }
+}
+
+#[derive(Clone, Debug)]
+pub struct Proof(Vec<u8>);
+
+impl AsRef<[u8]> for Proof {
+    fn as_ref(&self) -> &[u8] {
+        &self.0
+    }
+}
+
+impl Proof {
+    pub fn create(
+        pk: &ProvingKey,
+        circuits: &[impl Circuit<DrkCircuitField>],
+        pubinputs: &[DrkCircuitField],
+    ) -> std::result::Result<Self, plonk::Error> {
+        let mut transcript = Blake2bWrite::<_, vesta::Affine, _>::init(vec![]);
+
+        plonk::create_proof(
+            &pk.params,
+            &pk.pk,
+            circuits,
+            &[&[pubinputs]],
+            &mut transcript,
+        )?;
+
+        Ok(Proof(transcript.finalize()))
+    }
+
+    pub fn verify(
+        &self,
+        vk: &VerifyingKey,
+        pubinputs: &[DrkCircuitField],
+    ) -> std::result::Result<(), plonk::Error> {
+        let msm = vk.params.empty_msm();
+        let mut transcript = Blake2bRead::init(&self.0[..]);
+        let guard = plonk::verify_proof(&vk.params, &vk.vk, msm, &[&[pubinputs]], &mut transcript)?;
+        let msm = guard.clone().use_challenges();
+
+        if msm.eval() {
+            Ok(())
+        } else {
+            Err(plonk::Error::ConstraintSystemFailure)
+        }
+    }
+
+    pub fn new(bytes: Vec<u8>) -> Self {
+        Proof(bytes)
+    }
+}
+
+impl Encodable for Proof {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        s.write_slice(self.as_ref())?;
+        Ok(self.as_ref().len())
+    }
+}
+
+impl Decodable for Proof {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        let len = VarInt::decode(&mut d)?.0 as usize;
+        let mut r = vec![0u8; len];
+        d.read_slice(&mut r)?;
+        Ok(Proof::new(r))
+    }
+}

+ 42 - 20
src/crypto/schnorr.rs

@@ -1,41 +1,52 @@
-use ff::Field;
-use group::GroupEncoding;
-use rand::rngs::OsRng;
 use std::io;
 
-use super::util::hash_to_scalar;
-use crate::error::Result;
-use crate::serial::{Decodable, Encodable};
+use halo2_gadgets::ecc::FixedPoints;
+use pasta_curves::{arithmetic::Field, group::GroupEncoding, pallas};
+use rand::rngs::OsRng;
+
+use super::{
+    constants::{OrchardFixedBases, DRK_SCHNORR_DOMAIN},
+    util::{hash_to_scalar, mod_r_p},
+};
+use crate::{
+    error::Result,
+    serial::{Decodable, Encodable},
+    types::{
+        derive_public_key, DrkCoinBlind, DrkPublicKey, DrkSecretKey, DrkSerial, DrkTokenId,
+        DrkValueBlind, DrkValueCommit,
+    },
+};
 
-pub struct SecretKey(pub jubjub::Fr);
+#[derive(Clone)]
+pub struct SecretKey(pub pallas::Scalar);
 
 impl SecretKey {
     pub fn random() -> Self {
-        Self(jubjub::Fr::random(&mut OsRng))
+        Self(pallas::Scalar::random(&mut OsRng))
     }
 
     pub fn sign(&self, message: &[u8]) -> Signature {
-        let mask = jubjub::Fr::random(&mut OsRng);
-        let commit = zcash_primitives::constants::SPENDING_KEY_GENERATOR * mask;
-
-        let challenge = hash_to_scalar(b"DarkFi_Schnorr", &commit.to_bytes(), message);
+        let mask = DrkValueBlind::random(&mut OsRng);
+        let commit = OrchardFixedBases::SpendAuthG.generator() * mask;
 
+        let challenge = hash_to_scalar(DRK_SCHNORR_DOMAIN, &commit.to_bytes(), message);
         let response = mask + challenge * self.0;
 
         Signature { commit, response }
     }
 
     pub fn public_key(&self) -> PublicKey {
-        let public = zcash_primitives::constants::SPENDING_KEY_GENERATOR * self.0;
-        PublicKey(public)
+        let public_key = OrchardFixedBases::SpendAuthG.generator() * self.0;
+        PublicKey(public_key)
     }
 }
 
-pub struct PublicKey(pub jubjub::SubgroupPoint);
+#[derive(PartialEq)]
+pub struct PublicKey(pub DrkPublicKey);
 
 pub struct Signature {
-    commit: jubjub::SubgroupPoint,
-    response: jubjub::Fr,
+    commit: DrkValueCommit,
+    response: DrkValueBlind,
 }
 
 impl Encodable for Signature {
@@ -58,13 +69,24 @@ impl Decodable for Signature {
 
 impl PublicKey {
     pub fn verify(&self, message: &[u8], signature: &Signature) -> bool {
-        let challenge = hash_to_scalar(b"DarkFi_Schnorr", &signature.commit.to_bytes(), message);
-        zcash_primitives::constants::SPENDING_KEY_GENERATOR * signature.response
-            - self.0 * challenge
+        let challenge = hash_to_scalar(DRK_SCHNORR_DOMAIN, &signature.commit.to_bytes(), message);
+        OrchardFixedBases::SpendAuthG.generator() * signature.response - self.0 * challenge
             == signature.commit
     }
 }
 
+impl Encodable for PublicKey {
+    fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+        Ok(self.0.encode(s)?)
+    }
+}
+
+impl Decodable for PublicKey {
+    fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+        Ok(Self(Decodable::decode(&mut d)?))
+    }
+}
+
 #[test]
 fn test_schnorr() {
     let secret = SecretKey::random();

+ 136 - 223
src/crypto/spend_proof.rs

@@ -1,176 +1,114 @@
-use bellman::gadgets::multipack;
-use bellman::groth16;
-use blake2s_simd::Params as Blake2sParams;
-use bls12_381::Bls12;
-use ff::PrimeField;
-use group::{Curve, GroupEncoding};
-use rand::rngs::OsRng;
 use std::io;
 use std::time::Instant;
 
-use super::merkle_node::{merkle_hash, MerkleNode, SAPLING_COMMITMENT_TREE_DEPTH};
-use super::nullifier::Nullifier;
-use crate::circuit::spend_contract::SpendContract;
-use crate::error::Result;
-use crate::serial::{Decodable, Encodable};
+use halo2_gadgets::{
+    primitives,
+    primitives::poseidon::{ConstantLength, P128Pow5T3},
+};
+use incrementalmerkletree::Hashable;
+use log::debug;
+use pasta_curves::{
+    arithmetic::{CurveAffine, FieldExt},
+    group::Curve,
+    pallas,
+};
+
+use super::{
+    nullifier::Nullifier,
+    proof::{Proof, ProvingKey, VerifyingKey},
+    util::{mod_r_p, pedersen_commitment_scalar, pedersen_commitment_u64},
+};
+use crate::{
+    circuit::spend_contract::SpendContract,
+    crypto::{merkle_node2::MerkleNode, schnorr},
+    serial::{Decodable, Encodable},
+    types::*,
+    Result,
+};
 
 pub struct SpendRevealedValues {
-    pub value_commit: jubjub::SubgroupPoint,
-    pub token_commit: jubjub::SubgroupPoint,
+    pub value_commit: DrkValueCommit,
+    pub token_commit: DrkValueCommit,
     pub nullifier: Nullifier,
-    // This should not be here, we just have it for debugging
-    //coin: [u8; 32],
     pub merkle_root: MerkleNode,
-    pub signature_public: jubjub::SubgroupPoint,
+    pub signature_public: schnorr::PublicKey,
 }
 
 impl SpendRevealedValues {
     #[allow(clippy::too_many_arguments)]
     fn compute(
         value: u64,
-        token_id: jubjub::Fr,
-        randomness_value: &jubjub::Fr,
-        randomness_token: &jubjub::Fr,
-        serial: &jubjub::Fr,
-        randomness_coin: &jubjub::Fr,
-        secret: &jubjub::Fr,
-        merkle_path: &[(bls12_381::Scalar, bool)],
-        signature_secret: &jubjub::Fr,
+        token_id: DrkTokenId,
+        value_blind: DrkValueBlind,
+        token_blind: DrkValueBlind,
+        serial: DrkSerial,
+        coin_blind: DrkCoinBlind,
+        secret: DrkSecretKey,
+        leaf_position: incrementalmerkletree::Position,
+        merkle_path: Vec<MerkleNode>,
+        signature_secret: schnorr::SecretKey,
     ) -> Self {
-        let value_commit = (zcash_primitives::constants::VALUE_COMMITMENT_VALUE_GENERATOR
-            * jubjub::Fr::from(value))
-            + (zcash_primitives::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR
-                * randomness_value);
-
-        let token_commit = (zcash_primitives::constants::VALUE_COMMITMENT_VALUE_GENERATOR
-            * token_id)
-            + (zcash_primitives::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR
-                * randomness_token);
-
-        let mut nullifier = [0; 32];
-        nullifier.copy_from_slice(
-            Blake2sParams::new()
-                .hash_length(32)
-                .personal(zcash_primitives::constants::PRF_NF_PERSONALIZATION)
-                .to_state()
-                .update(&secret.to_bytes())
-                .update(&serial.to_bytes())
-                .finalize()
-                .as_bytes(),
-        );
-        let nullifier = Nullifier::new(nullifier);
-
-        let public = zcash_primitives::constants::SPENDING_KEY_GENERATOR * secret;
-        let signature_public =
-            zcash_primitives::constants::SPENDING_KEY_GENERATOR * signature_secret;
-
-        let mut coin = [0; 32];
-        coin.copy_from_slice(
-            Blake2sParams::new()
-                .hash_length(32)
-                .personal(zcash_primitives::constants::CRH_IVK_PERSONALIZATION)
-                .to_state()
-                .update(&public.to_bytes())
-                .update(&value.to_le_bytes())
-                .update(&token_id.to_bytes())
-                .update(&serial.to_bytes())
-                .update(&randomness_coin.to_bytes())
-                .finalize()
-                .as_bytes(),
-        );
-
-        let merkle_root =
-            jubjub::ExtendedPoint::from(zcash_primitives::pedersen_hash::pedersen_hash(
-                zcash_primitives::pedersen_hash::Personalization::NoteCommitment,
-                multipack::bytes_to_bits_le(&coin),
-            ));
-        let affine = merkle_root.to_affine();
-        let mut merkle_root = affine.get_u();
+        let nullifier = [secret, serial];
+        let nullifier =
+            primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(nullifier);
+
+        let public_key = derive_public_key(secret);
+        let coords = public_key.to_affine().coordinates().unwrap();
+        let messages = [
+            [*coords.x(), *coords.y()],
+            [DrkValue::from_u64(value), token_id],
+            [serial, coin_blind],
+        ];
+
+        let mut coin = DrkCoin::zero();
+        for msg in messages.iter() {
+            coin += primitives::poseidon::Hash::init(P128Pow5T3, ConstantLength::<2>).hash(*msg);
+        }
 
-        for (i, (right, is_right)) in merkle_path.iter().enumerate() {
-            if *is_right {
-                merkle_root = merkle_hash(i, &right.to_repr(), &merkle_root.to_repr());
-            } else {
-                merkle_root = merkle_hash(i, &merkle_root.to_repr(), &right.to_repr());
+        let merkle_root = {
+            let position: u64 = leaf_position.into();
+            let mut current = MerkleNode(coin);
+            for (level, sibling) in merkle_path.iter().enumerate() {
+                let level = level as u8;
+                current = if position & (1 << level) == 0 {
+                    MerkleNode::combine(level.into(), &current, sibling)
+                } else {
+                    MerkleNode::combine(level.into(), sibling, &current)
+                };
             }
-        }
+            current
+        };
 
-        let merkle_root = MerkleNode::new(merkle_root.to_repr());
+        let value_commit = pedersen_commitment_u64(value, value_blind);
+        let token_commit = pedersen_commitment_scalar(mod_r_p(token_id), token_blind);
 
         SpendRevealedValues {
             value_commit,
             token_commit,
-            nullifier,
+            nullifier: Nullifier(nullifier),
             merkle_root,
-            signature_public,
+            signature_public: signature_secret.public_key(),
         }
     }
 
-    fn make_outputs(&self) -> [bls12_381::Scalar; 9] {
-        let mut public_input = [bls12_381::Scalar::zero(); 9];
-
-        // CV
-        {
-            let result = jubjub::ExtendedPoint::from(self.value_commit);
-            let affine = result.to_affine();
-            //let (u, v) = (affine.get_u(), affine.get_v());
-            let u = affine.get_u();
-            let v = affine.get_v();
-            public_input[0] = u;
-            public_input[1] = v;
-        }
-
-        // CA
-        {
-            let result = jubjub::ExtendedPoint::from(self.token_commit);
-            let affine = result.to_affine();
-            //let (u, v) = (affine.get_u(), affine.get_v());
-            let u = affine.get_u();
-            let v = affine.get_v();
-            public_input[2] = u;
-            public_input[3] = v;
-        }
-
-        // NF
-        {
-            // Pack the hash as inputs for proof verification.
-            let hash = multipack::bytes_to_bits_le(&self.nullifier.repr);
-            let hash = multipack::compute_multipacking(&hash);
-
-            // There are 2 chunks for a blake hash
-            assert_eq!(hash.len(), 2);
-
-            public_input[4] = hash[0];
-            public_input[5] = hash[1];
-        }
-
-        // Not revealed. We leave this code here for debug
-        // Coin
-        /*{
-            // Pack the hash as inputs for proof verification.
-            let hash = multipack::bytes_to_bits_le(&self.coin);
-            let hash = multipack::compute_multipacking(&hash);
-
-            // There are 2 chunks for a blake hash
-            assert_eq!(hash.len(), 2);
-
-            public_input[4] = hash[0];
-            public_input[5] = hash[1];
-        }*/
-
-        public_input[6] = self.merkle_root.into();
-
-        {
-            let result = jubjub::ExtendedPoint::from(self.signature_public);
-            let affine = result.to_affine();
-            //let (u, v) = (affine.get_u(), affine.get_v());
-            let u = affine.get_u();
-            let v = affine.get_v();
-            public_input[7] = u;
-            public_input[8] = v;
-        }
-
-        public_input
+    fn make_outputs(&self) -> [DrkCircuitField; 8] {
+        let value_coords = self.value_commit.to_affine().coordinates().unwrap();
+        let token_coords = self.token_commit.to_affine().coordinates().unwrap();
+        let merkle_root = self.merkle_root.0;
+        let sig_coords = self.signature_public.0.to_affine().coordinates().unwrap();
+
+        vec![
+            self.nullifier.inner(),
+            *value_coords.x(),
+            *value_coords.y(),
+            *token_coords.x(),
+            *token_coords.y(),
+            merkle_root,
+            *sig_coords.x(),
+            *sig_coords.y(),
+        ]
+        .try_into()
+        .unwrap()
     }
 }
 
@@ -198,93 +136,68 @@ impl Decodable for SpendRevealedValues {
     }
 }
 
-pub fn setup_spend_prover() -> groth16::Parameters<Bls12> {
-    println!("Spend: Making random params...");
-    let start = Instant::now();
-    let params = {
-        let c = SpendContract {
-            value: None,
-            token_id: None,
-            randomness_value: None,
-            randomness_token: None,
-            serial: None,
-            randomness_coin: None,
-            secret: None,
-
-            branch: [None; SAPLING_COMMITMENT_TREE_DEPTH],
-            is_right: [None; SAPLING_COMMITMENT_TREE_DEPTH],
-
-            signature_secret: None,
-        };
-        groth16::generate_random_parameters::<Bls12, _, _>(c, &mut OsRng).unwrap()
-    };
-    println!("Setup: [{:?}]", start.elapsed());
-    params
-}
-
 #[allow(clippy::too_many_arguments)]
 pub fn create_spend_proof(
-    params: &groth16::Parameters<Bls12>,
     value: u64,
-    token_id: jubjub::Fr,
-    randomness_value: jubjub::Fr,
-    randomness_token: jubjub::Fr,
-    serial: jubjub::Fr,
-    randomness_coin: jubjub::Fr,
-    secret: jubjub::Fr,
-    merkle_path: Vec<(bls12_381::Scalar, bool)>,
-    signature_secret: jubjub::Fr,
-) -> (groth16::Proof<Bls12>, SpendRevealedValues) {
-    assert_eq!(merkle_path.len(), SAPLING_COMMITMENT_TREE_DEPTH);
-    let mut branch: [_; SAPLING_COMMITMENT_TREE_DEPTH] = Default::default();
-    let mut is_right: [_; SAPLING_COMMITMENT_TREE_DEPTH] = Default::default();
-    for (i, (branch_i, is_right_i)) in merkle_path.iter().enumerate() {
-        branch[i] = Some(*branch_i);
-        is_right[i] = Some(*is_right_i);
-    }
-    let c = SpendContract {
-        value: Some(value),
-        token_id: Some(token_id),
-        randomness_value: Some(randomness_value),
-        randomness_token: Some(randomness_token),
-        serial: Some(serial),
-        randomness_coin: Some(randomness_coin),
-        secret: Some(secret),
+    token_id: DrkTokenId,
+    value_blind: DrkValueBlind,
+    token_blind: DrkValueBlind,
+    serial: DrkSerial,
+    coin_blind: DrkCoinBlind,
+    secret: DrkSecretKey,
+    leaf_position: incrementalmerkletree::Position,
+    merkle_path: Vec<MerkleNode>,
+    signature_secret: schnorr::SecretKey,
+) -> Result<(Proof, SpendRevealedValues)> {
+    const K: u32 = 11;
+
+    let revealed = SpendRevealedValues::compute(
+        value,
+        token_id,
+        value_blind,
+        token_blind,
+        serial,
+        coin_blind,
+        secret,
+        leaf_position,
+        merkle_path.clone(),
+        signature_secret.clone(),
+    );
 
-        branch,
-        is_right,
+    let merkle_path: Vec<pallas::Base> = merkle_path.iter().map(|node| node.0).collect();
+    let leaf_position: u64 = leaf_position.into();
 
-        signature_secret: Some(signature_secret),
+    let c = SpendContract {
+        secret_key: Some(secret),
+        serial: Some(serial),
+        value: Some(DrkValue::from_u64(value)),
+        asset: Some(token_id),
+        coin_blind: Some(coin_blind),
+        value_blind: Some(value_blind),
+        asset_blind: Some(token_blind),
+        leaf_pos: Some(leaf_position as u32),
+        merkle_path: Some(merkle_path.try_into().unwrap()),
+        sig_secret: Some(signature_secret.0),
     };
 
     let start = Instant::now();
-    let proof = groth16::create_random_proof(c, params, &mut OsRng).unwrap();
-    println!("Prove: [{:?}]", start.elapsed());
+    // TODO: Don't always build this
+    let pk = ProvingKey::build(K, SpendContract::default());
+    debug!("Setup: [{:?}]", start.elapsed());
 
-    let revealed = SpendRevealedValues::compute(
-        value,
-        token_id,
-        &randomness_value,
-        &randomness_token,
-        &serial,
-        &randomness_coin,
-        &secret,
-        &merkle_path,
-        &signature_secret,
-    );
+    let start = Instant::now();
+    let public_inputs = revealed.make_outputs();
+    let proof = Proof::create(&pk, &[c], &public_inputs)?;
+    debug!("Prove: [{:?}]", start.elapsed());
 
-    (proof, revealed)
+    Ok((proof, revealed))
 }
 
 pub fn verify_spend_proof(
-    pvk: &groth16::PreparedVerifyingKey<Bls12>,
-    proof: &groth16::Proof<Bls12>,
+    vk: &VerifyingKey,
+    proof: Proof,
     revealed: &SpendRevealedValues,
-) -> bool {
-    let public_input = revealed.make_outputs();
-
-    let start = Instant::now();
-    let result = groth16::verify_proof(pvk, proof, &public_input).is_ok();
-    println!("Verify: [{:?}]", start.elapsed());
-    result
+) -> Result<()> {
+    let public_inputs = revealed.make_outputs();
+    Ok(proof.verify(vk, &public_inputs)?)
 }

+ 33 - 2
src/crypto/util.rs

@@ -1,9 +1,40 @@
 use blake2b_simd::Params;
+use pasta_curves::{
+    arithmetic::{CurveExt, FieldExt},
+    group::ff::PrimeField,
+    pallas,
+};
 
-pub fn hash_to_scalar(persona: &[u8], a: &[u8], b: &[u8]) -> jubjub::Fr {
+use super::constants::fixed_bases::{
+    VALUE_COMMITMENT_PERSONALIZATION, VALUE_COMMITMENT_R_BYTES, VALUE_COMMITMENT_V_BYTES,
+};
+use crate::types::*;
+
+pub fn hash_to_scalar(persona: &[u8], a: &[u8], b: &[u8]) -> DrkScalar {
     let mut hasher = Params::new().hash_length(64).personal(persona).to_state();
     hasher.update(a);
     hasher.update(b);
     let ret = hasher.finalize();
-    jubjub::Fr::from_bytes_wide(ret.as_array())
+    DrkScalar::from_bytes_wide(ret.as_array())
+}
+
+#[allow(non_snake_case)]
+pub fn pedersen_commitment_scalar(value: DrkScalar, blind: DrkValueBlind) -> DrkValueCommit {
+    let hasher = DrkValueCommit::hash_to_curve(VALUE_COMMITMENT_PERSONALIZATION);
+    let V = hasher(&VALUE_COMMITMENT_V_BYTES);
+    let R = hasher(&VALUE_COMMITMENT_R_BYTES);
+
+    V * value + R * blind
+}
+
+pub fn pedersen_commitment_u64(value: u64, blind: DrkValueBlind) -> DrkValueCommit {
+    pedersen_commitment_scalar(mod_r_p(DrkValue::from_u64(value)), blind)
+}
+
+/// Converts from pallas::Base to pallas::Scalar (aka $x \pmod{r_\mathbb{P}}$).
+///
+/// This requires no modular reduction because Pallas' base field is smaller than its
+/// scalar field.
+pub fn mod_r_p(x: pallas::Base) -> pallas::Scalar {
+    pallas::Scalar::from_repr(x.to_repr()).unwrap()
 }

+ 224 - 110
src/error.rs

@@ -1,154 +1,169 @@
+use std::fmt;
+
 use crate::client;
 use crate::state;
-use crate::vm::ZkVmError;
 
 pub type Result<T> = std::result::Result<T, Error>;
 
-#[derive(Debug, Clone, thiserror::Error)]
+#[derive(Debug, Clone)]
 pub enum Error {
-    #[error("io error: `{0:?}`")]
     Io(std::io::ErrorKind),
 
-    #[error("Cannot find home directory")]
-    PathNotFound,
     /// VarInt was encoded in a non-minimal way
-    #[error("non-minimal varint")]
+    PathNotFound,
     NonMinimalVarInt,
 
     /// Parsing And Encode/Decode errors
-    #[error("parse failed: `{0}`")]
     ParseFailed(&'static str),
-    #[error(transparent)]
-    ParseIntError(#[from] std::num::ParseIntError),
-    #[error(transparent)]
-    ParseBigIntError(#[from] num_bigint::ParseBigIntError),
-    #[error(transparent)]
-    ParseFloatError(#[from] std::num::ParseFloatError),
-    #[error(transparent)]
-    FromHexError(#[from] hex::FromHexError),
-    #[error("Url parse erro `{0}`")]
-    UrlParseError(String),
-    #[error("No url found")]
-    NoUrlFound,
-    #[error("Malformed packet")]
+    ParseIntError,
+    ParseBigIntError,
+    ParseFloatError,
+    FromHexError,
+    UrlParseError,
     MalformedPacket,
-    #[error(transparent)]
-    AddrParseError(#[from] std::net::AddrParseError),
-    #[error(transparent)]
-    Base58EncodeError(#[from] bs58::encode::Error),
-    #[error(transparent)]
-    Base58DecodeError(#[from] bs58::decode::Error),
-    #[error(transparent)]
-    Utf8Error(#[from] std::string::FromUtf8Error),
-    #[error(transparent)]
-    StrUtf8Error(#[from] std::str::Utf8Error),
-    #[error("TryInto error")]
+    AddrParseError,
+    Base58EncodeError(String),
+    Base58DecodeError(String),
+    Utf8Error,
+    StrUtf8Error(String),
     TryIntoError,
-    #[error("TryFrom error")]
     TryFromError,
-    #[error(transparent)]
-    TryFromBigIntError(#[from] num_bigint::TryFromBigIntError<num_bigint::BigUint>),
-    #[error("Json serialization error: `{0}`")]
+    TryFromBigIntError,
     SerdeJsonError(String),
-    #[error(transparent)]
-    TomlDeserializeError(#[from] toml::de::Error),
-    #[error(transparent)]
-    TomlSerializeError(#[from] toml::ser::Error),
+    TomlDeserializeError(String),
+    TomlSerializeError(String),
 
     /// Contract
-    #[error("Bad variable ref type byte")]
     BadVariableRefType,
-    #[error("Bad operation type byte")]
     BadOperationType,
-    #[error("Bad constraint type byte")]
     BadConstraintType,
-    #[error("Invalid param name")]
     InvalidParamName,
-    #[error("Missing params")]
+    InvalidParamType,
     MissingParams,
-    #[error(transparent)]
-    VmError(#[from] ZkVmError),
-    #[error("Contract is poorly defined")]
+    VmError,
     BadContract,
-    #[error("Groth16 Error: `{0}`")]
-    Groth16Error(String),
-    #[error("Operation failed")]
+    Groth16Error,
+    PlonkError,
     OperationFailed,
-    #[error("Unable to decrypt mint note")]
     NoteDecryptionFailed,
-    #[error(transparent)]
-    VerifyFailed(#[from] state::VerifyFailed),
-    #[error("MerkleTree is full")]
+    VerifyFailed,
     TreeFull,
 
     /// Service
-    #[error("Services Error: `{0}`")]
     ServicesError(&'static str),
-    #[error("Client failed: `{0}`")]
     ClientFailed(String),
     #[cfg(feature = "btc")]
-    #[error(transparent)]
-    BtcFailed(#[from] crate::service::BtcFailed),
+    BtcFailed(String),
     #[cfg(feature = "sol")]
-    #[error("Sol client failed: `{0}`")]
     SolFailed(String),
     #[cfg(feature = "eth")]
-    #[error(transparent)]
-    EthFailed(#[from] crate::service::EthFailed),
-    #[error("BridgeError Error: `{0}`")]
+    EthFailed(String),
     BridgeError(String),
-    #[error("ZmqError: `{0}`")]
     ZmqError(String),
 
     /// Database/Sql errors
-    #[error("Rocksdb error: `{0}`")]
     RocksdbError(String),
-    #[error("Rusqlite error: `{0}`")]
     RusqliteError(String),
-    #[error("SlabsStore Error: `{0}`")]
     SlabsStore(String),
 
     /// RPC errors
-    #[error("JsonRpc Error: `{0}`")]
     JsonRpcError(String),
-    #[error("Not supported network")]
     NotSupportedNetwork,
-    #[error("Not supported token")]
     NotSupportedToken,
-    #[error("Could not parse token parameter")]
     TokenParseError,
-    #[error("Cannot parse network parameter")]
     NetworkParseError,
-    #[error("Async_Native_TLS error: `{0}`")]
-    AsyncNativeTlsError(String),
-    #[error("TungsteniteError: `{0}`")]
-    TungsteniteError(String),
+    AsyncNativeTlsError,
+    TungsteniteError,
 
     /// Network
-    #[error("Connection failed")]
     ConnectFailed,
-    #[error("Connection timed out")]
     ConnectTimeout,
-    #[error("Channel stopped")]
     ChannelStopped,
-    #[error("Channel timed out")]
     ChannelTimeout,
-    #[error("Service stopped")]
     ServiceStopped,
 
     /// Util
-    #[error("No config file detected. Please create one.")]
     ConfigNotFound,
-    #[error("No keypair file detected.")]
     KeypairPathNotFound,
-    #[error("No cashier public keys detected.")]
     CashierKeysNotFound,
-    #[error("SetLoggerError")]
     SetLoggerError,
-    #[error("Async_channel sender error")]
     AsyncChannelSenderError,
-    #[error(transparent)]
-    AsyncChannelReceiverError(#[from] async_channel::RecvError),
+    AsyncChannelReceiverError,
+}
+
+impl std::error::Error for Error {}
+
+impl fmt::Display for Error {
+    fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result {
+        match *self {
+            Error::PathNotFound => f.write_str("Cannot find home directory"),
+            Error::Io(ref err) => write!(f, "io error:{:?}", err),
+            Error::NonMinimalVarInt => f.write_str("non-minimal varint"),
+            Error::ParseFailed(ref err) => write!(f, "parse failed: {}", err),
+            Error::ParseIntError => f.write_str("Parse int error"),
+            Error::ParseBigIntError => f.write_str("Parse big int error"),
+            Error::ParseFloatError => f.write_str("Parse float error"),
+            Error::UrlParseError => f.write_str("Failed to parse URL"),
+            Error::FromHexError => f.write_str("Failed to convert from hex"),
+            Error::AsyncChannelSenderError => f.write_str("Async_channel sender error"),
+            Error::AsyncChannelReceiverError => f.write_str("Async_channel receiver error"),
+            Error::AsyncNativeTlsError => f.write_str("Async_Native_TLS error"),
+            Error::MalformedPacket => f.write_str("Malformed packet"),
+            Error::AddrParseError => f.write_str("Unable to parse address"),
+            Error::BadVariableRefType => f.write_str("Bad variable ref type byte"),
+            Error::BadOperationType => f.write_str("Bad operation type byte"),
+            Error::BadConstraintType => f.write_str("Bad constraint type byte"),
+            Error::InvalidParamName => f.write_str("Invalid param name"),
+            Error::InvalidParamType => f.write_str("Invalid param type"),
+            Error::MissingParams => f.write_str("Missing params"),
+            Error::VmError => f.write_str("VM error"),
+            Error::BadContract => f.write_str("Contract is poorly defined"),
+            Error::Groth16Error => f.write_str("Groth16 error"),
+            Error::PlonkError => f.write_str("Plonk error"),
+            Error::RusqliteError(ref err) => write!(f, "Rusqlite error {}", err),
+            Error::OperationFailed => f.write_str("Operation failed"),
+            Error::ConnectFailed => f.write_str("Connection failed"),
+            Error::ConnectTimeout => f.write_str("Connection timed out"),
+            Error::ChannelStopped => f.write_str("Channel stopped"),
+            Error::ChannelTimeout => f.write_str("Channel timed out"),
+            Error::ServiceStopped => f.write_str("Service stopped"),
+            Error::Utf8Error => f.write_str("Malformed UTF8"),
+            Error::StrUtf8Error(ref err) => write!(f, "Malformed UTF8: {}", err),
+            Error::NoteDecryptionFailed => f.write_str("Unable to decrypt mint note"),
+            Error::ServicesError(ref err) => write!(f, "Services error: {}", err),
+            Error::ZmqError(ref err) => write!(f, "ZmqError: {}", err),
+            Error::VerifyFailed => f.write_str("Verify failed"),
+            Error::ClientFailed(ref err) => write!(f, "Client failed: {}", err),
+            #[cfg(feature = "btc")]
+            Error::BtcFailed(ref err) => write!(f, "Btc client failed: {}", err),
+            #[cfg(feature = "sol")]
+            Error::SolFailed(ref err) => write!(f, "Sol client failed: {}", err),
+            #[cfg(feature = "eth")]
+            Error::EthFailed(ref err) => write!(f, "Eth client failed: {}", err),
+            Error::TryIntoError => f.write_str("TryInto error"),
+            Error::TryFromError => f.write_str("TryFrom error"),
+            Error::TryFromBigIntError => f.write_str("TryFromBigInt error"),
+            Error::RocksdbError(ref err) => write!(f, "Rocksdb Error: {}", err),
+            Error::SlabsStore(ref err) => write!(f, "SlabsStore Error: {}", err),
+            Error::JsonRpcError(ref err) => write!(f, "JsonRpc Error: {}", err),
+            Error::TreeFull => f.write_str("MerkleTree is full"),
+            Error::NotSupportedNetwork => f.write_str("Not supported network"),
+            Error::NotSupportedToken => f.write_str("Not supported token"),
+            Error::BridgeError(ref err) => write!(f, "Bridge error: {}", err),
+            Error::SerdeJsonError(ref err) => write!(f, "Json serialization error: {}", err),
+            Error::TomlDeserializeError(ref err) => write!(f, "Toml parsing error: {}", err),
+            Error::TomlSerializeError(ref err) => write!(f, "Toml parsing error: {}", err),
+            Error::Base58EncodeError(ref err) => write!(f, "bs58 encode error: {}", err),
+            Error::Base58DecodeError(ref err) => write!(f, "bs58 decode error: {}", err),
+            Error::ConfigNotFound => f.write_str("No config file detected. Please create one."),
+            Error::KeypairPathNotFound => f.write_str("No keypair file detected."),
+            Error::CashierKeysNotFound => f.write_str("No cashier public keys detected."),
+            Error::SetLoggerError => f.write_str("SetLoggerError"),
+            Error::TokenParseError => f.write_str("Could not parse token parameter"),
+            Error::TungsteniteError => f.write_str("TungsteniteError"),
+            Error::NetworkParseError => f.write_str("Cannot parse network parameter"),
+        }
+    }
 }
 
 impl From<zeromq::ZmqError> for Error {
@@ -163,12 +178,6 @@ impl From<rocksdb::Error> for Error {
     }
 }
 
-impl From<rusqlite::Error> for Error {
-    fn from(err: rusqlite::Error) -> Error {
-        Error::RusqliteError(err.to_string())
-    }
-}
-
 impl From<serde_json::Error> for Error {
     fn from(err: serde_json::Error) -> Error {
         Error::SerdeJsonError(err.to_string())
@@ -181,9 +190,9 @@ impl From<std::io::Error> for Error {
     }
 }
 
-impl From<client::ClientFailed> for Error {
-    fn from(err: client::ClientFailed) -> Error {
-        Error::ClientFailed(err.to_string())
+impl From<rusqlite::Error> for Error {
+    fn from(err: rusqlite::Error) -> Error {
+        Error::RusqliteError(err.to_string())
     }
 }
 
@@ -193,26 +202,88 @@ impl<T> From<async_channel::SendError<T>> for Error {
     }
 }
 
-impl From<log::SetLoggerError> for Error {
-    fn from(_err: log::SetLoggerError) -> Error {
-        Error::SetLoggerError
+impl From<async_channel::RecvError> for Error {
+    fn from(_err: async_channel::RecvError) -> Error {
+        Error::AsyncChannelReceiverError
     }
 }
 
-impl From<tungstenite::Error> for Error {
-    fn from(err: tungstenite::Error) -> Error {
-        Error::TungsteniteError(err.to_string())
+impl From<async_native_tls::Error> for Error {
+    fn from(_err: async_native_tls::Error) -> Error {
+        Error::AsyncNativeTlsError
     }
 }
-impl From<async_native_tls::Error> for Error {
-    fn from(err: async_native_tls::Error) -> Error {
-        Error::AsyncNativeTlsError(err.to_string())
+
+impl From<std::net::AddrParseError> for Error {
+    fn from(_err: std::net::AddrParseError) -> Error {
+        Error::AddrParseError
     }
 }
 
 impl From<url::ParseError> for Error {
-    fn from(err: url::ParseError) -> Error {
-        Error::UrlParseError(err.to_string())
+    fn from(_err: url::ParseError) -> Error {
+        Error::UrlParseError
+    }
+}
+
+impl From<hex::FromHexError> for Error {
+    fn from(_err: hex::FromHexError) -> Error {
+        Error::FromHexError
+    }
+}
+
+impl From<std::num::ParseIntError> for Error {
+    fn from(_err: std::num::ParseIntError) -> Error {
+        Error::ParseIntError
+    }
+}
+
+impl From<num_bigint::ParseBigIntError> for Error {
+    fn from(_err: num_bigint::ParseBigIntError) -> Error {
+        Error::ParseBigIntError
+    }
+}
+
+impl From<num_bigint::TryFromBigIntError<num_bigint::BigUint>> for Error {
+    fn from(_err: num_bigint::TryFromBigIntError<num_bigint::BigUint>) -> Error {
+        Error::TryFromBigIntError
+    }
+}
+
+impl From<std::num::ParseFloatError> for Error {
+    fn from(_err: std::num::ParseFloatError) -> Error {
+        Error::ParseFloatError
+    }
+}
+
+impl From<std::string::FromUtf8Error> for Error {
+    fn from(_err: std::string::FromUtf8Error) -> Error {
+        Error::Utf8Error
+    }
+}
+
+impl From<std::str::Utf8Error> for Error {
+    fn from(err: std::str::Utf8Error) -> Error {
+        Error::StrUtf8Error(err.to_string())
+    }
+}
+
+impl From<state::VerifyFailed> for Error {
+    fn from(_err: state::VerifyFailed) -> Error {
+        Error::VerifyFailed
+    }
+}
+
+impl From<client::ClientFailed> for Error {
+    fn from(err: client::ClientFailed) -> Error {
+        Error::ClientFailed(err.to_string())
+    }
+}
+
+#[cfg(feature = "btc")]
+impl From<crate::service::BtcFailed> for Error {
+    fn from(err: crate::service::BtcFailed) -> Error {
+        Error::BtcFailed(err.to_string())
     }
 }
 
@@ -223,8 +294,51 @@ impl From<crate::service::SolFailed> for Error {
     }
 }
 
-impl From<bellman::SynthesisError> for Error {
-    fn from(err: bellman::SynthesisError) -> Error {
-        Error::Groth16Error(err.to_string())
+#[cfg(feature = "eth")]
+impl From<crate::service::EthFailed> for Error {
+    fn from(err: crate::service::EthFailed) -> Error {
+        Error::EthFailed(err.to_string())
+    }
+}
+
+impl From<toml::de::Error> for Error {
+    fn from(err: toml::de::Error) -> Error {
+        Error::TomlDeserializeError(err.to_string())
+    }
+}
+
+impl From<toml::ser::Error> for Error {
+    fn from(err: toml::ser::Error) -> Error {
+        Error::TomlSerializeError(err.to_string())
+    }
+}
+
+impl From<bs58::encode::Error> for Error {
+    fn from(err: bs58::encode::Error) -> Error {
+        Error::Base58EncodeError(err.to_string())
+    }
+}
+
+impl From<bs58::decode::Error> for Error {
+    fn from(err: bs58::decode::Error) -> Error {
+        Error::Base58DecodeError(err.to_string())
+    }
+}
+
+impl From<log::SetLoggerError> for Error {
+    fn from(_err: log::SetLoggerError) -> Error {
+        Error::SetLoggerError
+    }
+}
+
+impl From<tungstenite::Error> for Error {
+    fn from(_err: tungstenite::Error) -> Error {
+        Error::TungsteniteError
+    }
+}
+
+impl From<halo2::plonk::Error> for Error {
+    fn from(_err: halo2::plonk::Error) -> Error {
+        Error::PlonkError
     }
 }

+ 3 - 110
src/lib.rs

@@ -1,11 +1,5 @@
-use std::collections::{HashMap, HashSet};
-
-use bellman::groth16;
-use bls12_381::{Bls12, Scalar};
-
 pub mod async_serial;
 pub mod blockchain;
-pub mod bls_extensions;
 pub mod circuit;
 pub mod cli;
 pub mod client;
@@ -19,111 +13,10 @@ pub mod service;
 pub mod state;
 pub mod system;
 pub mod tx;
+pub mod types;
 pub mod util;
-pub mod vm;
-pub mod vm_serial;
+pub mod vm2;
+pub mod vm2_serial;
 pub mod wallet;
 
-pub use crate::bls_extensions::BlsStringConversion;
 pub use crate::error::{Error, Result};
-pub use crate::net::p2p::P2p;
-pub use crate::serial::{Decodable, Encodable};
-pub use crate::vm::{
-    AllocType, ConstraintInstruction, CryptoOperation, VariableIndex, VariableRef,
-    ZkVirtualMachine, ZkVmCircuit,
-};
-
-pub type Bytes = Vec<u8>;
-
-pub struct ZkContract {
-    pub name: String,
-    pub vm: ZkVirtualMachine,
-    params_map: HashMap<String, VariableIndex>,
-    pub params: HashMap<VariableIndex, Scalar>,
-    public_map: bimap::BiMap<String, VariableIndex>,
-}
-
-pub struct ZkProof {
-    pub public: HashMap<String, Scalar>,
-    pub proof: groth16::Proof<Bls12>,
-}
-
-impl ZkContract {
-    // Just have a load() and save()
-    // Load the contract, do the setup, save it...
-
-    pub fn setup(&mut self, filename: &str) -> Result<()> {
-        self.vm.setup()?;
-
-        let buffer = std::fs::File::create(filename)?;
-        self.vm.params.as_ref().unwrap().write(buffer)?;
-        Ok(())
-    }
-
-    pub fn load_setup(&mut self, filename: &str) -> Result<()> {
-        let buffer = std::fs::File::open(filename)?;
-        let setup = groth16::Parameters::<Bls12>::read(buffer, false)?;
-        let vk = groth16::prepare_verifying_key(&setup.vk);
-        self.vm.params = Some(setup);
-        self.vm.verifying_key = Some(vk);
-        Ok(())
-    }
-
-    pub fn param_names(&self) -> Vec<String> {
-        self.params_map.keys().cloned().collect()
-    }
-    pub fn set_param(&mut self, name: &str, value: Scalar) -> Result<()> {
-        match self.params_map.get(name) {
-            Some(index) => {
-                self.params.insert(*index, value);
-                Ok(())
-            }
-            None => Err(Error::InvalidParamName),
-        }
-    }
-
-    pub fn prove(&mut self) -> Result<ZkProof> {
-        // Error if params not all set
-        let user_params: HashSet<_> = self.params.keys().collect();
-        let req_params: HashSet<_> = self.params_map.values().collect();
-        if user_params != req_params {
-            return Err(Error::MissingParams);
-        }
-
-        // execute
-        let params = std::mem::take(&mut self.params);
-        self.vm.initialize(&params.into_iter().collect())?;
-
-        // prove
-        let proof = self.vm.prove();
-
-        let mut public = HashMap::new();
-        for (index, value) in self.vm.public() {
-            match self.public_map.get_by_right(&index) {
-                Some(name) => {
-                    public.insert(name.clone(), value);
-                }
-                None => return Err(Error::BadContract),
-            }
-        }
-
-        // return proof and public values (Hashmap string -> scalars)
-        Ok(ZkProof { public, proof })
-    }
-    pub fn verify(&self, proof: &ZkProof) -> bool {
-        let mut public = vec![];
-        for (name, value) in &proof.public {
-            match self.public_map.get_by_left(name) {
-                Some(index) => {
-                    public.push((index, *value));
-                }
-                None => return false,
-            }
-        }
-        public.sort_by(|a, b| a.0.partial_cmp(b.0).unwrap());
-        let (_, public): (Vec<VariableIndex>, Vec<Scalar>) = public.into_iter().unzip();
-
-        // Takes proof and public values
-        self.vm.verify(&proof.proof, &public)
-    }
-}

+ 20 - 25
src/serial.rs

@@ -3,8 +3,6 @@ use std::io::{Cursor, Read, Write};
 use std::net::{IpAddr, SocketAddr};
 use std::{io, mem};
 
-use bls12_381 as bls;
-
 use crate::endian;
 use crate::error::{Error, Result};
 
@@ -446,7 +444,7 @@ macro_rules! impl_vec {
         }
     };
 }
-impl_vec!(bls::Scalar);
+
 impl_vec!(SocketAddr);
 impl_vec!([u8; 32]);
 
@@ -542,29 +540,26 @@ impl Decodable for Box<[u8]> {
 
 // Tuples
 macro_rules! tuple_encode {
-($($x:ident),*) => (
-impl <$($x: Encodable),*> Encodable for ($($x),*) {
-#[inline]
-#[allow(non_snake_case)]
-fn encode<S: io::Write>(
-&self,
-mut s: S,
-) -> Result<usize> {
-let &($(ref $x),*) = self;
-let mut len = 0;
-$(len += $x.encode(&mut s)?;)*
-Ok(len)
-}
-}
+    ($($x:ident),*) => (
+        impl <$($x: Encodable),*> Encodable for ($($x),*) {
+            #[inline]
+            #[allow(non_snake_case)]
+            fn encode<S: io::Write>(&self, mut s: S) -> Result<usize> {
+                let &($(ref $x),*) = self;
+                let mut len = 0;
+                $(len += $x.encode(&mut s)?;)*
+                Ok(len)
+            }
+        }
 
-impl<$($x: Decodable),*> Decodable for ($($x),*) {
-#[inline]
-#[allow(non_snake_case)]
-fn decode<D: io::Read>(mut d: D) -> Result<Self> {
-Ok(($({let $x = Decodable::decode(&mut d)?; $x }),*))
-}
-}
-);
+        impl<$($x: Decodable),*> Decodable for ($($x),*) {
+            #[inline]
+            #[allow(non_snake_case)]
+            fn decode<D: io::Read>(mut d: D) -> Result<Self> {
+                Ok(($({let $x = Decodable::decode(&mut d)?; $x }),*))
+            }
+        }
+    );
 }
 
 tuple_encode!(T0, T1);

+ 8 - 8
src/service/bridge.rs

@@ -1,7 +1,7 @@
-use async_std::sync::{Arc, Mutex};
 use std::collections::HashMap;
 
 use async_executor::Executor;
+use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 use futures::stream::FuturesUnordered;
 use futures::stream::StreamExt;
@@ -9,7 +9,7 @@ use log::*;
 
 use crate::util::NetworkName;
 use crate::wallet::cashierdb::TokenKey;
-use crate::{Error, Result};
+use crate::{types::*, Error, Result};
 
 pub struct BridgeRequests {
     pub network: NetworkName,
@@ -55,8 +55,8 @@ pub struct TokenSubscribtion {
 #[derive(Debug)]
 pub struct TokenNotification {
     pub network: NetworkName,
-    pub token_id: jubjub::Fr,
-    pub drk_pub_key: jubjub::SubgroupPoint,
+    pub token_id: DrkTokenId,
+    pub drk_pub_key: DrkPublicKey,
     pub received_balance: u64,
     pub decimals: u16,
 }
@@ -115,7 +115,7 @@ impl Bridge {
 
     pub async fn subscribe(
         self: Arc<Self>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         mint: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> BridgeSubscribtion {
@@ -134,7 +134,7 @@ impl Bridge {
         self: Arc<Self>,
         req: async_channel::Receiver<BridgeRequests>,
         rep: async_channel::Sender<BridgeResponse>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         mint: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<()> {
@@ -238,7 +238,7 @@ impl Bridge {
 pub trait NetworkClient {
     async fn subscribe(
         self: Arc<Self>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         mint: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<TokenSubscribtion>;
@@ -248,7 +248,7 @@ pub trait NetworkClient {
         self: Arc<Self>,
         private_key: Vec<u8>,
         public_key: Vec<u8>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         mint: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<String>;

+ 5 - 5
src/service/btc.rs

@@ -1,4 +1,3 @@
-use async_std::sync::{Arc, Mutex};
 use std::cmp::max;
 use std::collections::BTreeMap;
 use std::convert::{From, TryFrom, TryInto};
@@ -9,6 +8,7 @@ use std::time::{Duration, Instant};
 
 use anyhow::Context;
 use async_executor::Executor;
+use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 
 use bdk::electrum_client::{
@@ -35,7 +35,7 @@ use secp256k1::{
 use super::bridge::{NetworkClient, TokenNotification, TokenSubscribtion};
 use crate::serial::{deserialize, serialize, Decodable, Encodable};
 use crate::util::{generate_id, NetworkName};
-use crate::{Error, Result};
+use crate::{types::*, Error, Result};
 
 // Swap out these types for any future non bitcoin-rs types
 pub type PubAddress = Address;
@@ -357,7 +357,7 @@ impl BtcClient {
     async fn handle_subscribe_request(
         self: Arc<Self>,
         btc_keys: Account,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
     ) -> BtcResult<()> {
         let client = self.client.clone();
 
@@ -528,7 +528,7 @@ impl BtcClient {
 impl NetworkClient for BtcClient {
     async fn subscribe(
         self: Arc<Self>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         _mint: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<TokenSubscribtion> {
@@ -560,7 +560,7 @@ impl NetworkClient for BtcClient {
         self: Arc<Self>,
         private_key: Vec<u8>,
         _public_key: Vec<u8>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         _mint: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<String> {

+ 106 - 205
src/service/eth.rs

@@ -1,8 +1,8 @@
-use async_std::sync::{Arc, Mutex};
 use std::convert::TryInto;
 use std::time::Duration;
 
 use async_executor::Executor;
+use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 use hash_db::Hasher;
 use keccak_hasher::KeccakHasher;
@@ -16,19 +16,14 @@ use super::bridge::{NetworkClient, TokenNotification, TokenSubscribtion};
 use crate::{
     rpc::jsonrpc,
     rpc::jsonrpc::JsonResult,
-    serial::{deserialize, serialize, Decodable, Encodable},
+    serial::{deserialize, serialize},
+    types::*,
     util::{generate_id, parse::truncate, NetworkName},
     Error, Result,
 };
 
 pub const ETH_NATIVE_TOKEN_ID: &str = "0x0000000000000000000000000000000000000000";
 
-#[derive(Clone, Debug)]
-pub struct Keypair {
-    pub private_key: String,
-    pub public_key: String,
-}
-
 // An ERC-20 token transfer transaction's data is as follows:
 //
 // 1. The first 4 bytes of the keccak256 hash of "transfer(address,uint256)".
@@ -106,10 +101,6 @@ pub fn erc20_balanceof_data(account: &str) -> String {
     format!("0x{}{}", hex::encode(*ERC20_BALANCEOF_METHOD), acc_padded)
 }
 
-pub fn erc20_decimals_data() -> String {
-    format!("0x{}", hex::encode(*ERC20_DECIMALS_METHOD))
-}
-
 fn to_eth_hex(val: BigUint) -> String {
     let bytes = val.to_bytes_be();
     let h = hex::encode(bytes);
@@ -184,7 +175,7 @@ impl EthTx {
 //
 pub struct EthClient {
     // main_keypair (private, public)
-    main_keypair: Keypair,
+    main_keypair: (String, String),
     passphrase: String,
     socket_path: String,
     subscriptions: Arc<Mutex<Vec<String>>>,
@@ -195,50 +186,29 @@ pub struct EthClient {
 }
 
 impl EthClient {
-    pub fn new(socket_path: String, passphrase: String) -> Self {
+    pub fn new(
+        socket_path: String,
+        passphrase: String,
+        main_keypair: (String, String),
+    ) -> Arc<Self> {
         let notify_channel = async_channel::unbounded();
         let subscriptions = Arc::new(Mutex::new(Vec::new()));
-        Self {
-            // this must set by the cashier
-            main_keypair: Keypair {
-                private_key: String::new(),
-                public_key: String::new(),
-            },
+        Arc::new(Self {
+            main_keypair,
             passphrase,
             socket_path,
             subscriptions,
             notify_channel,
+        })
         }
     }
 
-    pub fn set_main_keypair(&mut self, keypair: &Keypair) {
-        self.main_keypair = keypair.clone();
-    }
-
-    async fn send_erc20_to_main_wallet(&self, acc: &str, amount: BigUint, mint: &str) -> Result<()> {
-        debug!(target: "ETH BRIDGE", "Send erc20 token to main wallet");
-
-        let tx = EthTx::new(
-            acc,
-            mint,
-            None,
-            None,
-            None,
-            Some(erc20_transfer_data(self.main_keypair.public_key.as_str(), amount)),
-            None,
-        );
-
-        self.send_transaction(&tx, &self.passphrase).await?;
-
-        Ok(())
-    }
-
     async fn send_eth_to_main_wallet(&self, acc: &str, amount: BigUint) -> Result<()> {
         debug!(target: "ETH BRIDGE", "Send eth to main wallet");
 
         let tx = EthTx::new(
             acc,
-            &self.main_keypair.public_key,
+            &self.main_keypair.1,
             None,
             None,
             Some(amount),
@@ -254,39 +224,16 @@ impl EthClient {
     async fn handle_subscribe_request(
         self: Arc<Self>,
         addr: String,
-        drk_pub_key: jubjub::SubgroupPoint,
-        mint: Option<String>,
+        drk_pub_key: DrkPublicKey,
     ) -> Result<()> {
 
-        let token_pubkey = if mint.is_some() {
-            mint.clone().unwrap()
-        } else {
-            addr.clone()
-        };
-
-        if mint.is_some() {
-            debug!(target: "ETH BRIDGE", "Got subscribe request for ERC20 token");
-            debug!(target: "ETH BRIDGE", "Main wallet: {}", addr);
-            debug!(target: "ETH BRIDGE", "Associated token address: {}", token_pubkey);
-        } else {
-            debug!(target: "ETH BRIDGE", "Got subscribe request for native ETH");
-            debug!(target: "ETH BRIDGE", "Main wallet: {}", addr);
-        }
-
-
         if self.subscriptions.lock().await.contains(&addr) {
             return Ok(());
         }
 
-        let decimals = if mint.is_some() {
-            let hexdecimals = self.get_erc20_decimals(&addr, &token_pubkey).await?;
-            let hexdecimals = hexdecimals.as_str().unwrap().trim_start_matches("0x");
-            18
-        } else {
-            18
-        };
+        let decimals = 18;
 
-        let prev_balance = self.get_current_balance(&addr, mint.clone()).await?;
+        let prev_balance = self.get_current_balance(&addr, None).await?;
 
         let mut current_balance;
 
@@ -303,7 +250,7 @@ impl EthClient {
             sub_iter += iter_interval;
             async_std::task::sleep(Duration::from_secs(iter_interval)).await;
 
-            current_balance = self.get_current_balance(&addr, mint.clone()).await?;
+            current_balance = self.get_current_balance(&addr, None).await?;
 
             if current_balance != prev_balance {
                 break;
@@ -316,7 +263,7 @@ impl EthClient {
 
         if current_balance < prev_balance {
             return Err(crate::Error::ClientFailed(
-                    "New balance is less than previous balance".into(),
+                "New balance is less than previous balance".into(),
             ));
         }
 
@@ -324,49 +271,28 @@ impl EthClient {
 
         let received_balance_ui = received_balance.clone() / u64::pow(10, decimals as u32);
 
-
-
-        if mint.is_some() {
-            send_notification
-                .send(TokenNotification {
-                    network: NetworkName::Ethereum,
-                    token_id: generate_id(token_pubkey.as_str(), &NetworkName::Ethereum)?,
-                    drk_pub_key,
-                    // TODO FIX
-                    received_balance: received_balance.to_u64_digits()[0],
-                    decimals: decimals as u16,
-                })
-            .await
-                .map_err(Error::from)?;
-
-            self.send_erc20_to_main_wallet(&addr, received_balance, &token_pubkey)
-                .await?;
-
-            debug!(target: "ETH BRIDGE", "Received {} erc20 token: {}", received_balance_ui, token_pubkey);
-
-        } else {
-            send_notification
-                .send(TokenNotification {
-                    network: NetworkName::Ethereum,
-                    token_id: generate_id(ETH_NATIVE_TOKEN_ID, &NetworkName::Ethereum)?,
-                    drk_pub_key,
-                    // TODO FIX
-                    received_balance: received_balance.to_u64_digits()[0],
-                    decimals: decimals as u16,
-                })
+        send_notification
+            .send(TokenNotification {
+                network: NetworkName::Ethereum,
+                token_id: generate_id(ETH_NATIVE_TOKEN_ID, &NetworkName::Ethereum)?,
+                drk_pub_key,
+                // TODO FIX
+                received_balance: received_balance.to_u64_digits()[0],
+                decimals: decimals as u16,
+            })
             .await
-                .map_err(Error::from)?;
+            .map_err(Error::from)?;
 
-            self.send_eth_to_main_wallet(&addr, received_balance)
-                .await?;
+        self.send_eth_to_main_wallet(&addr, received_balance)
+            .await?;
 
-            debug!(target: "ETH BRIDGE", "Received {} eth", received_balance_ui );
+        debug!(target: "ETH BRIDGE", "Received {} eth", received_balance_ui );
         }
 
         Ok(())
     }
 
-    async fn unsubscribe(&self, pubkey: &str) {
+    async fn unsubscribe(&self, pubkey: &String) {
         let mut subscriptions = self.subscriptions.lock().await;
         let index = subscriptions.iter().position(|p| p == pubkey);
         if let Some(ind) = index {
@@ -380,10 +306,10 @@ impl EthClient {
         let reply: JsonResult = match jsonrpc::send_unix_request(&self.socket_path, json!(r))
             .await
             .map_err(EthFailed::from)
-            {
-                Ok(v) => v,
-                Err(e) => return Err(e),
-            };
+        {
+            Ok(v) => v,
+            Err(e) => return Err(e),
+        };
 
         match reply {
             JsonResult::Resp(r) => {
@@ -409,11 +335,11 @@ impl EthClient {
     }
 
     /*
-       pub async fn estimate_gas(&self, tx: &EthTx) -> Result<Value> {
-       let req = jsonrpc::request(json!("eth_estimateGas"), json!([tx]));
-       Ok(self.request(req).await?)
-       }
-       */
+    pub async fn estimate_gas(&self, tx: &EthTx) -> Result<Value> {
+    let req = jsonrpc::request(json!("eth_estimateGas"), json!([tx]));
+    Ok(self.request(req).await?)
+    }
+    */
 
     pub async fn block_number(&self) -> EthResult<Value> {
         let req = jsonrpc::request(json!("eth_blockNumber"), json!([]));
@@ -439,40 +365,18 @@ impl EthClient {
         Ok(self.request(req).await?)
     }
 
-    pub async fn get_erc20_decimals(&self, acc: &str, mint: &str) -> EthResult<Value> {
-        let tx = EthTx::new(
-            acc,
-            mint,
-            None,
-            None,
-            None,
-            Some(erc20_decimals_data()),
-            None,
-        );
-        let req = jsonrpc::request(json!("eth_call"), json!([tx, "latest"]));
-        Ok(self.request(req).await?)
-    }
-
-    pub async fn get_current_balance(&self, acc: &str, mint: Option<String>) -> EthResult<BigUint> {
-
-
-        let hexbalance = if mint.is_some() {
-            // ERC20 balance
-            self.get_erc20_balance(acc, mint.unwrap().as_str()).await?
-        } else {
-            // Latest known block, used to calculate present balance.
-            let block = self.block_number().await?;
-            let block = block.as_str().unwrap();
-
-            // Native ETH balance
-            self.get_eth_balance(acc, block).await?
-        };
-
+    pub async fn get_current_balance(&self, acc: &str, _mint: Option<&str>) -> EthResult<BigUint> {
+        // Latest known block, used to calculate present balance.
+        let block = self.block_number().await?;
+        let block = block.as_str().unwrap();
 
+        // Native ETH balance
+        let hexbalance = self.get_eth_balance(&acc, block).await?;
         let hexbalance = hexbalance.as_str().unwrap().trim_start_matches("0x");
         let balance = BigUint::parse_bytes(hexbalance.as_bytes(), 16).unwrap();
 
         Ok(balance)
+
     }
 
     pub async fn send_transaction(&self, tx: &EthTx, passphrase: &str) -> EthResult<Value> {
@@ -485,8 +389,8 @@ impl EthClient {
 impl NetworkClient for EthClient {
     async fn subscribe(
         self: Arc<Self>,
-        drk_pub_key: jubjub::SubgroupPoint,
-        mint_address: Option<String>,
+        drk_pub_key: DrkPublicKey,
+        _mint_address: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<TokenSubscribtion> {
         let private_key = generate_privkey();
@@ -503,13 +407,13 @@ impl NetworkClient for EthClient {
         executor
             .spawn(async move {
                 let result = self
-                    .handle_subscribe_request(addr_cloned, drk_pub_key, mint_address)
+                    .handle_subscribe_request(addr_cloned, drk_pub_key)
                     .await;
                 if let Err(e) = result {
                     error!(target: "ETH BRIDGE SUBSCRIPTION","{}", e.to_string());
                 }
             })
-        .detach();
+            .detach();
 
         let private_key: Vec<u8> = serialize(&private_key);
 
@@ -523,8 +427,8 @@ impl NetworkClient for EthClient {
         self: Arc<Self>,
         _private_key: Vec<u8>,
         public_key: Vec<u8>,
-        drk_pub_key: jubjub::SubgroupPoint,
-        mint_address: Option<String>,
+        drk_pub_key: DrkPublicKey,
+        _mint_address: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<String> {
         let public_key: String = deserialize(&public_key)?;
@@ -532,12 +436,12 @@ impl NetworkClient for EthClient {
         let address = public_key.clone();
         executor
             .spawn(async move {
-                let result = self.handle_subscribe_request(address, drk_pub_key, mint_address).await;
+                let result = self.handle_subscribe_request(address, drk_pub_key).await;
                 if let Err(e) = result {
                     error!(target: "ETH BRIDGE SUBSCRIPTION","{}", e.to_string());
                 }
             })
-        .detach();
+            .detach();
 
         Ok(public_key)
     }
@@ -549,40 +453,26 @@ impl NetworkClient for EthClient {
     async fn send(
         self: Arc<Self>,
         address: Vec<u8>,
-        mint: Option<String>,
+        _mint: Option<String>,
         amount: u64,
     ) -> Result<()> {
         // Recipient address
         let dest: String = deserialize(&address)?;
 
-        // FIXME
         let decimals = 18;
 
         // reverse truncate
         let amount = truncate(amount, decimals as u16, 8)?;
 
-
-        let tx = if mint.is_some() {
-            EthTx::new(
-                &self.main_keypair.public_key,
-                &mint.unwrap(),
-                None,
-                None,
-                None,
-                Some(erc20_transfer_data(&dest, BigUint::from(amount))),
-                None,
-            )
-        } else {
-            EthTx::new(
-                &self.main_keypair.public_key,
-                &dest,
-                None,
-                None,
-                Some(BigUint::from(amount)),
-                None,
-                None,
-            )
-        };
+        let tx = EthTx::new(
+            &self.main_keypair.1,
+            &dest,
+            None,
+            None,
+            Some(BigUint::from(amount)),
+            None,
+            None,
+        );
 
         self.send_transaction(&tx, &self.passphrase).await?;
 
@@ -590,48 +480,59 @@ impl NetworkClient for EthClient {
     }
 }
 
-impl Encodable for Keypair {
-    fn encode<S: std::io::Write>(&self, mut s: S) -> Result<usize> {
-        let mut len = 0;
-        len += self.private_key.encode(&mut s)?;
-        len += self.public_key.encode(&mut s)?;
-        Ok(len)
-    }
-}
-
-impl Decodable for Keypair {
-    fn decode<D: std::io::Read>(mut d: D) -> Result<Self> {
-        Ok(Self {
-            private_key: Decodable::decode(&mut d)?,
-            public_key: Decodable::decode(&mut d)?,
-        })
-    }
-}
-
-#[derive(Debug, Clone, thiserror::Error)]
+#[derive(Debug)]
 pub enum EthFailed {
-    #[error("There is no enough value {0}")]
     NotEnoughValue(u64),
-    #[error("Main Account Has no enough value")]
     MainAccountNotEnoughValue,
-    #[error("Bad Eth Address: {0}")]
     BadEthAddress(String),
-    #[error("Decode and decode keys error: {0}")]
     DecodeAndEncodeError(String),
-    #[error("Rpc Error: {0}")]
     RpcError(String),
-    #[error("Eth client error: {0}")]
     EthClientError(String),
-    #[error("Given mint is not valid: {0}")]
     MintIsNotValid(String),
-    #[error("JsonError: {0}")]
     JsonError(String),
-    #[error("Parse Error: {0}")]
     ParseError(String),
-    #[error("Unable to derive address from private key")]
     ImportPrivateError,
 }
 
+impl std::error::Error for EthFailed {}
+
+impl std::fmt::Display for EthFailed {
+    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
+        match self {
+            EthFailed::NotEnoughValue(i) => {
+                write!(f, "There is no enough value {}", i)
+            }
+            EthFailed::MainAccountNotEnoughValue => {
+                write!(f, "Main Account Has no enough value")
+            }
+            EthFailed::BadEthAddress(ref err) => {
+                write!(f, "Bad Eth Address: {}", err)
+            }
+            EthFailed::DecodeAndEncodeError(ref err) => {
+                write!(f, "Decode and decode keys error: {}", err)
+            }
+            EthFailed::RpcError(i) => {
+                write!(f, "Rpc Error: {}", i)
+            }
+            EthFailed::ParseError(i) => {
+                write!(f, "Parse Error: {}", i)
+            }
+            EthFailed::MintIsNotValid(i) => {
+                write!(f, "Given mint is not valid: {}", i)
+            }
+            EthFailed::JsonError(i) => {
+                write!(f, "JsonError: {}", i)
+            }
+            EthFailed::ImportPrivateError => {
+                write!(f, "Unable to derive address from private key")
+            }
+            EthFailed::EthClientError(i) => {
+                write!(f, "Eth client error: {}", i)
+            }
+        }
+    }
+}
+
 impl From<crate::error::Error> for EthFailed {
     fn from(err: crate::error::Error) -> EthFailed {
         EthFailed::EthClientError(err.to_string())

+ 2 - 3
src/service/gateway.rs

@@ -1,8 +1,7 @@
-use std::net::ToSocketAddrs;
-
-use async_std::sync::Arc;
 use std::convert::From;
 use std::net::SocketAddr;
+use std::net::ToSocketAddrs;
+use std::sync::Arc;
 
 use async_executor::Executor;
 use log::debug;

+ 0 - 1
src/service/mod.rs

@@ -1,4 +1,3 @@
-//pub mod cashier;
 pub mod bridge;
 pub mod gateway;
 pub mod reqrep;

+ 4 - 5
src/service/reqrep.rs

@@ -1,10 +1,9 @@
-use async_std::prelude::*;
-use async_std::sync::Arc;
-use std::convert::TryFrom;
 use std::io;
 use std::net::SocketAddr;
+use std::sync::Arc;
 
 use async_executor::Executor;
+use async_std::prelude::*;
 use bytes::Bytes;
 use futures::FutureExt;
 use log::*;
@@ -13,8 +12,8 @@ use signal_hook::consts::SIGINT;
 use signal_hook_async_std::Signals;
 use zeromq::*;
 
-use crate::serial::{deserialize, serialize};
-use crate::{Decodable, Encodable, Result};
+use crate::serial::{deserialize, serialize, Decodable, Encodable};
+use crate::Result;
 
 pub type PeerId = Vec<u8>;
 

+ 6 - 8
src/service/sol.rs

@@ -1,14 +1,12 @@
-use async_std::sync::{Arc, Mutex};
-use std::convert::TryFrom;
 use std::str::FromStr;
 use std::time::Duration;
 
 use async_executor::Executor;
 use async_native_tls::TlsConnector;
+use async_std::sync::{Arc, Mutex};
 use async_trait::async_trait;
 use futures::{SinkExt, StreamExt};
 use log::{debug, error, info, warn};
-use rand::rngs::OsRng;
 use serde::Serialize;
 use serde_json::{json, Value};
 use solana_client::{blockhash_query::BlockhashQuery, rpc_client::RpcClient};
@@ -28,7 +26,7 @@ use super::bridge::{NetworkClient, TokenNotification, TokenSubscribtion};
 use crate::rpc::{jsonrpc, jsonrpc::JsonResult, websockets, websockets::WsStream};
 use crate::serial::{deserialize, serialize, Decodable, Encodable};
 use crate::util::{generate_id, parse::truncate, NetworkName};
-use crate::{Error, Result};
+use crate::{types::*, Error, Result};
 
 pub const SOL_NATIVE_TOKEN_ID: &str = "So11111111111111111111111111111111111111112";
 
@@ -97,7 +95,7 @@ impl SolClient {
     async fn handle_subscribe_request(
         self: Arc<Self>,
         keypair: Keypair,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         mint: Option<Pubkey>,
     ) -> SolResult<()> {
         debug!(target: "SOL BRIDGE", "handle_subscribe_request()");
@@ -419,11 +417,11 @@ impl SolClient {
 impl NetworkClient for SolClient {
     async fn subscribe(
         self: Arc<Self>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         mint_address: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<TokenSubscribtion> {
-        let keypair = Keypair::generate(&mut OsRng);
+        let keypair = Keypair::new();
 
         let public_key = keypair.pubkey().to_string();
         let private_key = serialize(&keypair);
@@ -459,7 +457,7 @@ impl NetworkClient for SolClient {
         self: Arc<Self>,
         private_key: Vec<u8>,
         _public_key: Vec<u8>,
-        drk_pub_key: jubjub::SubgroupPoint,
+        drk_pub_key: DrkPublicKey,
         mint_address: Option<String>,
         executor: Arc<Executor<'_>>,
     ) -> Result<String> {

+ 44 - 14
src/state.rs

@@ -1,19 +1,23 @@
-use bellman::groth16;
-use bls12_381::Bls12;
+use std::fmt;
+
 use log::debug;
 
 use crate::{
-    crypto::{coin::Coin, merkle_node::MerkleNode, note::EncryptedNote, nullifier::Nullifier},
-    tx,
+    crypto::{
+        coin::Coin, merkle_node2::MerkleNode, note::EncryptedNote, nullifier::Nullifier,
+        proof::VerifyingKey, schnorr,
+    },
+    tx::Transaction,
+    types::{DrkCoinBlind, DrkPublicKey, DrkSecretKey, DrkSerial, DrkTokenId, DrkValueBlind},
 };
 
 pub trait ProgramState {
-    fn is_valid_cashier_public_key(&self, public: &jubjub::SubgroupPoint) -> bool;
+    fn is_valid_cashier_public_key(&self, public: &schnorr::PublicKey) -> bool;
     fn is_valid_merkle(&self, merkle: &MerkleNode) -> bool;
     fn nullifier_exists(&self, nullifier: &Nullifier) -> bool;
 
-    fn mint_pvk(&self) -> &groth16::PreparedVerifyingKey<Bls12>;
-    fn spend_pvk(&self) -> &groth16::PreparedVerifyingKey<Bls12>;
+    fn mint_vk(&self) -> &VerifyingKey;
+    fn spend_vk(&self) -> &VerifyingKey;
 }
 
 pub struct StateUpdate {
@@ -46,10 +50,37 @@ pub enum VerifyFailed {
     AssetMismatch,
 }
 
-pub fn state_transition<S: ProgramState>(
-    state: &S,
-    tx: tx::Transaction,
-) -> VerifyResult<StateUpdate> {
+impl std::error::Error for VerifyFailed {}
+
+impl fmt::Display for VerifyFailed {
+    fn fmt(&self, f: &mut fmt::Formatter) -> std::fmt::Result {
+        match *self {
+            VerifyFailed::InvalidCashierKey(i) => {
+                write!(f, "Invalid cashier public key for clear input {}", i)
+            }
+            VerifyFailed::InvalidMerkle(i) => {
+                write!(f, "Invalid merkle root for input {}", i)
+            }
+            VerifyFailed::DuplicateNullifier(i) => {
+                write!(f, "Duplicate nullifier for input {}", i)
+            }
+            VerifyFailed::SpendProof(i) => write!(f, "Spend proof for input {}", i),
+            VerifyFailed::MintProof(i) => write!(f, "Mint proof for input {}", i),
+            VerifyFailed::ClearInputSignature(i) => {
+                write!(f, "Invalid signature for clear input {}", i)
+            }
+            VerifyFailed::InputSignature(i) => write!(f, "Invalid signature for input {}", i),
+            VerifyFailed::MissingFunds => {
+                f.write_str("Money in does not match money out (value commits)")
+            }
+            VerifyFailed::AssetMismatch => {
+                f.write_str("Assets don't match some inputs or outputs (token commits)")
+            }
+        }
+    }
+}
+
+pub fn state_transition<S: ProgramState>(state: &S, tx: Transaction) -> VerifyResult<StateUpdate> {
     // Check deposits are legit
 
     debug!(target: "STATE TRANSITION", "iterate clear_inputs");
@@ -67,7 +98,6 @@ pub fn state_transition<S: ProgramState>(
     debug!(target: "STATE TRANSITION", "iterate inputs");
 
     for (i, input) in tx.inputs.iter().enumerate() {
-        // Check merkle roots
         let merkle = &input.revealed.merkle_root;
 
         // Merkle is used to know whether this is a coin that existed
@@ -87,7 +117,7 @@ pub fn state_transition<S: ProgramState>(
 
     debug!(target: "STATE TRANSITION", "Check the tx Verifies correctly");
     // Check the tx verifies correctly
-    tx.verify(state.mint_pvk(), state.spend_pvk())?;
+    tx.verify(state.mint_vk(), state.spend_vk())?;
 
     let mut nullifiers = vec![];
     for input in tx.inputs {
@@ -99,7 +129,7 @@ pub fn state_transition<S: ProgramState>(
     let mut enc_notes = vec![];
     for output in tx.outputs {
         // Gather all the coins
-        coins.push(Coin::new(output.revealed.coin));
+        coins.push(Coin(output.revealed.coin.clone()));
         enc_notes.push(output.enc_note);
     }
 

+ 49 - 65
src/tx/builder.rs

@@ -1,6 +1,4 @@
-use bellman::groth16;
-use bls12_381::Bls12;
-use ff::Field;
+use pasta_curves::arithmetic::Field;
 use rand::rngs::OsRng;
 
 use super::{
@@ -8,10 +6,14 @@ use super::{
     Transaction, TransactionClearInput, TransactionInput, TransactionOutput,
 };
 use crate::crypto::{
-    create_mint_proof, create_spend_proof, merkle::MerklePath, merkle_node::MerkleNode, note::Note,
-    schnorr,
+    mint_proof::create_mint_proof, note::Note, schnorr, spend_proof::create_spend_proof,
+};
+use crate::{
+    crypto::merkle_node2::MerkleNode,
+    serial::Encodable,
+    types::{DrkCoinBlind, DrkPublicKey, DrkSecretKey, DrkSerial, DrkTokenId, DrkValueBlind},
+    Result,
 };
-use crate::serial::Encodable;
 
 pub struct TransactionBuilder {
     pub clear_inputs: Vec<TransactionBuilderClearInputInfo>,
@@ -21,32 +23,33 @@ pub struct TransactionBuilder {
 
 pub struct TransactionBuilderClearInputInfo {
     pub value: u64,
-    pub token_id: jubjub::Fr,
-    pub signature_secret: jubjub::Fr,
+    pub token_id: DrkTokenId,
+    pub signature_secret: schnorr::SecretKey,
 }
 
 pub struct TransactionBuilderInputInfo {
-    pub merkle_path: MerklePath<MerkleNode>,
-    pub secret: jubjub::Fr,
+    pub leaf_position: incrementalmerkletree::Position,
+    pub merkle_path: Vec<MerkleNode>,
+    pub secret: DrkSecretKey,
     pub note: Note,
 }
 
 pub struct TransactionBuilderOutputInfo {
     pub value: u64,
-    pub token_id: jubjub::Fr,
-    pub public: jubjub::SubgroupPoint,
+    pub token_id: DrkTokenId,
+    pub public: DrkPublicKey,
 }
 
 impl TransactionBuilder {
     fn compute_remainder_blind(
         clear_inputs: &[PartialTransactionClearInput],
-        input_blinds: &[jubjub::Fr],
-        output_blinds: &[jubjub::Fr],
-    ) -> jubjub::Fr {
-        let mut total = jubjub::Fr::zero();
+        input_blinds: &[DrkValueBlind],
+        output_blinds: &[DrkValueBlind],
+    ) -> DrkValueBlind {
+        let mut total = DrkValueBlind::zero();
 
         for input in clear_inputs {
-            total += input.valcom_blind;
+            total += input.value_blind;
         }
 
         for input_blind in input_blinds {
@@ -60,23 +63,18 @@ impl TransactionBuilder {
         total
     }
 
-    pub fn build(
-        self,
-        mint_params: &groth16::Parameters<Bls12>,
-        spend_params: &groth16::Parameters<Bls12>,
-    ) -> Transaction {
+    pub fn build(self) -> Result<Transaction> {
         let mut clear_inputs = vec![];
-        let token_commit_blind: jubjub::Fr = jubjub::Fr::random(&mut OsRng);
+        let token_blind = DrkValueBlind::random(&mut OsRng);
         for input in &self.clear_inputs {
-            let signature_public =
-                zcash_primitives::constants::SPENDING_KEY_GENERATOR * input.signature_secret;
+            let signature_public = input.signature_secret.public_key();
+            let value_blind = DrkValueBlind::random(&mut OsRng);
 
-            let valcom_blind: jubjub::Fr = jubjub::Fr::random(&mut OsRng);
             let clear_input = PartialTransactionClearInput {
                 value: input.value,
                 token_id: input.token_id,
-                valcom_blind,
-                token_commit_blind,
+                value_blind,
+                token_blind,
                 signature_public,
             };
             clear_inputs.push(clear_input);
@@ -85,36 +83,25 @@ impl TransactionBuilder {
         let mut inputs = vec![];
         let mut input_blinds = vec![];
         let mut signature_secrets = vec![];
-        for input in &self.inputs {
-            input_blinds.push(input.note.valcom_blind);
-
-            let signature_secret: jubjub::Fr = jubjub::Fr::random(&mut OsRng);
+        for input in self.inputs {
+            input_blinds.push(input.note.value_blind);
 
-            // make proof
-
-            // TODO: Some stupid glue code. Need to sort this out
-            let auth_path: Vec<(bls12_381::Scalar, bool)> = input
-                .merkle_path
-                .auth_path
-                .iter()
-                .map(|(node, b)| ((*node).into(), *b))
-                .collect();
+            let signature_secret = schnorr::SecretKey::random();
 
             let (proof, revealed) = create_spend_proof(
-                spend_params,
                 input.note.value,
                 input.note.token_id,
-                input.note.valcom_blind,
-                token_commit_blind,
+                input.note.value_blind,
+                token_blind,
                 input.note.serial,
                 input.note.coin_blind,
                 input.secret,
-                auth_path,
-                signature_secret,
-            );
+                input.leaf_position,
+                input.merkle_path,
+                signature_secret.clone(),
+            )?;
 
             // First we make the tx then sign after
-            let signature_secret = schnorr::SecretKey(signature_secret);
             signature_secrets.push(signature_secret);
 
             let input = PartialTransactionInput {
@@ -128,26 +115,25 @@ impl TransactionBuilder {
         let mut output_blinds = vec![];
 
         for (i, output) in self.outputs.iter().enumerate() {
-            let valcom_blind = if i == self.outputs.len() - 1 {
+            let value_blind = if i == self.outputs.len() - 1 {
                 Self::compute_remainder_blind(&clear_inputs, &input_blinds, &output_blinds)
             } else {
-                jubjub::Fr::random(&mut OsRng)
+                DrkValueBlind::random(&mut OsRng)
             };
-            output_blinds.push(valcom_blind);
+            output_blinds.push(value_blind);
 
-            let serial: jubjub::Fr = jubjub::Fr::random(&mut OsRng);
-            let coin_blind: jubjub::Fr = jubjub::Fr::random(&mut OsRng);
+            let serial = DrkSerial::random(&mut OsRng);
+            let coin_blind = DrkCoinBlind::random(&mut OsRng);
 
             let (mint_proof, revealed) = create_mint_proof(
-                mint_params,
                 output.value,
                 output.token_id,
-                valcom_blind,
-                token_commit_blind,
+                value_blind,
+                token_blind,
                 serial,
                 coin_blind,
                 output.public,
-            );
+            )?;
 
             // Encrypted note
 
@@ -156,10 +142,10 @@ impl TransactionBuilder {
                 value: output.value,
                 token_id: output.token_id,
                 coin_blind,
-                valcom_blind,
+                value_blind,
             };
 
-            let encrypted_note = note.encrypt(&output.public).unwrap();
+            let encrypted_note = note.encrypt(&output.public)?;
 
             let output = TransactionOutput {
                 mint_proof,
@@ -176,13 +162,11 @@ impl TransactionBuilder {
         };
 
         let mut unsigned_tx_data = vec![];
-        partial_tx
-            .encode(&mut unsigned_tx_data)
-            .expect("TODO handle this");
+        partial_tx.encode(&mut unsigned_tx_data)?;
 
         let mut clear_inputs = vec![];
         for (input, info) in partial_tx.clear_inputs.into_iter().zip(self.clear_inputs) {
-            let secret = schnorr::SecretKey(info.signature_secret);
+            let secret = info.signature_secret;
             let signature = secret.sign(&unsigned_tx_data[..]);
             let input = TransactionClearInput::from_partial(input, signature);
             clear_inputs.push(input);
@@ -199,10 +183,10 @@ impl TransactionBuilder {
             inputs.push(input);
         }
 
-        Transaction {
+        Ok(Transaction {
             clear_inputs,
             inputs,
             outputs: partial_tx.outputs,
-        }
+        })
     }
 }

+ 55 - 43
src/tx/mod.rs

@@ -1,20 +1,29 @@
 pub mod builder;
 pub mod partial;
 
-use bellman::groth16;
-use bls12_381::Bls12;
-use group::Group;
 use std::io;
 
-use self::partial::{PartialTransactionClearInput, PartialTransactionInput};
-use crate::crypto::{
-    note::EncryptedNote, schnorr, verify_mint_proof, verify_spend_proof, MintRevealedValues,
-    SpendRevealedValues,
+use pasta_curves::group::Group;
+
+use crate::{
+    crypto::{
+        mint_proof::verify_mint_proof,
+        note::EncryptedNote,
+        proof::{Proof, VerifyingKey},
+        schnorr,
+        spend_proof::verify_spend_proof,
+        util::{mod_r_p, pedersen_commitment_scalar, pedersen_commitment_u64},
+        MintRevealedValues, SpendRevealedValues,
+    },
+    error::Result,
+    impl_vec,
+    serial::{Decodable, Encodable, VarInt},
+    state,
+    types::{
+        DrkCoinBlind, DrkPublicKey, DrkSecretKey, DrkSerial, DrkTokenId, DrkValue, DrkValueBlind,
+        DrkValueCommit,
+    },
 };
-use crate::error::Result;
-use crate::impl_vec;
-use crate::serial::{Decodable, Encodable, VarInt};
-use crate::state;
 
 pub use self::builder::{
     TransactionBuilder, TransactionBuilderClearInputInfo, TransactionBuilderInputInfo,
@@ -29,21 +38,21 @@ pub struct Transaction {
 
 pub struct TransactionClearInput {
     pub value: u64,
-    pub token_id: jubjub::Fr,
-    pub valcom_blind: jubjub::Fr,
-    pub token_commit_blind: jubjub::Fr,
-    pub signature_public: jubjub::SubgroupPoint,
+    pub token_id: DrkTokenId,
+    pub value_blind: DrkValueBlind,
+    pub token_blind: DrkValueBlind,
+    pub signature_public: schnorr::PublicKey,
     pub signature: schnorr::Signature,
 }
 
 pub struct TransactionInput {
-    pub spend_proof: groth16::Proof<Bls12>,
+    pub spend_proof: Proof,
     pub revealed: SpendRevealedValues,
     pub signature: schnorr::Signature,
 }
 
 pub struct TransactionOutput {
-    pub mint_proof: groth16::Proof<Bls12>,
+    pub mint_proof: Proof,
     pub revealed: MintRevealedValues,
     pub enc_note: EncryptedNote,
 }
@@ -57,11 +66,6 @@ impl Transaction {
         Ok(len)
     }
 
-    fn compute_pedersen_commit(value: jubjub::Fr, blind: &jubjub::Fr) -> jubjub::SubgroupPoint {
-        (zcash_primitives::constants::VALUE_COMMITMENT_VALUE_GENERATOR * value)
-            + (zcash_primitives::constants::VALUE_COMMITMENT_RANDOMNESS_GENERATOR * blind)
-    }
-
     fn verify_token_commitments(&self) -> bool {
         assert_ne!(self.outputs.len(), 0);
         let token_commit_value = self.outputs[0].revealed.token_commit;
@@ -77,7 +81,7 @@ impl Transaction {
                 .any(|output| output.revealed.token_commit != token_commit_value);
         failed = failed
             || self.clear_inputs.iter().any(|input| {
-                Self::compute_pedersen_commit(input.token_id, &input.token_commit_blind)
+                pedersen_commitment_scalar(mod_r_p(input.token_id), input.token_blind)
                     != token_commit_value
             });
         !failed
@@ -85,28 +89,30 @@ impl Transaction {
 
     pub fn verify(
         &self,
-        mint_pvk: &groth16::PreparedVerifyingKey<Bls12>,
-        spend_pvk: &groth16::PreparedVerifyingKey<Bls12>,
+        mint_pvk: &VerifyingKey,
+        spend_pvk: &VerifyingKey,
     ) -> state::VerifyResult<()> {
-        let mut valcom_total = jubjub::SubgroupPoint::identity();
+        let mut valcom_total = DrkValueCommit::identity();
+
         for input in &self.clear_inputs {
-            let value = jubjub::Fr::from(input.value);
-            valcom_total += Self::compute_pedersen_commit(value, &input.valcom_blind);
+            valcom_total += pedersen_commitment_u64(input.value, input.value_blind);
         }
+
         for (i, input) in self.inputs.iter().enumerate() {
-            if !verify_spend_proof(spend_pvk, &input.spend_proof, &input.revealed) {
+            if verify_spend_proof(spend_pvk, input.spend_proof.clone(), &input.revealed).is_err() {
                 return Err(state::VerifyFailed::SpendProof(i));
             }
             valcom_total += &input.revealed.value_commit;
         }
+
         for (i, output) in self.outputs.iter().enumerate() {
-            if !verify_mint_proof(mint_pvk, &output.mint_proof, &output.revealed) {
+            if verify_mint_proof(mint_pvk, &output.mint_proof, &output.revealed).is_err() {
                 return Err(state::VerifyFailed::MintProof(i));
             }
             valcom_total -= &output.revealed.value_commit;
         }
 
-        if valcom_total != jubjub::SubgroupPoint::identity() {
+        if valcom_total != DrkValueCommit::identity() {
             return Err(state::VerifyFailed::MissingFunds);
         }
 
@@ -120,13 +126,13 @@ impl Transaction {
         self.encode_without_signature(&mut unsigned_tx_data)
             .expect("TODO handle this");
         for (i, input) in self.clear_inputs.iter().enumerate() {
-            let public = schnorr::PublicKey(input.signature_public);
+            let public = &input.signature_public;
             if !public.verify(&unsigned_tx_data[..], &input.signature) {
                 return Err(state::VerifyFailed::ClearInputSignature(i));
             }
         }
         for (i, input) in self.inputs.iter().enumerate() {
-            let public = schnorr::PublicKey(input.revealed.signature_public);
+            let public = &input.revealed.signature_public;
             if !public.verify(&unsigned_tx_data[..], &input.signature) {
                 return Err(state::VerifyFailed::InputSignature(i));
             }
@@ -137,12 +143,15 @@ impl Transaction {
 }
 
 impl TransactionClearInput {
-    fn from_partial(partial: PartialTransactionClearInput, signature: schnorr::Signature) -> Self {
+    fn from_partial(
+        partial: partial::PartialTransactionClearInput,
+        signature: schnorr::Signature,
+    ) -> Self {
         Self {
             value: partial.value,
             token_id: partial.token_id,
-            valcom_blind: partial.valcom_blind,
-            token_commit_blind: partial.token_commit_blind,
+            value_blind: partial.value_blind,
+            token_blind: partial.token_blind,
             signature_public: partial.signature_public,
             signature,
         }
@@ -152,15 +161,18 @@ impl TransactionClearInput {
         let mut len = 0;
         len += self.value.encode(&mut s)?;
         len += self.token_id.encode(&mut s)?;
-        len += self.valcom_blind.encode(&mut s)?;
-        len += self.token_commit_blind.encode(&mut s)?;
+        len += self.value_blind.encode(&mut s)?;
+        len += self.token_blind.encode(&mut s)?;
         len += self.signature_public.encode(s)?;
         Ok(len)
     }
 }
 
 impl TransactionInput {
-    fn from_partial(partial: PartialTransactionInput, signature: schnorr::Signature) -> Self {
+    fn from_partial(
+        partial: partial::PartialTransactionInput,
+        signature: schnorr::Signature,
+    ) -> Self {
         Self {
             spend_proof: partial.spend_proof,
             revealed: partial.revealed,
@@ -201,8 +213,8 @@ impl Encodable for TransactionClearInput {
         let mut len = 0;
         len += self.value.encode(&mut s)?;
         len += self.token_id.encode(&mut s)?;
-        len += self.valcom_blind.encode(&mut s)?;
-        len += self.token_commit_blind.encode(&mut s)?;
+        len += self.value_blind.encode(&mut s)?;
+        len += self.token_blind.encode(&mut s)?;
         len += self.signature_public.encode(&mut s)?;
         len += self.signature.encode(s)?;
         Ok(len)
@@ -214,8 +226,8 @@ impl Decodable for TransactionClearInput {
         Ok(Self {
             value: Decodable::decode(&mut d)?,
             token_id: Decodable::decode(&mut d)?,
-            valcom_blind: Decodable::decode(&mut d)?,
-            token_commit_blind: Decodable::decode(&mut d)?,
+            value_blind: Decodable::decode(&mut d)?,
+            token_blind: Decodable::decode(&mut d)?,
             signature_public: Decodable::decode(&mut d)?,
             signature: Decodable::decode(d)?,
         })

+ 16 - 15
src/tx/partial.rs

@@ -1,12 +1,13 @@
-use bellman::groth16;
-use bls12_381::Bls12;
 use std::io;
 
 use super::TransactionOutput;
-use crate::crypto::SpendRevealedValues;
-use crate::error::Result;
-use crate::impl_vec;
-use crate::serial::{Decodable, Encodable, VarInt};
+use crate::{
+    crypto::{schnorr, spend_proof::SpendRevealedValues, Proof},
+    error::Result,
+    impl_vec,
+    serial::{Decodable, Encodable, VarInt},
+    types::{DrkCoinBlind, DrkPublicKey, DrkSecretKey, DrkSerial, DrkTokenId, DrkValueBlind},
+};
 
 pub struct PartialTransaction {
     pub clear_inputs: Vec<PartialTransactionClearInput>,
@@ -16,14 +17,14 @@ pub struct PartialTransaction {
 
 pub struct PartialTransactionClearInput {
     pub value: u64,
-    pub token_id: jubjub::Fr,
-    pub valcom_blind: jubjub::Fr,
-    pub token_commit_blind: jubjub::Fr,
-    pub signature_public: jubjub::SubgroupPoint,
+    pub token_id: DrkTokenId,
+    pub value_blind: DrkValueBlind,
+    pub token_blind: DrkValueBlind,
+    pub signature_public: schnorr::PublicKey,
 }
 
 pub struct PartialTransactionInput {
-    pub spend_proof: groth16::Proof<Bls12>,
+    pub spend_proof: Proof,
     pub revealed: SpendRevealedValues,
 }
 
@@ -52,8 +53,8 @@ impl Encodable for PartialTransactionClearInput {
         let mut len = 0;
         len += self.value.encode(&mut s)?;
         len += self.token_id.encode(&mut s)?;
-        len += self.valcom_blind.encode(&mut s)?;
-        len += self.token_commit_blind.encode(&mut s)?;
+        len += self.value_blind.encode(&mut s)?;
+        len += self.token_blind.encode(&mut s)?;
         len += self.signature_public.encode(&mut s)?;
         Ok(len)
     }
@@ -63,8 +64,8 @@ impl Decodable for PartialTransactionClearInput {
         Ok(Self {
             value: Decodable::decode(&mut d)?,
             token_id: Decodable::decode(&mut d)?,
-            valcom_blind: Decodable::decode(&mut d)?,
-            token_commit_blind: Decodable::decode(&mut d)?,
+            value_blind: Decodable::decode(&mut d)?,
+            token_blind: Decodable::decode(&mut d)?,
             signature_public: Decodable::decode(&mut d)?,
         })
     }

Некоторые файлы не были показаны из-за большого количества измененных файлов